Skip to content

Instantly share code, notes, and snippets.

View jordanorelli's full-sized avatar
👾

Jordan Orelli jordanorelli

👾
View GitHub Profile
mikef1996: tell me something did you beleave me about what i told you ?
scraps: what do you mean?
mikef1996: when those two people killed you
scraps: eh? I definitely killed one of them, I was pretty sure I had killed both of them.
scraps: I was looting one of their bodies when I died.
mikef1996: you said in rust chat that all three of us were tricking you
scraps: eh, I still haven't figured out if you were in on it.
mikef1996: i was they wonted to show me what it was like
scraps: hahahaha i figured as much.
scraps: you said you didn't pick anything up, then gave me back my shotgun
package main
import (
"flag"
"fmt"
)
var options struct {
s string
i int
@atamurad
atamurad / gist:1282243
Created October 12, 2011 19:23
Recurly.js signature implementation in Python
import hashlib
import hmac
def digest_data(data):
if type(data) == list:
return "[%s]" % (",".join([digest_data(v) for v in data if v]))
elif type(data) == dict:
kvs = sorted(data.items(), lambda x,y: cmp(x[0],y[0]))
def prefix(key):
return "" if type(key) == int else "%s:" % key
@jordanorelli
jordanorelli / sight.pde
Created June 10, 2012 20:37
ChucK -> Processing communication demo
import oscP5.*;
import netP5.*;
PGraphics pg;
OscP5 oscP5;
NetAddress inbound;
float minFreq = 140;
float maxFreq = 1600;
float[] notes;
@jordanorelli
jordanorelli / heterogenous.go
Created June 19, 2012 17:17
sorting heterogenous slices in go
package main
import (
"fmt"
"sort"
)
type CommonCollection []Convertible
func (c CommonCollection) Len() int { return len(c) }
@jordanorelli
jordanorelli / stringcache.go
Created October 9, 2012 23:11
a simple string cache
type idCache struct {
sync.RWMutex
data map[string]*string
maxSize int
newest *string
oldest *string
}
func newIdCache(size int) *idCache {
return &idCache{
@jordanorelli
jordanorelli / grayskull_menu.md
Created November 15, 2012 16:26
cafe grayskull menu

Manhattan

  • 2 oz Rye

  • 1 oz sweet Vermouth

  • 3 dashes Angostura bitters

    Stir, served Up in a coupe glass

Martini

  • 2 oz Gin
@jordanorelli
jordanorelli / life.ck
Created February 9, 2013 22:57
conway's game of life for the monome, written in chuck
24787 => int monomeIn;
17102 => int monomeOut;
"/example" => string monomePrefix;
"127.0.0.1" => string monomeHost;
OscRecv recv;
monomeIn => recv.port;
recv.listen();
fun float[][] toneGrid(int width, int height, int columnStep, int rowStep, float baseFreq, float octaveSteps) {
@jordanorelli
jordanorelli / shapes.pde
Created March 10, 2013 20:57
3d animated gif with processing
import gifAnimation.*;
GifMaker gifExport;
int frames = 0;
int totalFrames = 180;
void setup() {
smooth();
size(900, 300, P3D);
ortho();
import themidibus.*;
MidiBus myBus;
int y = 0;
int vel = 0;
void setup() {
size(1024, 768);
background(0);
myBus = new MidiBus(this, 0, -1);