Skip to content

Instantly share code, notes, and snippets.

View jordanorelli's full-sized avatar
👾

Jordan Orelli jordanorelli

👾
View GitHub Profile
@jordanorelli
jordanorelli / id.go
Created June 23, 2012 18:32
fast unique id generation in Go
package main
import (
"crypto/md5"
"encoding/binary"
"fmt"
"os"
"sync/atomic"
"time"
)
# sleepy flower girl
(◡ ‿ ◡ ✿)
# y u no
ლ(ಠ益ಠლ)
# smiling breasts
(^人^)
# flipping tables
@jordanorelli
jordanorelli / templates.go
Created August 9, 2012 21:42
primitive template cache in Go with os.Stat
package core
import (
"bytes"
"fmt"
"html/template"
"io/ioutil"
"net/http"
"os"
"path/filepath"
@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 / queue.go
Created September 7, 2012 17:53
an absurd queue implementation with higher-order channels
package main
import (
"fmt"
"math/rand"
"time"
)
type Queue struct {
data []interface{}
@jordanorelli
jordanorelli / README.md
Last active April 3, 2021 15:31
Dot product

not sure what this is, I think I was trying to figure out what a dot product is

This file has been truncated, but you can view the full file.
Symbols:
0 CBodyComponentBaseAnimating
1 CEntityIdentity
2 CPhysicsComponent
3 CRenderComponent
4 CBaseAnimating
5 CAnimationLayer
6 CBodyComponentBaseAnimatingOverlay
7 CBaseAnimatingOverlay
8 CEconItemAttribute
global tempo
set tempo to 120
--establish quarter note delay time
global q
set q to 60 / tempo
--establish eighth note delay time
global e
set e to q / 2
@jordanorelli
jordanorelli / ydiff
Last active July 22, 2019 13:05
diff yaml trees semantically
#!/usr/bin/env ruby
# diffs the contents of yaml files semantically. that is, ydiff will parse each
# yaml file and then diff their resulting trees, instead of attempting to diff
# the text. it's specifically for comparing directories of translations from
# Crowdin, so it's effectively only concerned with strings.
require 'pathname'
require 'rubygems'
require 'yaml'
float rectSize = 30;
int numRects = 40;
float outerRadius = 120;
int aframes = 140;
boolean SAVE_FRAMES = true;
void setup() {
size(500, 500);
}