Skip to content

Instantly share code, notes, and snippets.

Brian L. Troutwine blt

Block or report user

Report or block blt

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
@blt
blt / .gitignore
Last active Sep 29, 2018
cov experiment
View .gitignore
*.o
*.a
example_cc
example_rs
View keybase.md

Keybase proof

I hereby claim:

  • I am blt on github.
  • I am troutwine (https://keybase.io/troutwine) on keybase.
  • I have a public key ASA7ED3F_HArLA08CgrbzXJqASlFHbPd8ilNmvM49OS7DQo

To claim this, I am signing this object:

View emit_graphite.py
#!/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():
View lib.rs
#![cfg_attr(test, feature(plugin))]
#![cfg_attr(test, plugin(quickcheck_macros))]
#![allow(dead_code)]
#![allow(unused_imports)]
#[cfg(test)]
extern crate quickcheck;
/// This is an implementation of the algorithm presented in Cormode, Korn,
View reverse.rs
#![cfg_attr(test, feature(plugin))]
#![cfg_attr(test, plugin(quickcheck_macros))]
#[cfg(test)]
extern crate quickcheck;
fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
let mut rev = vec!();
for x in xs {
rev.insert(0, x.clone())
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
blt / hello.erl
Last active Mar 12, 2017
What should be the standard Erlang "Hello, world!"
View hello.erl
-module(hello).
-export([hello/1]).
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
-module(udp_srv).
-export([go/1]).
%%%===================================================================
%%% 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",
You can’t perform that action at this time.