Skip to content

Instantly share code, notes, and snippets.

@twolfson
twolfson / LICENSE.txt
Created November 2, 2011 04:14 — forked from OiNutter/LICENSE.txt
Credit Card Validation similar to the Luhn Algorithm
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Will McKenzie<www.oinutter.co.uk>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@twolfson
twolfson / about.md
Created December 31, 2011 06:25 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@twolfson
twolfson / app.js
Created April 27, 2012 08:49 — forked from pdeschen/static-server.js
Quick and dirty file server
// Attribution to http://blog.rassemblr.com/2011/04/a-working-static-file-server-using-node-js/
var libpath = require('path'),
http = require("http"),
fs = require('fs'),
url = require("url")/* ,
mime = require('mime') */;
var path = ".";
var port = 8080;
@twolfson
twolfson / dabblet.css
Created May 12, 2012 06:32
Understanding vertical-align for once and for all
/* Understanding vertical-align for once and for all */
* {
margin: 0;
padding: 0;
}
body {
background: white;
}
@twolfson
twolfson / LICENSE.txt
Created May 12, 2012 19:16 — forked from 140bytes/LICENSE.txt
Atomic event emitter for solving your race conditions
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@twolfson
twolfson / bookmarklet.js
Created August 8, 2012 05:41
gist to dabblet bookmarklet
javascript:l=location+'',z=l.lastIndexOf('/');location='http://dabblet.com/gist'+l.slice(z);void(0);
@twolfson
twolfson / LICENSE.txt
Created September 13, 2012 15:03 — forked from azproduction/LICENSE.txt
Ugly forEach polyfill for primitives
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@twolfson
twolfson / grunt.js
Created September 16, 2012 05:29
Grunt mustache re-implementation
// At this time, grunt-mustache was giving me shit so I rewrote it for what I needed...
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
mustache: {
template: {
src: 'template.svg.mustache',
dest: 'template.svg',
partials: 'partials/*.mustache'
@twolfson
twolfson / pre-commit
Created September 16, 2012 22:30
package.json version pre-commit incrementer
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
node -e "var f = './package.json', p = require(f), v = p.version || '0.0.0', a = v.split('.'), b; a[2] = +a[2] + 1; p.version = a.join('.'); require('fs').writeFileSync(f, JSON.stringify(p, null, 2));"
@twolfson
twolfson / index.js
Created September 23, 2012 04:00
Better File-Watcher
(function () {
var watcher = new FileWatcher(),
resources = ResourceCollector.collect();
watcher.addListener(function (url) {
// If the updated item is CSS
if (url.indexOf('css') !== -1) {
// Grab all of the links
[].slice.call(document.querySelectorAll('link')).forEach(function (link) {
// If the link's href matches, update it
var href = link.href;