Skip navigation

Monthly Archives: August 2011

inBuckets()One of the biggest nightmares I’ve had to deal with is unpredictable cache keys. Inevitably, someone codes a function that uses its parameters in the key name. In many cases, this is fine. However, when you need to deal with paginated or grouped data in different sizes, things can get messy. To that end, I lean on PHP’s range() function.

Setting up the input for range() and making the output usable is something I’ve ended up doing over and over again, so I’m finally taking an implementation sharing it to save everyone the labor of dealing with it (including myself). And thus, I submit inBuckets() for your perusal (hosted at GitHub – sadly wordpress.com won’t let us embed Gists). The syntax is in the doc block and there’s commented out sample code at the end to get you started. Enjoy.

Here’s an Apache one-liner I often find myself using. It will list all of the server names and alises that are contained in the active Apache config files on a machine. I’ll go into the parts of the command and how to modify it to suit your needs. This assumes a bash-like shell (with grep, sed, sort, tr and a for loop), root (or permission to run the httpd binary directly) and if you wish to modify the examples, a little command-fu.

Read More »

ProFont in action (hmmm... what language is that?) Tonight I started using ProFont and fell in love.
I’d been a fan of Proggy Clean for a few years, but needed characters it didn’t support well (such as ‡ and »).
Read More »