May 11, 2013

Custom RecursiveIterator

PHP RecursiveIterator and its relatives are quite handy in any tree-related situation. Probably the most used is RecursiveDirectoryIterator for getting all files recursively in a directory. But this family of iterators has some issues to be addressed so that developers do not end up fleeing. First, you must not fear SPL. But there's more. Let's see…

Keep empty directories in git: The VERY easy way

I keep hearing this question over and over in the internets: How do I keep an empty directory in git?
And they're usually followed by a hundred of different answers, mostly "you can't" and very complicated ones.
But, in fact, there is a way that's pretty EASY:

January 16, 2013

Sublime Text 2 snippet Getter/Setter

It's almost a month since I embraced Sublime Text as my daily editor, even for coding. And I love how much easier my life is now. As an example, here's a snippet I just made to avoid writing all that getter/setter bolierplate over and over again in PHP…