Skip to content

Instantly share code, notes, and snippets.

View apg's full-sized avatar
🐢
Turtle

Andrew Gwozdziewycz apg

🐢
Turtle
View GitHub Profile

Streaming Systems:

Streaming More Generally:

@apg
apg / core.go
Created November 6, 2015 16:43
package main
import (
"fmt"
"sync"
)
type Event map[string]interface{}
type asyncStreamFunc func(done <-chan struct{}, in <-chan Event, out chan<- Event)
package main
type Plugin struct {
Match(Msg) bool // continue the Reporter Chain.
Run()
Shutdown()
}
type LoggingConfig struct {
ReporterPlugins []Plugin
@apg
apg / gist:efe6833eb74ac264b68b
Created October 17, 2015 17:34 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@apg
apg / output.run
Last active September 19, 2015 18:03
[apg@amend soa]$ go test -bench=.
testing: warning: no tests to run
PASS
BenchmarkAOS10 20000000 77.2 ns/op
Benchmark1AOS10 20000000 78.1 ns/op
BenchmarkSOA10 20000000 65.2 ns/op
BenchmarkAOS100 2000000 748 ns/op
Benchmark1AOS100 2000000 749 ns/op
BenchmarkSOA100 2000000 649 ns/op
BenchmarkAOS1000 200000 6864 ns/op
@apg
apg / scanabanana.rkt
Created August 29, 2015 00:25
banana scanimation, assuming you have the banana files.
#lang racket/base
(require racket/draw
racket/gui)
(define files (for/list [(i (in-range 7))]
(format "/tmp/banana/banana~a.png" i)))
(define bitmaps (map (lambda (x) (read-bitmap x)) files))
(define dcs (map (lambda (x) (new bitmap-dc% [bitmap x])) bitmaps))
@apg
apg / gist:9fa689a97de91c658aca
Created August 26, 2015 00:44
transcript of a repl session to build a scanabanana
Welcome to Racket v6.1.
racket@> (require racket/draw)
racket@> (define files (for/list
[(i (in-range 7))]
(format "/tmp/banana/banana~a.png" i)))
racket@> files
'("/tmp/banana/banana0.png"
"/tmp/banana/banana1.png"
"/tmp/banana/banana2.png"
"/tmp/banana/banana3.png"
@apg
apg / output
Last active August 29, 2015 14:26
$ go run score.go
Test: [1 2 3]
score=0
Test: [2 1 3]
score=1
Test: [3 2 1]
score=2
Test: [1 2 4 3 5]
score=1
Test: [1 2 4 3 5 6 8 9 7]
@apg
apg / star.md
Last active August 29, 2015 14:25

rendered star

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?