Skip to content

Instantly share code, notes, and snippets.

View jed's full-sized avatar

Jed Schmidt jed

View GitHub Profile
@jed
jed / adler32.js
Created July 21, 2012 05:03
non-obfuscated adler32
function adler32(string) {
var length = string.length
, modulus = 65521
, index = 0
, a = 1
, b = 0
while (index < length) {
a += string.charCodeAt(index++)
a %= modulus
@jed
jed / .gitignore
Created July 3, 2012 09:52
browserify-alias-test
node_modules
lib.js
@jed
jed / balcony.txt
Created June 8, 2012 15:11
project balcony
layout
======
XX: whole tile
xx: cut tile (20cm)
2cm deep gutter
---------------------------------+
xx xx xx xx xx xx xx xx xx xx xx |
[] XX XX XX [] XX XX XX XX [] XX |
@jed
jed / request.js
Created April 23, 2012 03:25
prototype plugin pattern idea to make middleware less magical
function Request(req, res) {
this.upstream = request
this.downstream = response
}
Request.prototype = {
start: function() {
// kick off the default chain of handlers
},
@jed
jed / lyrics.txt
Created April 15, 2012 06:57
baumkuchen by ohashi trio
回り出す木馬に おどけたふりして
小さな靴を鳴らして はしゃぐ君を見てた
何気なく開けてみる 大きな扉は
古ぼけた僕の大事な おもちゃ箱みたいさ
odoridasu mokuba ni odoketa furishite
chiisana kutsu o narashite hashagu kimi o miteta
nanigenaku aketemiru ookina tobira wa
furuboketa boku no daijina omochabako mitai sa
@jed
jed / results.txt
Created February 17, 2012 06:12
brew install redis
$ brew install redis
==> Downloading http://redis.googlecode.com/files/redis-2.4.7.tar.gz
File already downloaded in /Users/Jed/Library/Caches/Homebrew
==> make -C src
MAKE hiredis
CC ae.o
clang: warning: argument unused during compilation: '-rdynamic'
clang: warning: argument unused during compilation: '-ggdb'
/usr/bin/clang -c -Os -w -pipe -march=native -arch x86_64 -g -ggdb net.c
clang: warning: argument unused during compilation: '-ggdb'
@jed
jed / api.js
Created February 13, 2012 14:32
using uglify to turn javascript functions into DynamoDB query language
// just a quick brainstorm for my dynamo API: https://github.com/jed/dynamo
// is it worth it to use uglify-js to parse functions into ASTs, to be transformed into dynamo's non-standard query language?
// the good:
// - no need to learn new API, just use javascript to query
// - API ends up resembling well-known .map and .filter style
// - would be entirely optional, compiling into specifiable query objects
// the bad:
@jed
jed / recursiveIIFE.coffee
Created December 19, 2011 06:19
recursive IIFEs
upperCase = (str, cb) ->
do fn = (err, str) ->
if err
cb err
else if typeof str is 'function'
str fn # fn is this function, as of 1.2.1-pre
else
str = String str
@jed
jed / LICENSE.txt
Created November 28, 2011 15:47 — forked from 140bytes/LICENSE.txt
turn the `new` keyword into a function
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
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
@jed
jed / newOperator.js
Created November 28, 2011 13:14
an attempt to make the new operator dynamically invokeable
// usage: newOperator(constructor, [arg1, arg2, ...])
// example: newOperator(Date, [1995, 11, 24])
// => should be identical to new Date(1995, 11, 24)
function newOperator(constructor, args) {
var i = args.length + 1
, params = []
, fn
while (i--) params[i] = "$" + i