Latest Code Snippets

Popular / Snippets

TonyCox created a Page  -  May 11, 2021

I have JSON from my server which -

Hawkee created a Page  -  Dec 10, 2014
1 778 

I saw WOW.js on Product Hunt today and thought, "neat, that looks like fun." I'd also had the thought to play around with the Hacker News FireBase API so why not merge the two?

Hawkee created a Page  -  Oct 20, 2014
2 308 

One of our more advanced features here at Hawkee is our markdown page editor. What sets it apart is fluid integration with CodeMirror to quickly and easily add code to a page. There's no fumbling with tabs and no need to paste between fences. This article gives a general overview of how it works.

Hawkee created a Page  -  Oct 03, 2014

This will show you how to handle form errors with Node.js and AngularJS when server-side validation is necessary. It highlights the erroneous field and displays an error message below indicating the problem. This example uses Node.js, Express, Express Validator, AngularJS and Bootstrap 3.

 Respond   HTML5   Javascript  
PennyBreed created a Page  -  Apr 07, 2014
1 374 

While (again) working on my node.js irc client, I needed to sort the array of nicks, prefixed with their respective modes, so I could list them correctly in my nickname list. This likely doesn't encompass all available modes, but more could easily be added. Hope someone else finds it useful.

PennyBreed created a Page  -  Mar 12, 2014

Currently, I'm writing an irc client for myself in node.js, as sort of a proving ground to learning the ins and outs of it. I came to a point where I needed to parse the control codes into HTML, and here's what I came up with.

pimteam created a Page  -  Mar 13, 2013
1 235 

A class to convert km/h to mph and knots and vice-versa. It can also parse speeds in a text and return the text with corrected and converted speeds. See the live demo at for better idea what can it do.

FordLawnmower created a Page  -  Feb 23, 2013

This is a mIRC mode for use with {} CodeMirror Adds syntax highlighting for mSL code. Screenshot:

FordLawnmower created a Page  -  Feb 23, 2013
1 264 

This is a tcl mode for use with {} CodeMirror Adds syntax highlighting for tcl code. This code is an edit Velocity mode by Steve O'Hara Screenshot:

pimteam created a Page  -  Nov 27, 2012
4 144 

This is a javascript class that converts the HTML 5 Canvas element into interactive drawing board with tools etc. The code below contains the full class, but I recommend downloading the zip from because it contains CSS, images and samples. The code is Apache licensed so you can use it on your sites without any issues.

SReject created a Page  -  Nov 12, 2012
1 170 

After looking through coffeescript's code base, I found a method to build objects from other objects. With a bit of tinkering with the methodology of it, I finally got something that not only works as intented but it QUITE transparent in use.

pimteam created a Page  -  Oct 08, 2012

This is rather simple stuff yet I see it so rarely used. In any dating sites, health calculators, DIY stuff calculators etc they ask you to enter weight and height of something (or your own weight and height) only in their preferred measurement system (metric or Imperial). Boring! This simple javascript will convert the units and instantly fill the appropriate fields in the form.

Maximus1983 created a Page  -  Jun 27, 2012

You will need to get an account ( at GrabzIt once you have this you need to add your authorized domain ( this stops people using your account resources.

sean created a Page  -  May 29, 2012
1 149 

APGAR is the one-way hashing algorithm all legacy Command and Conquer games use to send and store user passwords. This snippet is a simple port of the PHP version submitted some time ago.

SReject created a Page  -  May 05, 2012
1 232 

A small framework to make html creation a little easier. It uses 'member-stringing' so you can make consecutive member calls on a cEle object

sean created a Page  -  May 03, 2012
1 197 

Thought it would be a neat exercise to recreate the mIRC $gettok() function in javascript as I've seen it popup in several other languages. The only caveat I'm aware of is when passing multiple N parameters (eg: '2-6' or '2-'); it must be in string format. Otherwise javascript will interpret N and pass undesired results (eg: '-4'). If only passing one N parameter, integer use is recommended.

[Plornt] created a Page  -  Mar 25, 2011

I coded this as a small learning exercise for myself, not attempting to make any shortening to the code since Im still fairly new to javascript. I know alot of places I could of optimised (Especially the stupid array method I used to create ball objects - imo should of just made a class or somthing liek it if javascript has that?)

Kerrie created a Page  -  Jan 26, 2011

Simple little code, prevents guests from copying and pasting.

sunslayer created a Page  -  Dec 16, 2010
1 549 

basic JQuery tooltip plugin example:

wade2462 created a Page  -  Apr 04, 2010

This is a simple little image viewer i wrote for javascript enabled browsers. I prefer to do everything out of my browser so I wrote this up. I figure, I could share it with you. It actually works :). It can take built in pics from an array or a custom url. Hope you have fun with it!

Korvin created a Page  -  Mar 11, 2010

A much nicer version of my dropdown script, styled version can be seen at for a limited period of time as it is an assignment. minimum css:

Korvin created a Page  -  Mar 07, 2010
Korvin created a Page  -  Mar 07, 2010

Generates insults, html is as follows:

Korvin created a Page  -  Mar 05, 2010

A much nicer version of my dropdown script, styled version can be seen at for a limited period of time as it is an assignment. minimum css:

Korvin created a Page  -  Feb 26, 2010
Weasel created a Page  -  Dec 27, 2009

First of all. This is JAVASCRIPT, this will not work on Wordpress! So, users can input search parameters (EG. Script Codes) then it would redirect the current page to google then search the inputed text.

vaseline28 created a Page  -  Nov 11, 2009
1 862 
vaseline28 created a Page  -  Nov 11, 2009
1 872 

Just a simple script which uses maths to detect whether or not a year is a leap year or not. If the year inputted is then "true" will be returned, if not "false".

Weasel created a Page  -  Nov 05, 2009

put this where you put html replace 'background' with the background color of your site, replace 'link' with the link you want it to go to, replace 'cmts' with the color you want the text to be when you mouse over, and replace 'text' with some words ;) example:

Weasel created a Page  -  Oct 02, 2009

Weasel's first javascript! on your website it pops up an alert with a response depending on the time! put it where you'd put html/javascript!

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.