Skip to content

Instantly share code, notes, and snippets.

View jordanorelli's full-sized avatar
🎴

Jordan Orelli jordanorelli

🎴
View GitHub Profile
@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 / .vimrc
Created October 11, 2012 21:50
vimrc
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
set backspace=indent,eol,start
set autoindent
set smartindent
set tabstop=4
set expandtab " holy war
set smarttab " I don't know what this does.
@jordanorelli
jordanorelli / input.lisp
Created October 14, 2012 03:15
a lisp lexer in Go
(+ 1 (+ 1 1) (dave (sam 1)))
; alright I have comments now!!!!
; woooohooo!!!!
; nice nice nice
(+ 1
22.3
a
;here comes a comment
func readTemplateFile(abspath string) (*template.Template, error) {
relpath, err := filepath.Rel(TemplateRoot, abspath)
if err != nil {
return nil, fmt.Errorf(`core: unable to resolve template file path %v`, abspath)
}
t := template.New(relpath).Funcs(template.FuncMap{
"jsonblob": func(v interface{}) (template.JS, error) {
b, err := json.Marshal(v)
if err != nil {
package main
import (
"fmt"
"runtime"
"time"
)
func main() {
// THIS is totally required; without it, you're blocking the CPU regardless
package main
import (
"log"
"fmt"
"os/exec"
"time"
)
type TimeoutError struct {
@jordanorelli
jordanorelli / computefield.go
Created October 26, 2012 15:45
compute a field in json output
package main
import (
"encoding/json"
"os"
)
type Point struct {
X int `json:"x"`
Y int `json:"y"`
@jordanorelli
jordanorelli / pulses.pde
Created October 29, 2012 03:04
some circles in processing.
Pulse[] pulses = new Pulse[48];
void setup() {
size(640, 480);
background(0);
smooth();
ellipseMode(CENTER);
noFill();
strokeWeight(20);
stroke(255,128);
type iStringer interface {
String(int) string
}
type tLibraryBase struct {
tBaseElement
elemCount int
elemName string
stringer func(int) iStringer
}
@jordanorelli
jordanorelli / listserve.md
Created November 13, 2012 17:42
todays listserve email

Hi! I hope that you're having a great day, I sure am! I got this "you won the listserve lottery" email on my birthday! OK, since I've got a big audience: I teach high school in a detention facility for teen-aged repeat offenders. One of the many things that we try to do for the kids is to give them some exposure to the different kinds of opportunities they might have as adults if they manage to hang in there and finish their education. Most of the students in our classrooms have had little exposure to the wider world beyond grinding poverty and limited adult support. That's where you come in (I hope).

I am using this platform to ask you to do something for my students. And maybe for students everywhere, who knows? I'd like you to make a video, maybe 3-5 minutes, about what you do for a living. If you can try to answer the following questions, that would be awesome: 1. What kind of work do you do (day to day duties and overall) 2. How did you come to do your job? 3. What kind of education or training does you