Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
A quick and simple way to search a MySQL database. Example: mysql_search('items', 'title tags', isset($_GET['q'])?$_GET['q']:'', Array('columns'=>'*', 'method'=>'OR', 'extra_sql'=>'AND active = "true" ORDER BY id DESC'));
5
1198
posted 17 years ago by lmcdougall
Script takes links that are not on your domain and opens them in a new window. This code allows for XHTML strict validation and meets Accessibility criteria on opening new windows.
5
1192
posted 17 years ago by skatan
Obviously there's no real crytpo here -- use this for cases like regenerating and emailing a user password.
1
1150
posted 17 years ago by ches
A way to call a function before the window is unloaded/refreshed/etc. Used in the first E-shot Management System. Useful for auto-saving data/content before the window is closed or refreshed.
1
1034
posted 17 years ago by andyhartleeds
Strip out non-alphanumeric characters. Very useful for use with filenames.
3
1058
posted 17 years ago by andyhartleeds
This shows how to use a module that normally needs a 'qw' attachment to the use statement (hint: its the = sign). You can add others by using comma separated values.
0
932
posted 17 years ago by wolfie
give a class name to each link according to the page it redirects to.
give attribute id to the body of the template and make the attribute editable (Dreamweaver lets you do that: select the attrib, Modify>Templates>Make attribute editable and tick t...
1
1304
posted 17 years ago by valcartei
This takes about an hour in total to run on my machine, so give yourself enough time. Obviously the configure options will need to be tweaked to match your set up, but this works for me. This assumes you already have MySQL installed.
0
911
posted 17 years ago by micmath
Use this to upload and resize your images using RMagick. Code by nixnewbie.
2
1127
posted 17 years ago by Tricon
a function that returns the absolute position in DOM tree. jQuery based
1
907
posted 17 years ago by fael
This temperature measurement script is one that comes from the original NPDS package. As formatted, it is meant to be used as an NPDS SSI tag. It obtains the current battery temperature and returns it in degrees Celsius.
0
982
posted 17 years ago by splorp