Skip to content

Instantly share code, notes, and snippets.


Brian L. Troutwine blt

View GitHub Profile
blt / .gitignore
Last active September 29, 2018 22:00
cov experiment
View .gitignore

Keybase proof

I hereby claim:

  • I am blt on github.
  • I am troutwine ( on keybase.
  • I have a public key ASA7ED3F_HArLA08CgrbzXJqASlFHbPd8ilNmvM49OS7DQo

To claim this, I am signing this object:

#!/usr/bin/env python2.7
import time
import socket
import sys
def graphite_metric(sock, name, value):
timestamp = int(time.time())
sock.send("%s %f %d\n" % (name, value, timestamp))
def main():
#![cfg_attr(test, feature(plugin))]
#![cfg_attr(test, plugin(quickcheck_macros))]
extern crate quickcheck;
/// This is an implementation of the algorithm presented in Cormode, Korn,
#![cfg_attr(test, feature(plugin))]
#![cfg_attr(test, plugin(quickcheck_macros))]
extern crate quickcheck;
fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
let mut rev = vec!();
for x in xs {
rev.insert(0, x.clone())
blt / Q.lhs
Created August 14, 2015 16:45
View Q.lhs
> module Q where
I have a situtation where it would be extremely useful to limit
the self-recursion of a data type to only a subset of its
constructors. Consider the datatype T below:
> data T
> = A integer
> | B T float
> | C T [float]
blt / hello.erl
Last active December 4, 2020 05:41
What should be the standard Erlang "Hello, world!"
View hello.erl
hello(robert) ->
io:format("Hello, Mike.");
hello(joe) ->
io:format("Hello, Robert.");
hello(mike) ->
io:format("Hello, Joe.").
View SpringNightBLT.css
html {
font-family: 'Monaco';
font-size: 9pt;
background-color: #000;
color: #f0f0f0;
body {}
.url { color: #99cf50; }
.address {}
View udp_srv.erl
%%% API
go(Port) ->
{ok, Socket} = gen_udp:open(Port, [binary,{active,false}]),
View gist:92c609fca93d75d5a35a
(walden-2) ~/projects/com/github/jiffy
blt> rm -rf _build/ && DEBUG=1 rebar3 pc clean, pc compile
===> Evaluating config script "rebar.config.script"
===> Consult config file "rebar.lock"
===> error function_clause
===> Plugin rebar_gdb_plugin not available. It will not be used.
===> Consult config file "/Users/blt/projects/com/github/jiffy/_build/default/plugins/pc/rebar.config"
===> Consult config file "/Users/blt/projects/com/github/jiffy/_build/default/plugins/pc/rebar.lock"
===> Fetching pc ({git,"file:///Users/blt/projects/us/troutwine/port_compiler",