Code Snippets by Hawkee
(30)
This code will search the library. Add RegexKitLite.h and RegexKitLite.m to your Classes folder and follow these steps to add a linker flag to make the library work properly:
Project > Edit Active..
+ 0 likes
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.
+ 0 likes
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 to re-perform..
+ 3 likes
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:
You can use this in multiple groups on the same..
+ 0 likes
This is a very simple Javascript toggle that'll show or hide a div depending on its current state. Here is the HTML code:
+ 1 likes
This snippet will display each of your Hawkee friends sorted by the number of comments they've posted. It uses the viewer and person objects to build an array of friends, then sorts by a custom person..
+ 0 likes
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
+ 0 likes
This is a little snippet that will remove any non-ASCII characters from a string.
+ 0 likes
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..
+ 0 likes
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..
+ 0 likes
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..
+ 0 likes
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..
+ 0 likes
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..
+ 0 likes
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.
+ 0 likes
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..
+ 0 likes
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..
+ 0 likes
This is a very simple Ruby snippet that creates an unnecessary function.
+ 0 likes
This is a ready to go PHP script that can be pasted into a blank .php document. Run it through your webserver after changing $myemail to the value of your E-Mail address. It also sends the referring..
+ 0 likes








