Code Snippets by Hawkee
(25)
This is a sample javascript gadget. It only displays text, but it uses the gadget syntax referenced on Google:
http://code.google.com/apis/gadgets/docs/gs.html
So far we support gadgets and are
Tags:
gadget
This is a little snippet that will remove any non-ASCII characters from a string.
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 by price or
This will extract a zip file via PHP. Just be sure to set the $file and $path variables. $file represents the zip file name which may or may not contain a path. $path represents the directory to extract
This is a very handy command line use of perl. You basically execute the s// function of perl on a handful of files to do a global search and replace. Just run this from the command line and indicate
This is more of a note to myself, but I use it to dump databases where there are additional fields in the new table. When you're upgrading a database you can either add the new fields to the old table
This was used in our
The display is either "none" if we don't need to show the "Full Review" link or "inline" which will make the dots appear after the cut-off text.
This will copy the text in a given field to the clipboard. Unfortunately it only works in IE, so Firefox users will still need to do the actual copy. But it'll at least select the text for Firefox users.
Here
I always need these for my CSS development. They're great for making your CSS more visible for debugging. You can include one or all in your main stylesheet and just apply the style to any div you're
This can be used in conjunction with my snippet. The colors are what we use here at Hawkee, so please feel free to change them. If you find a scheme that works well post it as a snippet.
This will assign font sizes to tags based on their counts. It tries to evenly distribute the font sizes among the tags while keeping all tags with the same counts under the same font size. The data needs
I thought this was pretty neat and useful. You can combine strtotime with the date function to create your own date verbally. This is just an alternative to using mktime that's a little more intuiti
This is a stand alone example of a review system. This is the administration page for entering and editing reviews. It'll create your table for you automatically, so all you need to do is change the
This is a very simple Ruby snippet that creates an unnecessary function.






