Blog
How to handle daylight savings time in PHP
If you've ever dealt with time in PHP you've probably been burnt by daylight savings time before (quite possibly yesterday ;). I've been there, waking up on the Sunday of the time change with an email about timestamps being an [...]
Temporary ufw rules or How I learned to stop scripting and love the shell
This post was originally planned to be a social commentary on the potential for riots this coming Novemeber (a/k/a The 2013 Food Stamp Riots a/k/a The Backlash of the Entitlement Society) but that seemed like such a fucking downer. Then [...]
Split an array into chunks with PHP
Array chunking is a great way to paginate large arrays and as I found out recently, makes it very easy to map a large array from Redis (by way of mget and/or pipelining) back to the original data. Chunking an [...]
Were termites the least of our problems?
I'm definitely starting to think so at this point. If you're not aware, last week our house was tented for termites and we took a mini vacation to New Orleans. What most don't know is that this tenting was over [...]
Shuffle an associative array with PHP
PHP makes it really easy to randomize the order of an array with the shuffle() function. If you've ever used this function on an associative array you know that the array will be randomized, but the keys will be dropped [...]
New Orleans is more than just Mardi Gras you know
Blogging from the French Quarter in New Orleans today. A recent bout of termite infestation has left us with a circus tent full noxious gas enclosing our house and no place to call home for a few days. We were [...]
Incrementing / Decrementing a String with PHP
In the past, we've discussed incrementing and decrementing a variable and incrementing and decrementing a number by another number but did you know that we can also increment and decrement a string? You can use the shorthand operators ++ or [...]
The Pitfalls of Using BuySellAds
BuySellAds (BSA) is a platform for selling advertisements on your website. They take a mere 25% cut of sales and offer you a marketplace listing to help you gain exposure to potential advertisers. I love the idea and have attempted [...]
Simple Probability Distribution with PHP
We've all been there, trying to juggle two or more things for either split testing or just because you want some variety. This came up recently for me with juggling advertising networks and I wrote some simply code to handle [...]
LinkedIn Endorsements are Nonsense
Recently a former coworker of mine sent out an email to her LinkedIn network pleading with us to leave her a thoughtful recommendation instead of just endorsing her for skills. Unfortunately, I never worked directly with her at the job [...]