Common CodeIgniter Configuration Tasks

Common CodeIgniter Configuration Tasks

Lately I’ve been learning and doing a lot of work with CodeIgniter. So far, I really like it, and it has lived up to its claim of being “a powerful PHP framework with a small footprint.”

After going through the process of setting up a few different website apps, I have found a handful of common tasks and changes that I make for just about every app. I’ve included these all below for convenience and easy reference.

Read the rest of this entry »

Extending JavaScript Objects and Classes

Recently I was working on a project where I was working with dates in JavaScript, and found myself needing to output the dates as numbers with leading zeros. Since I had multiple places in my code where I needed to add the leading zeros, I decided to extend the JavaScript Number object rather than just making some inline logic that would be repeated in multiple places.

Now if you’re familiar with JavaScript, you know that extending a JavaScript object is nothing new. Regardless, the code snippet below shows how to add a custom function to a built-in JavaScript object using the Object.prototype property.

Number.prototype.addLeadingZero = function() {
    return (this > 9) ? String(this) : "0" + this;
// Sample usage
var myNum = 9;
console.log(myNum.addLeadingZero()); // Outputs "09"

Note that in the code snippet above, my addLeadingZero method always returns a String, rather than a Number, even if a leading zero isn’t added. This was intentional for my purposes, and necessary for returning a number with a leading zero.

If you find yourself needing to extend a JavaScript object, you can use simply use the Object.prototype property, and add in your own custom method(s). This makes your custom method accessible on the specified object type (Number, in my example above).

Until next time, happy coding!

Customizing the ActionBar Title and Content Description in Android Apps

In one of the recent Android apps on which I was working, our team had the app audited for Accessibility. (Side note: If you’ve never given a second thought to Accessibility in your app, it’s a great learning experience, albeit a humbling one as well.) One of the items that came out of the audit was to use more descriptive contentDescription attributes for elements like buttons and form fields, as well as for ActionBar items. In particular, for non-home Activities that had up navigation, there was a request to customize the contentDescription attribute on the up button, in an effort to make it more descriptive and meaningful to the user. While this did not prove to be a difficult task thanks to some helpful code on setting the contentDescription found on StackOverflow, I ran into a unique issue trying to set it while also customizing the ActionBar title. In short, in order to properly set a custom contentDescription and ActionBar title, you must set the ActionBar title first, and then set the contentDescription for its up button. Otherwise, Android will disregard the just-set contentDescription value and use the default value gleaned from the ActionBar title.

Sample Code

How about some sample code? Here’s some helpful methods you can use in your Android apps to set the ActionBar title and the contentDescription for its up button. But remember, set the ActionBar title first.

public void setActionBarTitle(CharSequence value) {
public void setHomeButtonContentDescription(CharSequence value) {
    ((View) getWindow().getDecorView().findViewById(;

Until next time, happy (and accessible) coding!

Custom UIColor Extensions for iOS

Custom UIColor Extensions for iOS

The more I develop iOS mobile apps, the more I find myself customizing existing classes using Categories. Most recently, I’ve found myself in need of using a set of custom colors, and making a category on top of the UIColor class allows a great way to add custom colors for use throughout an app.

If you’re new to Categories, making one is super easy, and only takes a few quick steps.

Read the rest of this entry »

Successful Tech Ecosystems, Part 2: Google

Google HQ

In Successful Tech Ecosystems, Part 1: Apple, I talked about Apple and their successful technological ecosystem. Well as you know, they’re not the only show in town. Google has an equally as amazing ecosystem, including everything from search to Android mobile devices to unparalleled cloud storage (and as of Google I/O 2014, even Android Wear and more). And like Apple, Google and their products and services have created an equally loyal following of customers.

Read the rest of this entry »