Today I was reviewing some old code I wrote in Zend Framework. One of the things I was doing in the Bootstrap.php file was creating an function called _initViewSettings(). In here I set a bunch of values for the xhtml version, the css files to include, etc. Now I realize my mistake: (more…)
All entries of my technical and business blog.
Theme/Template System in Zend Framework
Theme systems are very common in projects written on Drupal, Joomla, and Wordpress. I didn’t see much out of the box support for themes in Zend Framework at first. However, I was wrong. It’s pretty easy. The only real decision I had to make is if I want to make themes that extend a default theme - or themes that are simple and on their own / totally encapsulated. I will do the encapsulated version... (more…)
Using MySQL Bit Field as a Flag Field: Not a Good Idea
The last time I created a char(1) for a flag field, I remembered the MySQL BIT field - so I did a bit of investigation. I thought, well if I can make a bit field of one bit that is either 0/1, I can save data space in my db. (more…)
setTimeout proper syntax
The javascript function setTimeout can be used to execute a function after a specified amount of delay. It uses the javascript callback pattern. Its important to use the callback pattern correctly, however, or you may get different results than you expect. One example of this is the immediate execution of a function versus the callback execution. Note this example: (more…)
Want to come work with me? Let's do some PHP!
Do you like to be challenged, learn new things, and have a supportive team? Well, let’s chat a bit. I’m building a team and I’m looking for great PHP developers to join it. (more…)
Remove .svn folders from Eclipse Project Explorer
It had been irritating to me seeing the .svn folders littered throughout my project workspace. In addition, they all show up in the search results… this can be irritating with the svn-base files that show the old version of the file before a commit. (more…)
Why IP Authorization No Longer Works on Web Apps
The last time someone brought up authorizing certain actions by IP address - or I should say, limiting the amount of actions that can happen by one IP address. I brushed that off without a second thought. It didn’t occur to me until later that the original owner of that idea may not have known all the reasons why I know this isn’t a good idea. So here’s a quick rundown: (more…)
Count lines of code in Eclipse
When searching for how to count the lines of code I had in my project, I ran into this blog entry. While its a good start, it still gave me some inaccurate counts. I was getting inflated counts because of new lines. So, here is my alternate solution: (more…)
A faster alternative to image beacons with 1x1 gif
So it seems like a very common solution for tracking hit rates is the transparent 1x1 pixel gif. Load this and parse your access logs: requests logged. (more…)
Scoping your Bookmarklet Correctly
I’ve been lucky so far. I’ve used variable names and functions in my bookmarklets that weren’t that common. Then, one day, I chose a variable named something very common (x, counter, etc). I noticed that my bookmarklet accidentally overwrote some properties in the current page. Now, that could be benefit - you could want your bookmarklet to update/manage variables in the current page. However, most times I believe we don’t want that scope overlap. (more…)