Take a look at the source on GitHub, or download to dive right in.
(32.4 KB, with comments)
(11.8 KB, minified)