Skip to content

Instantly share code, notes, and snippets.

atomizer

Block or report user

Report or block atomizer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

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:

View gist:9688885
@atomizer
atomizer / main.js
Created Sep 29, 2013
a console.log replacement that prints callee file name and line
View main.js
// 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)
@atomizer
atomizer / extract.py
Last active Jan 17, 2019
rotmg asset extractor
View extract.py
#!/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
View hostpack.js
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)
View enemyattacks.py
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
@atomizer
atomizer / bezier.js
Created Jun 27, 2011
de Casteljau's algorithm in javascript
View bezier.js
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];
}
}
You can’t perform that action at this time.