All entries of my technical and business blog

Using MySQL Bit Field as a Flag Field: Not a Good Idea

May 10, 2011 mysql

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.

setTimeout proper syntax

May 3, 2011 javascript

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:

Want to come work with me? Let's do some PHP!

Apr 29, 2011 misc-web php

I no longer work for LPi and do not know what job openings are available.

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.

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:

Scoping your Bookmarklet Correctly

Mar 22, 2011 javascript

I’ve been lucky so far. I’ve used variable names and functions in my bookmarklet’s 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.

Google Analytics Campaign Link Builder Bookmarklet

Mar 15, 2011 javascript

I was thinking about how difficult it is to create custom links for our campaigns at “the big L” - so I decided to create my own function to build these. To top it off, I’ll make it a bookmarklet. The best thing about it is that it will bring in the current page and put that inside of the bookmarklet in the case you want to build the link right from the page you’re viewing.

PHP Doc for non declared properties in your class

Mar 8, 2011 misc-web php

You may find while working with projects like Zend Framework that you have a number of publicly available properties of your classes that are not defined and documented. They might be part of a getter/setter magic method or just purely dynamic. Well, using PHPDoc, there is a cool tag called property that helps. For example…