Skip navigation

Category Archives: /home/bryn/bin/git

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.

Bryn's Smarty Debug Console
I’ve cleaned up and released my old variant on the Smarty debug template. Better navigation, better view of vars and using HTML5 as the basis. More improvements to come in the future.

The gist for it can be found on Github.

You may have noticed the links at the bottom of every page here disguised as `scp` commands. I’ll explain what each is and what they will direct you to. Read More »