timeout, a setTimeout wrapper for jQuery
Submitted by jebaird on Fri, 06/12/2009 - 10:36Timeout is a simple jQuery plugin that allows you to delay the execution of code for a certain number of milliseconds. It works like the jQuery delay plugin http://www.evanbot.com/article/jquery-delay-plugin/4 which i didn't know existed at the time I wrote this plugin.
plugin code
Caching Dynamic PHP Pages Easliy
Submitted by jebaird on Fri, 04/10/2009 - 20:05Over the past month or so I have been toying with the idea of developing a way to cache dynamic PHP pages with out a lot of overhead. I stumbled across this blog entry: http://papermashup.com/caching-dynamic-php-pages-easily the idea was so simple it was almost too easy. So I took it upon my self to turn the original code and some of the user comments code into a class. I have made some minor changes(cleaned up if statements, fixed a bug dealing with the cached version of the page not getting serve
z-index image map hack
Submitted by jebaird on Sat, 12/20/2008 - 01:00While working on one of my newer projects I ran into an issue where I needed to overlay a very large image over multiple elements on my page, including the site navigation. This left the contact link on the far right un-clickible.
PHP MySQL Row Lock function
Submitted by jebaird on Wed, 10/15/2008 - 01:00I just started on a project that I knew was going to need some sort of data lock that would prevent 2 users from editing the same data at the same time. At first I thought that i would have to write a function that behaved like the C function flock(). I ran across this forum post http://www.dmcinsights.com/phorum/read.php?13,30233,30260 which I have to give credit to is the inspiration for the code below.
JW player with SWFObject
Submitted by jebaird on Thu, 08/14/2008 - 14:29Recently i was working on a project that required a flash media player. I was trying to integrate JW FLV Media Player using SWFObject. After losing a few hours of my life trying to pass a variable in a query string to a php script that generated a XML play list, I stumbled upon/discovered this solution.
the JW FLV Media Player documentation currently reads like this
php forcing SSL Connection
Submitted by jebaird on Sat, 08/02/2008 - 00:00I was updating some code on dirtondirt.com. We had changed the way sessions/logins where used on the site. Everything worked great in Firefox. But we were getting complaints that it was randomly dropping logged in users using IE . I was was not able to recreate the issue so it was very hard to troubleshoot. I believe that this method hacks around IE 4k size on disk issue (if the cookie is larger than 4k then IE has a tendency to drop it).After a couple hours of research I found these solutions.
php session drop cookie fix for Internet Expoler
Submitted by jebaird on Fri, 07/25/2008 - 00:00I was updating some code on dirtondirt.com. We had changed the way sessions/logins where used on the site. Everything worked great in Firefox. But we were getting complaints that it was randomly dropping logged in users using IE . I was was not able to recreate the issue so it was very hard to troubleshoot. I believe that this method hacks around IE 4k size on disk issue (if the cookie is larger than 4k then IE has a tendency to drop it).After a couple hours of research I found these solutions.
Calculating Distance in Miles from Latitude and Longitude
Submitted by jebaird on Tue, 07/15/2008 - 00:00Finding good examples for Calculating Distance in Miles from Latitude and Longitude Using Mysql and PHP wasn’t as easy as I thought it would be. I thought I would compile the working quires and the functions that I wrote/found.
I found a very good paper on the topic at Scribd. I used one the the examples from this paper.
PHP Countires, States, Provinces and Territories Array
Submitted by jebaird on Sat, 07/12/2008 - 00:00A couple of projects ago I needed the ability to have international users. I looked for some php functions that would make the task of registering users a little easier. I found some html lists and turned them into php functions that return arrays
Php MySQL pagination with one database query
Submitted by jebaird on Thu, 06/05/2008 - 00:00Pagination is one of the simple features of a site if used right can be a great feature. For something very simple it seems to be a resource hog. For a while I have been looking for a way to paganate with out issuing two database queries. After some quick searching I could not find what I was looking for, so I came up a method that uses a one query + a sub-query.
Quick Review
The method that I have seen the most, looks like some like this.