Code Snippets by Hawkee

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..
0 comment(s)  ·   ·  jQuery Snippet
Feb 12, 2013
This uses jQuery to convert an HTML string containing <code> tags into language specific
2 comment(s)  ·   ·  jQuery Snippet
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.
8 comment(s)  ·   ·  mySQL Snippet
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..
0 comment(s)  ·   ·  PHP Snippet
May 10, 2012
This is the server side component to my
1 comment(s)  ·   ·  node.js Snippet
Apr 16, 2012
This will automatically append the next page of results as you continue to scroll down a page. Features: - Define a number of pages to append before pausing with a "Show More"..
31 comment(s)  ·   ·  jQuery Snippet
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..
4 comment(s)  ·   ·  mySQL Snippet
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..
1 comment(s)  ·   ·  Web Snippet
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..
126 comment(s)  ·   ·  jQuery Snippet
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..
5 comment(s)  ·   ·  PHP Snippet
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..
18 comment(s)  ·   ·  PHP Snippet
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..
0 comment(s)  ·   ·  Shell Snippet
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...
6 comment(s)  ·   ·  PHP Snippet
Mar 07, 2009
This code will search the
22 comment(s)  ·   ·  iPhone Snippet
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.
7 comment(s)  ·   ·  PHP Snippet
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..
4 comment(s)  ·   ·  PHP Snippet
Oct 18, 2008
This is a simple Javascript snippet that lets you toggle a group of checkboxes on or off at the same time. This is the format for your HTML form:
2 comment(s)  ·   ·  Javascript Snippet
Sep 10, 2008
This is a very simple Javascript toggle that'll show or hide a div depending on its current state. Here is the HTML code:
15 comment(s)  ·   ·  Javascript Snippet
Mar 31, 2008
This is a little snippet that will remove any non-ASCII characters from a string.
1 comment(s)  ·   ·  PHP Snippet
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..
3 comment(s)  ·   ·  PHP Snippet
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: page_name.html|page..
101 comment(s)  ·   ·  PHP Snippet
  1. 1
  2. 2
  3. Next
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.