Skip to content

Instantly share code, notes, and snippets.

View archaelus's full-sized avatar

Geoff Cant archaelus

  • San Francisco, CA
View GitHub Profile
@archaelus
archaelus / build output (broken) nightly-2016-06-09
Last active June 24, 2016 00:36
Zinc nightly build problem
rustup run nightly-2016-06-09 cargo build --verbose --features mcu_k20
Compiling rlibc v0.1.4 (https://github.com/hackndev/rlibc?branch=zinc#620489f8)
Running `rustc Home/.cargo/git/checkouts/rlibc-22ab3e9e80121e06/zinc/src/lib.rs --crate-name rlibc --crate-type lib -g -C metadata=961f6a1dbd8e6b29 -C extra-filename=-961f6a1dbd8e6b29 --out-dir Home/projects/lrn2rst/zinc/target/debug/deps --emit=dep-info,link -L dependency=Home/projects/lrn2rst/zinc/target/debug/deps -L dependency=Home/projects/lrn2rst/zinc/target/debug/deps --cap-lints allow`
Compiling volatile_cell v1.0.0 (file://Home/projects/lrn2rst/zinc/volatile_cell)
Running `rustc volatile_cell/lib.rs --crate-name volatile_cell --crate-type rlib -g -C metadata=6eaf9a8b4cfc05df -C extra-filename=-6eaf9a8b4cfc05df --out-dir Home/projects/lrn2rst/zinc/target/debug/deps --emit=dep-info,link -L dependency=Home/projects/lrn2rst/zinc/target/debug/deps -L dependency=Home/projects/lrn2rst/zinc/target/debug/deps`
Compiling ioreg v0.1.0 (file://H
@archaelus
archaelus / lib.rs
Last active August 29, 2015 14:16
Rust API Client
extern crate hyper;
use hyper::Client;
use hyper::header::{Header, Accept, Authorization};
use hyper::net::NetworkConnector;
use hyper::client::{IntoUrl, RequestBuilder};
struct API {
api_host: String,
}
class RustNightly < Formula
url "https://static.rust-lang.org/dist/rust-nightly-x86_64-apple-darwin.pkg", using: :nounzip
homepage "http://www.rust-lang.org"
sha1 ""
version Date.today.to_s
def install
system "pkgutil --expand rust-nightly-x86_64-apple-darwin.pkg rn"
Eshell V5.5.5 (abort with ^G)
(ssae@127.0.0.1)1> ssae:rebuild_module("../racer.zip", "ebin/ssae.beam", "ebin/evil/ssae.beam").
ok
(ssae@127.0.0.1)2> code:load_abs("ebin/evil/ssae").
{module,ssae}
(ssae@127.0.0.1)3> nl(ssae).
abcast
(ssae@127.0.0.1)4> beam_lib:chunks("ebin/evil/ssae.beam", ["SSAE"]).
{ok,{ssae,[{"SSAE",
<<80,75,3,4,10,0,0,0,0,0,66,181,59,55,0,0,0,0,0,0,0,0,...>>}]}}
%% @copyright Geoff Cant
%% @author Geoff Cant <nem@erlang.geek.nz>
%% @version {@vsn}, {@date} {@time}
%% @doc Default HTTP handler for Logmachine.
%% @end
-module(lm_logs_rest).
-export([init/3
,rest_init/2
,known_methods/2
@archaelus
archaelus / notes.md
Created February 7, 2012 03:55
Erlang Meetup Notes

What do you want to see next time:

  • Accesible talks

  • Erlang for Ruby Programmers

  • Monitoring Tools

  • Supervisors -- I always rolled my own.

  • Lots of datastructure libraries -- when should I use what?

  • Monads in Erlang

  • Nested finite state machines -- I keep wanting this, should I ?

  • Web Frameworks du Jour

@archaelus
archaelus / fnord.erl
Created November 14, 2011 22:13
So there.
A = <<131,103,100,0,55,112,108,117,115,95,112,114,101,115,
101,110,99,101,64,109,111,98,97,103,101,45,112,114,111,
100,45,112,114,101,115,101,110,99,101,49,48,49,46,98,
101,46,115,97,99,46,110,103,109,111,99,111,46,99,111,
109,0,0,92,13,0,0,20,186,3>>,
B = <<131,103,100,0,55,112,108,117,115,95,112,114,101,115,
101,110,99,101,64,109,111,98,97,103,101,45,112,114,111,
100,45,112,114,101,115,101,110,99,101,49,48,49,46,98,
101,46,115,97,99,46,110,103,109,111,99,111,46,99,111,
109,0,0,92,13,0,0,20,186,0>>,
@archaelus
archaelus / interfaces.erl
Created September 28, 2011 06:53
Snippet to route addresses based on directly attached networks.
%% @copyright Geoff Cant
%% @author Geoff Cant <nem@erlang.geek.nz>
%% @version {@vsn}, {@date} {@time}
%% @doc Snippet to route addresses based on directly attached networks.
%% @end
-module(interfaces).
-export([route/1
,route/2
,routes/0
@archaelus
archaelus / crazy_fun.erl
Created September 8, 2011 22:00
Fun experiment
-module(crazy_fun).
-export([science/0]).
science() ->
fun () ->
'nothing_to_see_here'
end.
@archaelus
archaelus / bertrpc.pcap.txt
Created August 31, 2011 03:32
Phyrric victory - bertrpc wireshark dissector achieved.
Frame 4: 116 bytes on wire (928 bits), 116 bytes captured (928 bits)
Arrival Time: Aug 30, 2011 13:05:27.159310000 PDT
Epoch Time: 1314734727.159310000 seconds
[Time delta from previous captured frame: 0.000137000 seconds]
[Time delta from previous displayed frame: 0.000137000 seconds]
[Time since reference or first frame: 0.000285000 seconds]
Frame Number: 4
Frame Length: 116 bytes (928 bits)
Capture Length: 116 bytes (928 bits)
[Frame is marked: False]