Skip to content

Instantly share code, notes, and snippets.

View evanmcc's full-sized avatar
status is a bad idea, github is not a social network

Evan Vigil-McClanahan evanmcc

status is a bad idea, github is not a social network
View GitHub Profile
evanmcc /
Created September 21, 2014 16:56
notes on implementing queue bounds



  • in bif.c
  • calls do_send
  • otherwise handles the erlang side of things, returning the right thing, bumping reductions, etc.


  • in bif.c
  • also calls do send and seems to have some overlap with erl_send
  • can likely do this without understanding the difference fully
evanmcc / ainfo.txt
Created December 8, 2014 06:34
simpler gen-server for lager-using projects
This file provides a simpler gen-server template for emacs' tempo mode.
To use it, drop the following:
`(load-file "/path/to/gen-server.el")`
in your .emacs or init.el or whatever somewhere after your erlang-mode initialization (so after package init if you're using packages).
It defines a function called `tempo-template-gen-server` which you can access from M-x as per usual.
evanmcc / tempo.el
Created January 1, 2015 00:43
tempo template for lighter gen_server + with lager integration
(tempo-define-template "gen-server"
'((erlang-skel-include erlang-skel-small-header)
"-behaviour(gen_server)." n n
"%% API" n
"-export([start_link/0])." n n
"%% gen_server callbacks" n
"-export([init/1, handle_call/3, handle_cast/2, "
"handle_info/2," n>
evanmcc / gist:2243196
Created March 29, 2012 20:10
glue_take backtrace
(gdb) bt
#0 0x00007ffff6af1f39 in glue_take99900 ()
at src/rustc/middle/trans/
#1 0x00007ffff6b919eb in mk_expr () at src/rustc/syntax/parse/
#2 0x00007ffff6b9afdc in mk_pexpr () at src/rustc/syntax/parse/
#3 parse_prefix_expr () at rustc.rc:1188
#4 0x00007ffff6b9b1b0 in parse_binops ()
at src/rustc/syntax/parse/
#5 0x00007ffff6b9b915 in parse_assign_expr ()
at src/rustc/syntax/parse/
evanmcc / gist:2246826
Created March 30, 2012 05:30
difference in fn prologue?
This is all right as we're entering the function where the data is seen as corrupted.
2b29f5: 41 55 push %r13
2b29f7: 41 54 push %r12
2b29f9: 53 push %rbx
2b29fa: 48 81 ec b8 04 00 00 sub $0x4b8,%rsp
2b2a01: 49 89 d6 mov %rdx,%r14
2b2a04: 4c 89 b5 48 fb ff ff mov %r14,-0x4b8(%rbp)
evanmcc / ebml-out.txt
Created April 3, 2012 22:22
output with ebml debugging
evan@bodine:~/src/rustbugs/ebml$ RUST_LOG=rustc=0,std::ebml=3 rustc --emit-llvm
rust: ". next_doc(exp_tag=5)"
rust: "self.parent=305522-305542 self.pos=305522 r_tag=5 r_doc=305524-305532"
rust: ". next_doc(exp_tag=5)"
rust: "self.parent=305522-305542 self.pos=305532 r_tag=5 r_doc=305534-305542"
rust: ". next_doc(exp_tag=15)"
rust: "self.parent=305547-309687 self.pos=305561 r_tag=15 r_doc=305566-309687"
rust: ". next_doc(exp_tag=16)"
rust: "self.parent=305566-309687 self.pos=305566 r_tag=16 r_doc=305568-305572"
rust: "_next_uint exp_tag=16 result=0"
evanmcc / gist:2323230
Created April 6, 2012 21:45
rust jit exception bt
(gdb) run --cfg=ndebug --target=x86_64-unknown-linux-gnu -o x86_64-unknown-linux-gnu/test/rustctest.stage2-x86_64-unknown-linux-gnu src/rustc/rustc.rc --jit --test
Starting program: /home/evan/src/rust_jit/x86_64-unknown-linux-gnu/stage2/bin/rustc --cfg=ndebug --target=x86_64-unknown-linux-gnu -o x86_64-unknown-linux-gnu/test/rustctest.stage2-x86_64-unknown-linux-gnu src/rustc/rustc.rc --jit --test
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff7fe5700 (LWP 31924)]
[New Thread 0x7ffff7fcc700 (LWP 31925)]
[New Thread 0x7ffff7fb3700 (LWP 31926)]
[New Thread 0x7ffff7f9a700 (LWP 31927)]
[New Thread 0x7ffff32c1700 (LWP 909)]
[New Thread 0x7ffff32a8700 (LWP 910)]
[New Thread 0x7ffff328f700 (LWP 911)]
evanmcc / gist:2890276
Created June 7, 2012 17:42
proposed rebar change
check_versions(Config) ->
ErtsRegex = rebar_config:get(Config, require_erts_vsn, ".*"),
ReOpts = [{capture, none}],
case re:run(erlang:system_info(version), ErtsRegex, ReOpts) of
match ->
?DEBUG("Matched required ERTS version: ~s -> ~s\n",
[erlang:system_info(version), ErtsRegex]);
nomatch ->
?ABORT("ERTS version ~s does not match required regex ~s\n",
[erlang:system_info(version), ErtsRegex])
evanmcc / description
Created June 15, 2012 20:47
repro the lingering tombstone issues
this works on my machine, against a local devrel cluster backed by elevedb
check afterwards with:
curl localhost:8091/buckets/baz/keys?keys=stream
keys seem to be durable until one does a get on them, then they vanish.
#!/usr/bin/env emacs --script
;; should likely be called with 2</dev/null to suppress the various
;; output to the shell.
;; I think that this is going to fail non-emacs24 installs, since
;; 'package isn't installed by default there. You'll see this error:
;; "Symbol's function definition is void: package-initialize"
;; `brew install emacs` should fix you up, though.