Meet the Snippets
Code snippets are pieces of code that can be re-usable. Well organized and structured they can become a handy library that helps you save time and running projects easier.
Example
Every time you build a new website you probably create the contact form. Why not create a snippet for this? You could save the source code for basic contact form in a separate file basic_contact_form.html, have it on one place and when you need it just go there and get it. This way you can spare yourself from hand-coding it every time. After coding the contact form, you probably need to perform a javascript form check for valid inputs. This javascript code could also be saved as a snippet and applied when needed without coding it over and over again.
Organizing snippets on your computer
You could create a folder on your computer and name it “Snippets”. Then create sub-folders inside it and name them “HTML”, “CSS”, “PHP”, “Javascript”. Now all you need to do is to sort you snippets by the programming or scripting language. Next time you need your basic contact form, just go Snippets/HTML, find the file you named basic_contact_form.html, open it with your favourite editor, copy the code and paste it where you need it.
If you want more comfortable way to organize your snippets, use Snippely by Google Code. Snippely is a small desktop application based on Adobe Air, which enables you to save, edit and organize your code snippets. Give it a try, it’ really useful and cute.
Google about Snippely (source http://code.google.com):
Snippely is a basic text and code organizational tool. Instead of storing bits of code, quick notes, and memos in text files all over your hard drive, this application will let you save and organize “snippets” in one convenient location. A snippet is a collection of one or more pieces of code and notes. Snippets are stored in groups for organization and quick retrieval.
Organizing your snippets online
If you do not have the time to code your own dynamic snippet library, just create account on Snipplr and have your snippets saved there. The good thing about using Snipplr is that there is already a lot of code snippets saved by other Snipplr users, so you can use those and share yours with others.
Snippets in text editors
Some text editors like Textmate, Textpad and Dreamweaver have built in modules or bundles for managing code snippets. They provide you with the basic funticons like adding, editing and sorting snippets. Some text editors also come in with pre-created snippets libraries, but it is the best practice to create your own that suit your needs.


Nice post man. I wrote a similar, shorter one on the same sort of subject but you provide some great resources. I like the Google one. I am a big fan of just cut and paste; using master snippet files for my css, php, etc. It’s good to modularize everything and you did well summing that up.
Comment by Mike — November 4, 2008 @ 11:24 pm
applyed is actually spelled as applied. I love your work, and your design . . .please, check your spelling. Mark
Comment by Mark Watrous — November 7, 2008 @ 12:46 pm
Thanks Mark :)
Comment by Mihael — November 7, 2008 @ 12:54 pm