All entries of my technical and business blog
DIRECTORY_SEPARATOR is Useless!
The predefined PHP constant DIRECTORY_SEPARATOR is useless.
array_merge is Useful - But With a Caveat
So, the other day, I saw a horrible thing. I saw two PHP associative arrays that needed to be combined into one, and the worst example of NOT using PHP’s built in functions to combine them. They weren’t using array_merge - instead they were looping through each value.
How desktop.ini saved me from myself
When working at “the triangle” we used junction points on windows to link to repositories that we needed to run the code base - but weren’t necessary for the project. (see creating junction points on windows with linkd.exe.)
Ode to a MySpace Layout
PHP SPL autoload: 3 simple rules you must follow
While working on a larger site that I may need to use many external libraries, I realized I need to come up with a better __autoload() function (for example, I think it was DOMPDF that had its own autoload function as well. Last time I used that, I had to hack my own autoload to use their code as well to locate files). I researched into SPL autoload functionality, and I’ve found what I need.
CSS incompatibility finder
This is more of a proof of concept than anything else - as most of my scripts are ;) But, let’s say you have some files that have css in them, either external stylesheets, internal one with style tags or even style attributes - and you need to update the browser support. Wouldn’t it be great to have a tool that could look through these files and point out that there are incompatibilities?
Don't focus me, bro!
I hate filling out login forms to discover that half of my password is in the username box. Let’s talk about why - and then a solution.
SVN Pre-commit duty: Lint your PHP
We’ve all been there before, committing code - and then realizing that it was broken (hrm - our unit test didn’t catch it? or… “what unit test?” if you’re in another environment). Well, there is a solution.
To clear up that confusion about public and public static access in PHP
Apparently, a few programmers I know have been getting confused about access of public, public static variables in PHP classes. I’ve written this example code with the following comments to explain what will work - and what won’t.