I hereby claim:
- I am atomizer on github.
- I am atomizer (https://keybase.io/atomizer) on keybase.
- I have a public key whose fingerprint is 4AB4 3BCC 242E 7D1A 2EE5 145A 8C03 EC0C 1005 5AB1
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
My accounts:
// this goes in the main file | |
// (assumes that all the modules that use this function are in the same directory or below) | |
// the Error.stack trick suggested by isaacbw on #Node.js on freenode | |
global.log = function() { | |
var line = new Error().stack.match(/at .+\n/g)[1] | |
var filename = line.match(/\((.+?\.js:\d+)/)[1].replace(__dirname, '').slice(1) | |
var args = [].slice.call(arguments) | |
args.unshift('[%s]', filename) | |
console.log.apply(this, args) |
#!/usr/bin/python | |
import re, os, sys | |
import tempfile | |
import shutil | |
import argparse | |
from subprocess import * | |
from urllib2 import urlopen, HTTPError | |
# for parsing swfdump output |
function enc(s) { | |
if (!s) throw new Error('need hostname') | |
if (s.slice(-1) != '.') s += '.' | |
var r = Buffer(s.length + 1) | |
s = s.split('.') | |
var cc = 0 | |
for (var i = 0; i < s.length; i++) { | |
r.writeUInt8(s[i].length, cc) | |
cc++ | |
r.write(s[i], cc) |
import sys, re | |
try: | |
from lxml import etree | |
except ImportError: | |
try: | |
import xml.etree.cElementTree as etree | |
except ImportError: | |
try: | |
import xml.etree.ElementTree as etree |
function bezier(pts) { | |
return function (t) { | |
for (var a = pts; a.length > 1; a = b) // do..while loop in disguise | |
for (var i = 0, b = [], j; i < a.length - 1; i++) // cycle over control points | |
for (b[i] = [], j = 0; j < a[i].length; j++) // cycle over dimensions | |
b[i][j] = a[i][j] * (1 - t) + a[i+1][j] * t; // interpolation | |
return a[0]; | |
} | |
} |