Skip to content

Instantly share code, notes, and snippets.

Mike Dewar mikedewar

Block or report user

Report or block mikedewar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikedewar
mikedewar / vimrc
Created Feb 11, 2016
my vimrc as of Feb 11 2016
View vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
syntax enable
colorscheme monokai
" indents
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
" backspace
View splitting.json
{"label":"splitting","blocks":[{"label":"","type":"get","id":2,"inputs":[{"name":"in","value":null,"type":"object"},{"name":"key","value":{"data":"a"},"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":901,"y":393}},{"label":"","type":"delay","id":1,"inputs":[{"name":"in","value":{"data":{"a":1,"b":2}},"type":"any"},{"name":"duration","value":{"data":"1s"},"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":692,"y":470}},{"label":"","type":"+","id":11,"inputs":[{"name":"x","value":null,"type":"number"},{"name":"y","value":{"data":1},"type":"number"}],"outputs":[{"name":"x+y","type":"number"}],"source":null,"position":{"x":1031,"y":392}},{"label":"","type":"get","id":3,"inputs":[{"name":"in","value":null,"type":"object"},{"name":"key","value":{"data":"b"},"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":1193,"y":578}},{"label":"","type":"merge","id":6,"inputs":[{"name":"in","value":null,"type":"objec
View pubsub.json
{"label":"pubsub","blocks":[{"label":"","type":"endpoint","id":8,"inputs":[{"name":"name","value":{"data":"bob"},"type":"string"}],"outputs":[{"name":"request","type":"object"},{"name":"writer","type":"writer"},{"name":"body","type":"string"}],"source":"server","position":{"x":543,"y":83}},{"label":"","type":"kvSet","id":9,"inputs":[{"name":"key","value":null,"type":"string"},{"name":"value","value":null,"type":"any"}],"outputs":[{"name":"new","type":"boolean"}],"source":"key_value","position":{"x":748,"y":153}},{"label":"","type":"kvDump","id":2,"inputs":[{"name":"dump","value":null,"type":"any"}],"outputs":[{"name":"object","type":"object"}],"source":"key_value","position":{"x":516,"y":465}},{"label":"","type":"sink","id":11,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[],"source":null,"position":{"x":916,"y":89}},{"label":"","type":"keys","id":3,"inputs":[{"name":"in","value":null,"type":"object"}],"outputs":[{"name":"keys","type":"array"}],"source":null,"position":{"x":654,"y":589}},{"labe
@mikedewar
mikedewar / control.json
Created Nov 13, 2015
control flow example
View control.json
{"label":"root","blocks":[{"label":"","type":"latch","id":2,"inputs":[{"name":"in","value":null,"type":"any"},{"name":"ctrl","value":null,"type":"boolean"}],"outputs":[{"name":"true","type":"any"},{"name":"false","type":"any"}],"source":null,"position":{"x":794,"y":227}},{"label":"","type":"gate","id":4,"inputs":[{"name":"in","value":null,"type":"any"},{"name":"ctrl","value":null,"type":"any"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":426,"y":228}},{"label":"ticker","type":"delay","id":1,"inputs":[{"name":"in","value":{"data":"boo"},"type":"any"},{"name":"duration","value":{"data":"1s"},"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":490,"y":371}},{"label":"","type":"+","id":14,"inputs":[{"name":"x","value":null,"type":"number"},{"name":"y","value":{"data":1},"type":"number"}],"outputs":[{"name":"x+y","type":"number"}],"source":null,"position":{"x":433,"y":106}},{"label":"","type":"identity","id":10,"inputs":[{"name":"in","value":{"data":0},
@mikedewar
mikedewar / blockingExample.json
Last active Nov 14, 2015
a simple blocking example
View blockingExample.json
{"label":"root","blocks":[{"label":"","type":"delay","id":13,"inputs":[{"name":"in","value":{"data":2},"type":"any"},{"name":"duration","value":{"data":"2s"},"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":226,"y":272}},{"label":"","type":"log","id":16,"inputs":[{"name":"log","value":null,"type":"any"}],"outputs":[],"source":null,"position":{"x":777,"y":190}},{"label":"","type":"delay","id":3,"inputs":[{"name":"in","value":{"data":1},"type":"any"},{"name":"duration","value":{"data":"1s"},"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":221,"y":159}},{"label":"","type":"set","id":22,"inputs":[{"name":"key","value":{"data":"top"},"type":"string"},{"name":"value","value":null,"type":"any"}],"outputs":[{"name":"object","type":"object"}],"source":null,"position":{"x":474,"y":146}},{"label":"","type":"set","id":23,"inputs":[{"name":"key","value":{"data":"bottom"},"type":"string"},{"name":"value","value":null,"type":"any"}],"outputs":[{"n
@mikedewar
mikedewar / PoissonProcess.json
Created Nov 11, 2015
a streamtools pattern describing a poisson process
View PoissonProcess.json
{"label":"root","blocks":[{"label":"","type":"exponential","id":1,"inputs":[{"name":"rate","value":{"data":1},"type":"number"}],"outputs":[{"name":"draw","type":"number"}],"source":null,"position":{"x":263,"y":345}},{"label":"","type":"delay","id":2,"inputs":[{"name":"in","value":{"data":1},"type":"any"},{"name":"duration","value":null,"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":578,"y":330}},{"label":"","type":"toString","id":4,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"out","type":"string"}],"source":null,"position":{"x":387,"y":345}},{"label":"","type":"concat","id":5,"inputs":[{"name":"a","value":null,"type":"string"},{"name":"b","value":{"data":"s"},"type":"string"}],"outputs":[{"name":"a+b","type":"string"}],"source":null,"position":{"x":486,"y":345}},{"label":"","type":"log","id":9,"inputs":[{"name":"log","value":null,"type":"any"}],"outputs":[],"source":null,"position":{"x":713,"y":330}}],"connections":[{"from":{"id":2,"route":0},
@mikedewar
mikedewar / counter.json
Created Nov 10, 2015
streamtools counter
View counter.json
{"label":"root","blocks":[{"label":"","type":"latch","id":1,"inputs":[{"name":"in","value":null,"type":"any"},{"name":"ctrl","value":null,"type":"boolean"}],"outputs":[{"name":"true","type":"any"},{"name":"false","type":"any"}],"source":null,"position":{"x":358,"y":348}},{"label":"","type":"first","id":2,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"first","type":"boolean"}],"source":null,"position":{"x":249,"y":417}},{"label":"","type":"identity","id":4,"inputs":[{"name":"in","value":{"data":0},"type":"any"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":147,"y":320}},{"label":"","type":"delay","id":10,"inputs":[{"name":"in","value":{"data":true},"type":"any"},{"name":"duration","value":{"data":"1s"},"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":367,"y":544}},{"label":"","type":"gate","id":11,"inputs":[{"name":"in","value":null,"type":"any"},{"name":"ctrl","value":null,"type":"any"}],"outputs":[{"name":"out","type":"an
@mikedewar
mikedewar / initialCondition.json
Created Nov 10, 2015
a streamtools pattern that emits an initial condition
View initialCondition.json
{"label":"root","blocks":[{"label":"","type":"latch","id":1,"inputs":[{"name":"in","value":null,"type":"any"},{"name":"ctrl","value":null,"type":"boolean"}],"outputs":[{"name":"true","type":"any"},{"name":"false","type":"any"}],"source":null,"position":{"x":366,"y":322}},{"label":"","type":"first","id":2,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"first","type":"boolean"}],"source":null,"position":{"x":253,"y":383}},{"label":"","type":"identity","id":4,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":180,"y":296}},{"label":"","type":"identity","id":7,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":509,"y":314}}],"connections":[{"from":{"id":2,"route":0},"to":{"id":1,"route":1},"id":3},{"from":{"id":4,"route":0},"to":{"id":1,"route":0},"id":5},{"from":{"id":4,"route":0},"to":{"id":2,"route":0},"id":6},{"from":{"id":1,"route":0},"to":{"id":7,
@mikedewar
mikedewar / Fibonacci.json
Created Nov 10, 2015
Fibonacci Sequence in streamtools
View Fibonacci.json
{"blocks":[{"label":"","type":"identity","id":1,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":295,"y":325}},{"label":"","type":"+","id":2,"inputs":[{"name":"x","value":null,"type":"number"},{"name":"y","value":{"data":1},"type":"number"}],"outputs":[{"name":"x+y","type":"number"}],"source":null,"position":{"x":293,"y":203}},{"label":"","type":"latch","id":3,"inputs":[{"name":"in","value":null,"type":"any"},{"name":"ctrl","value":null,"type":"boolean"}],"outputs":[{"name":"true","type":"any"},{"name":"false","type":"any"}],"source":null,"position":{"x":191,"y":133}},{"label":"","type":"first","id":4,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"first","type":"any"}],"source":null,"position":{"x":133,"y":231}},{"label":"","type":"identity","id":5,"inputs":[{"name":"in","value":{"data":0},"type":"any"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":62,"y":133}},{"label":"","type":"^","id":6
@mikedewar
mikedewar / ar2.json
Created Nov 10, 2015
AR(2) model in streamtools
View ar2.json
{"blocks":[{"label":"a","type":"*","id":1,"inputs":[{"name":"x","value":null,"type":"number"},{"name":"y","value":{"data":0.99},"type":"number"}],"outputs":[{"name":"x*y","type":"number"}],"source":null,"position":{"x":1103,"y":564}},{"label":"yt","type":"identity","id":4,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":926,"y":661}},{"label":"","type":"delay","id":6,"inputs":[{"name":"in","value":null,"type":"any"},{"name":"duration","value":{"data":"1s"},"type":"string"}],"outputs":[{"name":"out","type":"any"}],"source":null,"position":{"x":941,"y":871}},{"label":"","type":"latch","id":9,"inputs":[{"name":"in","value":null,"type":"any"},{"name":"ctrl","value":null,"type":"boolean"}],"outputs":[{"name":"true","type":"any"},{"name":"false","type":"any"}],"source":null,"position":{"x":572,"y":690}},{"label":"","type":"first","id":10,"inputs":[{"name":"in","value":null,"type":"any"}],"outputs":[{"name":"first","type":"any"}],"source":null,"
You can’t perform that action at this time.