Skip to content

Instantly share code, notes, and snippets.

Avatar

Will Sewell WillSewell

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am WillSewell on github.
  • I am willsewell (https://keybase.io/willsewell) on keybase.
  • I have a public key whose fingerprint is 7789 ACED 15B8 F832 58D7 A097 9A5D 8865 125B 3A87

To claim this, I am signing this object:

@WillSewell
WillSewell / latency-versions
Created Nov 1, 2016
Hardware and software versions for GC latency experiment
View latency-versions
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.1
BuildVersion: 16B2555
$ sysctl -nh machdep.cpu.brand_string
Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
sysctl -nh hw.memsize
8,589,934,592
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.1
View gist:087779af41cb32e296c5
58,497,768,352 bytes allocated in the heap
2,067,438,528 bytes copied during GC
31,704,752 bytes maximum residency (270 sample(s))
5,090,888 bytes maximum slop
95 MB total memory in use (28 MB lost due to fragmentation)
Tot time (elapsed) Avg pause Max pause
Gen 0 68568 colls, 0 par 3.397s 5.735s 0.0001s 0.0004s
Gen 1 270 colls, 0 par 0.570s 0.578s 0.0021s 0.0042s
@WillSewell
WillSewell / gist:bb4e8db17acd38c30c51
Created Apr 2, 2015
Old Pusher "webhook-channel-vacated" integration test
View gist:bb4e8db17acd38c30c51
AsyncTest.define("webhook-channel-vacated #{params[:cluster_name]}", checks: 4, timeout: params[:timeout] ) { |t|
channel_name = "channel-existence-#{rand(1000000)}"
params[:webhooks]["/#{params[:cluster_name]}/webhook-channel-vacated"]=Proc.new do |post|
next unless channel_name == (post["events"][0]["channel"] rescue nil)
begin
event_name = post["events"][0]["name"]
pattern = {
"time_ms" => matches{|x| x.kind_of?(Integer)},
"events" => [{ "channel" => channel_name, "name" => event_name }]
@WillSewell
WillSewell / winFold.hs
Last active Aug 29, 2015
A Haskell foldl that slides a "window" over the list
View winFold.hs
-- f now takes a sliding sublist of values, rather than each value
-- n is the window size
winFold :: ([a] -> b -> b) -> b -> [a] -> Int -> b
winFold f acc n [] = acc
winFold f acc n xs = winFold f (f (take n xs) acc) (tail xs) n