Category Archives: Programming

Los Angeles Headshots by Richard Sumilang Richard Sumilang Los Angeles Headshot Photography

Facebook Page Analytics

with Ruby On Rails

I decided to flex my programming muscle and try something new. I’ve done Ruby for CLI tools and Chef cookbooks but never a Ruby on Rails (RoR) application. Much of the hype with RoR is gone these days but it’s been around long enough to be considered tested and somewhat mature like an old elitist hipster… If that makes sense.

tldr; Just give me the source


The project was to create a Rails applications that provides analytics for the last 100 Facebook posts of a Facebook page. As a user, you should be able to login using Facebook, see a list of pages that you have authorized admin access to, and lastly see a display of the pages' top 5 posts (out of the last 100) as well as a sortable table of the 100 most recent posts.

Read More
Dec 20, 2015 6 min read

Using jQuery mobile in a ECMAScript 6 project

Oh the pain...

I started using ECMAScript 6 in a project which required supporting the dependencies I was upgrading from. I used Babel JS to transpile my ES6 code with browserify and everything was working fine until I got to jQuery-mobile.

Read More
Mar 11, 2015 3 min read

A thing or two about style guides

A style guide should be chosen when working on a solo project or with a team. This keeps the code manageable when you or your peers come back to work on it in the future. It doesn’t matter which style guideline you choose as long as you stick with it. In a sense, writing clean code will also help reduce technical debt. Below is a collection of style guides that I collected over time. Some important rules are repeated in other styles. It’s nice to keep consistency (to a degree) if you are writing in multiple programming languages but ultimately it’s best to do what’s best for each language.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”

Martin Fowler, Refactoring: Improving the Design of Existing Code

Read More
Feb 8, 2015 2 min read

Working with Apple's iOS image orientation

Using PHP and ImageMagick

You might notice pictures taken with an iOS device (iPhone or iPad) look like they are not rotated properly when transferring them to another device or software. This happens because the device is held at a certain angle when the picture is taken and it’s up to the software at the receiving end to display it however it wants.

Apple’s camera will write orientation info into the exif headers of images taken and you can rotate it accordingly.

Here is an example of rotating an image using PHP with the ImageMagick library;

Read More
Oct 17, 2014 1 min read

jQuery CORS fix for IE8 and IE9

No browser is left behind

Who can blame jQuery for not wanting to support Internet Explorer? Despite whatever the reason, it doesn’t always make business sense and we must support it. I found this piece of code that patches the issue with jQuery.

Read More
Jun 20, 2014 1 min read

Design Patterns Cheat Sheet

Here’s a quick cheat sheet for lots of design patterns. The examples in this post are linked to Java examples however they are not limited to a single language implementation. Special thanks to Derek Banas.

Read More
Jun 2, 2014 5 min read

iOS Simulator Link

The iOS Simulator is obviously a must have tool for development. Web development is no exception but Apple makes you jump through a few hoops (Xcode) to get to it. Luckily you can run it as a standalone application.

Read More
May 14, 2014 1 min read

Assembla SVN SSL Certificate Issue

I kept getting the following message when I tried running svn commands on my computer. I tried to accept the certificate permanently with no luck:

Error validating server certificate for '':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: *
 - Valid: from Wed, 16 Apr 2014 13:31:17 GMT until Thu, 24 Mar 2016 19:30:40 GMT
 - Issuer:,, Inc., Scottsdale, Arizona, US
 - Fingerprint: ec:9f:9d:b2:39:e1:34:81:7b:27:f6:51:30:8b:ac:41:5b:62:09:19
(R)eject, accept (t)emporarily or accept (p)ermanently?
Read More
May 12, 2014 1 min read

Type Casting String by Concatenation Performance Test in PHP

The purpose of this test is to see if casting an object to a string by concatenating it was actually slower than using normal type casting. Here is my source:

Read More
May 8, 2014 1 min read

How to install Gearman for PHP on OS X

Setup Gearman for PHP with OS X 10.9.2 Mavericks using brew. This requires libgearman and the easiest way to get it is probably to install gearman through brew, of course.

Read More
Apr 23, 2014 1 min read