The predefined PHP constant DIRECTORY_SEPARATOR is useless. (more…)
All entries of my technical and business blog.
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.) (more…)
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. (more…)
Ode to a MySpace Layout
sigh Things change… and so does MySpace. (more…)
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.... (more…)
CSS incompatibility finder
This is more of a proof of concept than anything else - as most of my scripts are ;) But, lets 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? (more…)
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. (more…)
Don't focus me, bro!
I hate filling out login forms to discover that half of my password is in the username box. Lets talk about why - and then a solution. (more…)
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. (more…)
dtemplate: dynamic template system for static designed files
One of the biggest time wasters I deal with is parsing out static web designs given to me by designers. They don’t know programming, so they design it with static HTML in mind. Even if you’re using a tool like dreamweaver, updating static pages can be a hassle. Then, a lot of times, they have to remove their ‘lorem ipsum’ text and send it to me - and then I continue to chop it up.... (more…)