Blog
How to zero fill a number with PHP
Zero filling (or zero padding) is when you pad a value on the left side to a specific length. This is something you will commonly see in database schemas for integer columns. But what if we're not working with data [...]
How to get keys from an associative array in PHP
One of PHP's most powerful features are arrays and the multitude of functions available to interact with and manipulate them. Arrays can be indexed by integers as well as string, known as an associative array. Instead of looping through the [...]
Dynamic page titles with GitHub Pages
Ran into a bit of an issue today when deploying some changes to my blog. The home page, which was working just fine locally, was being treated as if it were a blog post page. What keyed me off to [...]
Passing variables to anonymous PHP functions
The other day I ran into a situation (first time, it seems) where I needed to access a variable inside of an anonymous function inside of preg_replace_callback(). My first thought, even though it went against my better judgement was to [...]
Opt-out responsive design using LESS
I liked Chris Coyier's post Opt-Out Responsive Design? but really didn't like the idea of having to qualify all of my selectors with a parent class to indicate that we should be using the responsive version of the site. I [...]
Using list() with foreach() in PHP
Continuing my showcasing of all of the awesomeness in PHP 5.5 that I am discovering since my upgrade from 5.3, let's discuss using the the list() function inside of a foreach() block. Have you ever had a situation where you [...]
Linode is my favorite DNS hosting provider
There, I said it. Even though I've moved my day to day server needs to bare metal, I still keep a 1GB Linode instance spun up so that I can take advantage of what I consider to be one of [...]
Upgrade from PHP 5.3 to PHP 5.4 on Ubuntu 10.04 LTS
I've previously posted about upgrading to PHP 5.5.x on Ubuntu 12.04 LTS but what about my friends still on the even older Ubuntu Long Term Service release that's still supported, 10.04 LTS. That particular version's server release will remain supported [...]
"Failed to open page" on Windows Phone 8
I ran into an issue a few days ago after pushing some hand rolled "infinite scroll" logic to my sites. One of my users reported getting the "Failed to open page" error on her Windows Phone 8 using UC Browser [...]
Using Keyring Access on the OSX Command-line
If you're like me, you probably have a private dotfiles that supplements your public dotfiles repository. It contains private values like API keys and [hopefully not] plaintext passwords. There's even a good chance you're using git submodules or a setup [...]