Below are the top ranked snippets.

ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

« Previous 1 2 3 4 5 6 7 8 9  ...  55 56 Next »
8
Date Submitted Thu. Mar. 8th, 2007 11:37 PM
Revision 1
Scripter Fordiman
Tags ajax | browser-independent | JavaScript | Library | XML
Comments 0 comments
libNog is a 9k library to provide somewhat easier browser-independence. It is not yet complete, and will be continuously revised. It grew from this snippet, and is still growing as I find things I use often.
Presently, libNog features:

A way to browser-independently get an XMLHttpRequest object.
A set of simple methods for GET, POST, HEAD, and to include other Scripts.
Simple methods for className control
A completely abstracted form of getElement*
Browser-independent methods for attaching and detaching event handlers
An event-normalization routine
A simple one-command 'Stop the Event' routine
And the big one: A simplified Class object by which classes can be built in JavaScript.

The above link will point you to the API documentation and history of libNog, as well as where to download the library.
6
Date Submitted Wed. Mar. 7th, 2007 3:48 PM
Revision 1
Beginner stalkerX
Tags DOM | Element | JavaScript
Comments 0 comments
Return object by type. Revision 2.
5
Date Submitted Tue. Mar. 6th, 2007 8:26 PM
Revision 1
Beginner overPlumbum
Tags age | Date
Comments 1 comments
Optimized way to calculate age from timestamp,
the idea is not to use date() call at all if possible.
8
Date Submitted Tue. Mar. 6th, 2007 7:26 PM
Revision 1
Helper albud
Tags JavaScript | String
Comments 1 comments
I like to have these two methods in my toolbelt, even though it's syntactic sugar, I think it aids clarity.
13
Date Submitted Tue. Mar. 6th, 2007 2:36 PM
Revision 1
Beginner wlasson
Tags "image resize" | GD | images | PHP | Resize
Comments 1 comments
This is a simple function that resizes and image using the GD add on for PHP.
Just a disclaimer: I know its not perfect, but i figured i would post it because the only other one on here is way confusing to some new PHP developers. Hopefully this one will help you learn how to use GD, and then you can write a better one.
7
Date Submitted Sat. Mar. 3rd, 2007 5:55 AM
Revision 1
Scripter shachi
Tags foreach | JavaScript
Comments 4 comments
Just a small snippet I discovered when I was tired writing somearrayname\[i\] I thought there was something like foreach in javascript but couldn't find any so why not make one?
For those foreach(){...} lovers.

Hope it makes your life easier.
12
Date Submitted Thu. Mar. 1st, 2007 4:01 PM
Revision 1
Helper mjlintz
Tags PHP
Comments 3 comments
With this function you can calculate the age of a person

Example:
echo "Age is: " . age("1984-07-05");

Result will be (23 Feb 2005) = "Age is: 20"
7
Date Submitted Thu. Mar. 1st, 2007 3:53 PM
Revision 1
Helper mjlintz
Tags PHP
Comments 0 comments
Generate multi select box from data in db, then when submitted, each selection is written to a db table as it's own record, each tied together by a common record id.
14
Date Submitted Thu. Mar. 1st, 2007 3:48 PM
Revision 1
Helper mjlintz
Tags PHP
Comments 5 comments
Display contents of a folder, see comments in code.
6
Date Submitted Thu. Mar. 1st, 2007 3:45 PM
Revision 1
Helper mjlintz
Tags PHP
Comments 1 comments
Pull items from a mysql db table and display in the following format-
item1, item2, item3

In the example code, the query will return all items that have the color "red" specified in the db.
« Previous 1 2 3 4 5 6 7 8 9  ...  55 56 Next »