Skip to content

Instantly share code, notes, and snippets.

View lancejpollard's full-sized avatar
🐢
Code

Lance Pollard lancejpollard

🐢
Code
View GitHub Profile
@lancejpollard
lancejpollard / LICENSE.txt
Created November 20, 2012 12:34 — forked from furf/LICENSE.txt
Return the ordinal suffix for a number.
Copyright (c) 2011 Dave Furfero, http://furf.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@lancejpollard
lancejpollard / LICENSE.txt
Created November 20, 2012 12:33 — forked from ste-lam/LICENSE.txt
base64 encoder w/padding
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
@lancejpollard
lancejpollard / LICENSE.txt
Created November 20, 2012 12:31 — forked from sindresorhus/LICENSE.txt
Photo Booth (140byt.es)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com>
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
@lancejpollard
lancejpollard / ember-precompile.js
Created November 20, 2012 09:05 — forked from cesine/ember-precompile.js
Precompile .handlebars templates with node js
var fs = require('fs');
var path = require('path');
var vm = require('vm');
var argv = require('optimist').argv;
function compileHandlebarsTemplate(file, onComplete) {
//dummy jQuery
var jQuery = function () { return jQuery }
jQuery.ready = function () { return jQuery }
jQuery.inArray = function () { return jQuery }
@lancejpollard
lancejpollard / README.mkd
Created November 15, 2012 12:07 — forked from christophermanning/README.mkd
Cubic Hamiltonian Graphs
<style type="text/css">p {text-align:center;width: auto}</style>

Created by Christopher Manning

Gallery

Axle Eight [Fibbobaci](http://bl.ocks.org/d/1703449/#/[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169]32/0/1) Florets [![Star](https://raw.github.co

@lancejpollard
lancejpollard / fb_chat_sniffer.js
Created October 30, 2012 10:32 — forked from jchaney/fb_chat_sniffer.js
Facebook Chat Sniffer using Node.JS + node_pcap
var pcap = require('pcap'), // npm install pcap
tcp_tracker = new pcap.TCP_tracker(),
pcap_session = pcap.createSession('en1'); // Change to your interface
pcap_session.on('packet', function (raw_packet) {
var packet = pcap.decode.packet(raw_packet);
tcp_tracker.track_packet(packet);
});
tcp_tracker.on('http response body', function(session, http, data) {
@lancejpollard
lancejpollard / index.js
Created October 30, 2012 05:11 — forked from max-mapper/index.js
twitter bot for @sandyaid retweets
var crypto = require('crypto')
var request = require('request')
var url = require('url')
var irc = require('./IRC/lib/irc')
var ntwitter = require('ntwitter')
var twitter = require('twitter')
var qs = require('querystring')
// separate accounts to post and search because twitter was sending me 500s
// when I tried to use the same oauth creds for both twitter() and ntwitter()
@lancejpollard
lancejpollard / xlsxParser.js
Created September 30, 2012 21:38 — forked from trevordixon/xlsxParser.js
Parse an Excel xlsx file with javascript, jquery, and zip.js
/*
Relies on jQuery, underscore.js, Async.js (https://github.com/caolan/async), and zip.js (http://gildas-lormeau.github.com/zip.js).
Tested only in Chrome on OS X.
Call xlsxParser.parse(file) where file is an instance of File. For example (untested):
document.ondrop = function(e) {
var file = e.dataTransfer.files[0];
excelParser.parse(file).then(function(data) {
console.log(data);
@lancejpollard
lancejpollard / OS Check
Created September 28, 2012 01:32 — forked from thehydroimpulse/OS Check
OS Check
ifneq (,$(findstring /cygdrive/,$(PATH)))
UNAME := Cygwin
else
ifneq (,$(findstring WINDOWS,$(PATH)))
UNAME := Windows
else
UNAME := $(shell uname -s)
endif
endif
@lancejpollard
lancejpollard / lex.js
Created September 22, 2012 03:09 — forked from tj/lex.js
/**
* Scan the given `str` returning tokens.
*
* @param {String} str
* @return {Array}
* @api public
*/
module.exports = function(str) {
var indents = [0]