Skip to content

Instantly share code, notes, and snippets.

View jordanorelli's full-sized avatar
🎴

Jordan Orelli jordanorelli

🎴
View GitHub Profile
@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 / life.ck
Created February 12, 2013 06:28
conway's game of life, for the monome, written in chuck
110.0 => float rootFreq;
20 => float toneSteps;
10::ms => dur genStep;
24787 => int monomeIn;
17102 => int monomeOut;
"/example" => string monomePrefix;
"127.0.0.1" => string monomeHost;
fun float[][] toneGrid(int width, int height, int columnStep, int rowStep, float baseFreq, float octaveSteps) {
@jordanorelli
jordanorelli / gif_example.pde
Created February 20, 2013 02:38
make an animated gif with Processing
import gifAnimation.*;
GifMaker gifExport;
int frames = 0;
int totalFrames = 120;
public void setup() {
smooth();
size(400, 400);
@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 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);
jorelli@jorelli[0] /usr/local/go: tree bin
bin
|-- go
|-- godoc
`-- gofmt
0 directories, 3 files
jorelli@jorelli[0] /usr/local/go: ls src/github.com
ls: cannot access src/github.com: No such file or directory
jorelli@jorelli[0] /usr/local/go: go get github.com/jordanorelli/skeam
@jordanorelli
jordanorelli / bullshit.js
Created May 8, 2013 22:31
javascript APIs make me deeply sad
var picker_id = this.id + 'start-date';
this.start_date_picker = this.date_picker_container.append('input');
this.start_date_picker.attr('type', 'text');
this.start_date_picker.attr('id', picker_id);
this.start_date_picker = $('#'+picker_id).datepicker();
// this DOES NOT work:
this.start_date_picker.setDate(this.response.start_date);
// the method definition Less is any method on type T such that the signature of the method is `(T) bool`.
type Sortable interface {
Less(kin) bool
}
// MySortable *does* satisfy Sortable
type MySortable struct {
// ...
}
@jordanorelli
jordanorelli / constants.php
Created June 6, 2013 19:25
siiiggghhhhhhh
<?php
class Foo {
const a = 1;
const b = 4;
const c = 1 | 4;
}
echo "a: " . Foo::a . "\n";
echo "b: " . Foo::b . "\n";
(define ack
(lambda (m n)
(if (= m 0)
(+ n 1)
(if (and (> m 0) (= n 0))
(ack (- m 1) 1)
(if (and (> m 0) (> n 0))
(ack (- m 1) (ack m (- n 1))))))))