Skip to content

Instantly share code, notes, and snippets.

View jordanorelli's full-sized avatar
👾

Jordan Orelli jordanorelli

👾
View GitHub Profile
@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
@jordanorelli
jordanorelli / print_midi.ck
Created September 14, 2013 17:12
midi printing util
// number of the device to open (see: chuck --probe)
0 => int device;
// the midi event
MidiIn min;
// the message for retrieving data
MidiMsg msg;
// open the device
if(!min.open(device)) {
@jordanorelli
jordanorelli / rpn.go
Last active December 20, 2015 16:59
stack-based rpn accumulator
package main
import (
"bufio"
"errors"
"fmt"
"os"
"strconv"
"strings"
)
@jordanorelli
jordanorelli / main.pde
Created July 15, 2013 03:32
quadratic koch island in Processing, as in The Algorithmic Beauty of Plants.
void setup() {
size(500, 500);
smooth();
background(255);
stroke(0);
strokeWeight(1);
HashMap productions = new HashMap();
productions.put('F', "F-F+F+FF-F-F+F");
String axiom = "F-F-F-F";
import themidibus.*;
MidiBus myBus;
int y = 0;
int vel = 0;
void setup() {
size(1024, 768);
background(0);
myBus = new MidiBus(this, 0, -1);
import gifAnimation.*;
GifMaker gifExport;
int loopFrames = 60;
PVector maskOrigin;
Float maskWidth = 250.0;
float orbitWidth = 100.0;
void setup() {
gifExport = new GifMaker(this, "export.gif", 30);
@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();
@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 / 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 / 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{