Skip to content

Instantly share code, notes, and snippets.

@g-andrade
g-andrade / decode_erlang_external_term_format.erl
Created Jul 27, 2017
Decodign Erlang's external term format (incomplete)
View decode_erlang_external_term_format.erl
-module(decode_erlang_external_term_format).
-export([binary_to_term/1]).
binary_to_term(<<131, 80, _UncompressedSize:32, CompressedData/binary>>) ->
Data = zlib:uncompress(CompressedData),
decode(Data);
binary_to_term(<<131, Data/binary>>) ->
decode(Data).
decode(<<82, _AtomCacheReferenceIndex, _Rest/binary>>) ->
@erszcz
erszcz / graph_fsm.erl
Created Mar 15, 2016
Vance Shipley's graph_fsm - a tool for drawing Erlang gen_fsm diagrams (http://www1.erlang.org/pipermail/erlang-questions/2001-October/003716.html)
View graph_fsm.erl
%% graph_fsm.erl
%%
%% Author: Vance Shipley, Motivity Telecom Inc. <vances@motivity.ca>
%% Date: November, 2000
%%
%%
%% This library is free software; you can redistribute it and/or
%% modify it under the terms of the GNU Lesser General Public
%% License as published by the Free Software Foundation; either
%% version 2 of the License, or (at your option) any later
@robertoaloi
robertoaloi / kill-erlang-node.sh
Created Feb 8, 2014
Kill an Erlang process by node name
View kill-erlang-node.sh
#!/usr/bin/env bash
# Kill an Erlang process by node name
#
# e.g.: kill-erlang-node kred
# Check usage
if [ -z "$1" ]; then
echo "Usage: `basename $0` NODE_NAME"
exit 1
@piscisaureus
piscisaureus / pr.md
Created Aug 13, 2012
Checkout github pull requests locally
View pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

You can’t perform that action at this time.