Skip to content

Instantly share code, notes, and snippets.

View thraxil's full-sized avatar

Anders Pearson thraxil

View GitHub Profile
@thraxil
thraxil / gist:6067562
Created July 24, 2013 01:54
hekad config for a simple statsd replacement
[StatsdInput]
address = ":8125"
[StatAccumInput]
ticker_interval = 10
emit_in_payload = true
[CarbonOutput]
message_matcher = "Type == 'heka.statmetric'"
address = "graphite.example.com:2003"
@thraxil
thraxil / gist:7282027
Last active December 27, 2015 06:29
erlang-A
erlangA(Lambda, H) ->
Lambda * H.
@thraxil
thraxil / gist:7282047
Last active December 27, 2015 06:29
Erlang-B
erlangB(_, 0) ->
1;
erlangB(E, M) ->
N = E * erlangB(E, M - 1),
N / (N + M).
@thraxil
thraxil / gist:7282064
Last active December 27, 2015 06:29
Erlang-C
erlangC(_, 0) ->
1;
erlangC(E, M) ->
B = erlangB(E, M),
(M * B) / (M - (E * (1 - B))).
@thraxil
thraxil / agner.erl
Last active December 27, 2015 06:29
-module(agner).
-export([erlangA/2, erlangB/2, erlangC/2]).
erlangA(Lambda, H) ->
Lambda * H.
erlangB(_, 0) ->
1;
erlangB(E, M) ->
N = E * erlangB(E, M - 1),
@thraxil
thraxil / .muttrc
Created February 20, 2014 15:48
mutt config for Columbia Lionmail
set from = "YOURUNI@columbia.edu"
set realname = "YOUR NAME"
set imap_user = "YOURUNI@columbia.edu"
set imap_pass = "YOURDEVICEPASSWORD"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed ="+[Google Mail]/Drafts"
set trash = "+[Google Mail]/Trash"
set header_cache =~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
# A
if some_condition:
goto fail
goto fail
# B
if some_condition:
goto fail
goto fail
// A
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) {
goto fail
goto fail
}
// B
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) {
goto fail
}