Skip to content

Instantly share code, notes, and snippets.

View jdeerhake's full-sized avatar

John Deerhake jdeerhake

View GitHub Profile
@jdeerhake
jdeerhake / node-lint.js
Created November 10, 2010 05:46
NodeJS wrapper for JSLint (http://www.jslint.com/fulljslint.js) that takes multiple files.
#!/usr/bin/env node
// node-lint.js
// 2010-11-09
/*
2010, John Deerhake, jdeerhake.com
*/
// Node.js wrapper for JSLint
// This is the Node companion to fulljslint.js (http://www.jslint.com/fulljslint.js).
@jdeerhake
jdeerhake / jquery_radio_change.js
Created August 13, 2011 00:39
Radio button change event
(function() {
jQuery("input[type=radio]").bind("change", function(ev) {
var that = jQuery(this);
jQuery("[name=" + that.attr("name") + "]").trigger("radioChange");
});
}());
//Subscribe to radioChange event, and it will get fired every time anything in its group changes
@jdeerhake
jdeerhake / Sources
Created December 1, 2011 23:46
Let it snow
jQuerify:
http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet
jQuery Snowfall:
http://www.somethinghitme.com/2011/10/05/jquery-snowfall-1-5-update-now-with-snow-buildup/
ANT.reset() requested
sent: ['a4', '01', '4a', '00', 'ef']
received: ['a4', '01', '6f', '20', 'ea']
ANT.reset() done
ANT.send_network_key() 0 [0, 0, 0, 0, 0, 0, 0, 0]
sent: ['a4', '09', '46', '00', '00', '00', '00', '00', '00', '00', '00', '00', 'eb']
received: ['a4', '03', '40', '00', '46', '00', 'a1']
ANT.assign_channel() 0
sent: ['a4', '03', '42', '00', '00', '00', 'e5']
received: ['a4', '03', '40', '00', '42', '00', 'a5']
@jdeerhake
jdeerhake / gist:2548130
Created April 29, 2012 08:55
BOINC Einstein@Home errors
Sun 29 Apr 2012 01:44:43 AM PDT | | NVIDIA GPU 0: GeForce GT 430 (driver version unknown, CUDA version 4.20, compute capability 2.1, 1024MB, 529MB available, 269 GFLOPS peak)
Sun 29 Apr 2012 01:44:43 AM PDT | | OpenCL: NVIDIA GPU 0: GeForce GT 430 (driver version 295.40, device version OpenCL 1.1 CUDA, 1024MB, 529MB available)
Sun 29 Apr 2012 01:49:15 AM PDT | Einstein@Home | [error] File p2030.20110226.G57.54-00.01.C.b4s0g0.00000_992.bin4 has wrong size: expected 2098320, got 2099360
Sun 29 Apr 2012 01:49:15 AM PDT | Einstein@Home | [error] Checksum or signature error for p2030.20110226.G57.54-00.01.C.b4s0g0.00000_992.bin4
#!upstart
description "libfitbit client"
author "John Deerhake"
version "0.0.1"
env LIBFITBIT_DIR="/etc/libfitbit"
env PYTHON="/usr/bin/python"
env LOG_FILE="/var/log/libfitbit_client.log"
env PID_FILE="/var/run/libfitbit_client.pid"
@jdeerhake
jdeerhake / README.md
Created May 24, 2012 22:23
jQuery simpleModal plugin

jQuery simpleModal

v0.0.1

A small (~ 100 LoC) jQuery plugin for creating a basic modal. It is shown and hidden using custom jQuery events show and hide and it is autmatically centered (note the starter CSS for this work correctly).

Usage

Example usage:

@jdeerhake
jdeerhake / sure_payroll.js
Created January 28, 2013 21:36
Download all surepayroll paystubs
var JSZip=function(e,t){this.files={};this.root="";if(e){this.load(e,t)}};JSZip.signature={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK\b"};JSZip.defaults={base64:false,binary:false,dir:false,date:null};JSZip.prototype=function(){var e=function(e,t,n){this.name=e;this.data=t;this.options=n};e.prototype={asText:function(){var e=this.data;if(this.options.base64){e=JSZipBase64.decode(e)}if(this.options.binary){e=JSZip.prototype.utf8decode(e)}return e},asBinary:function(){var e=this.data;if(this.options.base64){e=JSZipBase64.decode(e)}if(!this.options.binary){e=JSZip.prototype.utf8encode(e)}return e},asUint8Array:function(){return JSZip.utils.string2Uint8Array(this.asBinary())},asArrayBuffer:function(){return JSZip.utils.string2Uint8Array(this.asBinary()).buffer}};var t=function(e,t){var n="",r;for(r=0;r<t;r++){n+=String.fromCharCode(e&255);e=e>>>8}return n};var n=function(){var e={},
gem, call, qty, title
ruby, au, 120, Hey John did you know
emerald, si, 30, a cat was arrested in Russia for
amethyst, gg, 90, smuggling and hugging phones into prison, he was caught when
sapphire, ts, 50, guards noticed a package awkwardly strapped to his back
garnet, ts, 50, guards noticed a package awkwardly strapped to his back
sapphire, ts, 50, guards noticed a package awkwardly strapped to his back