Feb 21, 2013
This will take a string of keywords and wrap a highlight span around each word. It takes two inputs: keywords and element:
keywords: The keywords to be highlighted.
element: Where we..
Feb 12, 2013
This uses jQuery to convert an HTML string containing <code> tags into language specific
Nov 04, 2012
This will run nl2br on everything inside a string except for what is between the opening and closing tags. For example you can add <br>'s to a comment that contains
Nov 01, 2012
These are the steps necessary to compile the SphinxSE plugin for mySQL 5.5. This varies slightly from the 5.1 method because you don't use the ./configure command.
Before you had to..
Oct 05, 2012
This is a very handy query that sorts your tables by their physical size in megabytes. Just be sure to edit the query to include the database name.
Jul 27, 2012
This is a command line script that interfaces with Minecraft via rcon. It gives all the players on your server a chance to win a random item by typing "join". Here are the different..
May 15, 2012
This is an easy to maintain method for creating clean urls without any file extensions. It's very good for hiding your underlying programming language and offers a more user friendly experience...
May 12, 2012
Ever wonder how many posts were made over the past few days or months? This is a very simple data visualization tool that shows you exactly how many.
To set it up you need to add your..
May 10, 2012
This is the server side component to my
Apr 16, 2012
This will automatically append the next page of results as you continue to scroll down a page.
- Define a number of pages to append before pausing with a "Show More"..
Apr 15, 2012
This is a very handy command to avoid running the same query twice. It will tell you how many total rows there are when you only need a handful. You need to run the second query immediately..
Mar 30, 2012
This will allow you to style the Uploadify upload button. Normally this button is generated through the flash object, so it's a bit tricky replacing it with a CSS button. You have to use..
Mar 22, 2012
This widget lets you search for users to @mention in your posts. It works very much like Facebook and Google+ in that it supports users with spaces in their name. It writes to a hidden..
Mar 02, 2012
This will take the date and time posted of an object in mySQL and convert it to a human readable form through PHP. It has 3 different modes of displaying the age:
- The number of hours..
Mar 21, 2011
This function will return a list of page numbers similar to the Google search results style. It will currently show up to 15 page numbers at a time and this value can be adjusted within..
Mar 09, 2011
This is a very useful script for monitoring mySQL load on a server. It will check your mySQL slow query log file and email the contents to you. It also appends the size of the file to..
Jan 19, 2011
This will take a CSV file, create a table, and insert the data. The file needs to have a header row indicating the field names. Once it's created it uses a simple load data infile call...
Mar 07, 2009
This code will search the
Jan 21, 2009
This is a very short and simple snippet that will take a given string, $string, and if it is plural the 's' will be removed from the $string.
Nov 19, 2008
This will extract the search query from a Google search. It doesn't specifically look for Google in the referer so it may capture more than just Google searches. You can use this information..
Oct 18, 2008
Sep 10, 2008
Mar 31, 2008
This is a little snippet that will remove any non-ASCII characters from a string.
Mar 24, 2008
This code produces a sort box for any number of arbitrary criteria on any type of data you have in your database. For this particular example we've got a product sort where users can sort..
Dec 10, 2007
This is a very simple PHP snippet that will set $title, $meta_keywords and $meta_description for use in your page header. You'll need to create meta_tags.txt which will use this format: