Support for generators (via the yield keyword) has been added to PHP 5.5 and allows you to create simple iterators without the use of the Iterator interface. What’s this all mean? It boils down to overhead, generators use less memory…
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…
String dereferencing allows you direct access to individual characters. The dereferencing syntax is just like accessing an array element by it’s index: $string = ‘This is my awesome string!’; echo ‘First Character: ‘ . $string[0] . “n”; echo ‘Tenth Character:…
Imagine my surprise to see this warning during my morning review of the rootkit checkers that run nightly on my boxes. The thing is, there were no other anomalies on the box aside from /usr/sbin/php5-fpm being bound to a port…
I had previously discussed using try / catch / finally and a fine reader pointed out that I didn’t mention catching multiple exceptions. He’s right, I dropped the ball and decided to dedicate today’s post to catching multiple exceptions. To…
As of late I’ve been very adamant about DRY CSS principles. Not so much the descriptive ID and class selectors that some folks wrap their other selectors in, but the focus on not repeating the properties and grouping like selectors.…
This is partially for LOLz and partially for serious. I’m a guy in Tampa looking for people that want to kick ass with me. I know some very talented individuals in the area but nothing’s really gotten off the ground…
Saving files to disk is a pretty simple task in PHP with file_put_contents(). Here’s how to write a string to a file: $string = ‘I AM STRING!!’; file_put_contents(‘/path/to/destination’, $string); It is generally good practice to only do with when you…
The start of 2014 has been an exercise in going back to basics for me. I’ve been re-evaluating my workflows when hacking and attempting to streamline as much as humanly possible. This has resulted in a ton of new aliases…
I do a lot of coding in Python and one thing that I really love is the mindset of asking for forgiveness instead of permission. What’s this mean? It means that instead of sanity checking every little thing, just handling…