Skip to content

Instantly share code, notes, and snippets.

View linearregression's full-sized avatar

edwardttril linearregression

  • San Francisco Bay Area, CA
View GitHub Profile
@linearregression
linearregression / gen_rpc.erl
Created December 2, 2015 04:17 — forked from maxlapshin/gen_rpc.erl
Script to create .c and .h files to generate C structs read/write code from .hrl description
#!/usr/bin/env escript
-mode(compile).
-record(gen, {
module,
enums = [],
structs = [],
aliases = [],
@angrycub
angrycub / graph_ring
Last active February 20, 2018 11:58
Escript to Graph a Riak Ring using HTML5 and Graph.JS
#!/usr/bin/env escript
%% -*- erlang -*-
%%! -smp enable -sname graph_ring -mnesia debug verbose
main([RingFile, OutFile]) ->
{ok, Binary} = file:read_file(RingFile),
Ring = binary_to_term(Binary),
OwnerList = element(2,element(4,Ring)),
%io:format("~s~n", [lists:flatten(header(body(footer([]),OwnerList)))]);
@stwind
stwind / Makefile
Last active December 21, 2015 11:59
Common Erlang Makefile tasks
APP := erlang_awesome
include common.mk
include rebar.mk
include release.mk
include pkg.mk
@andrzejsliwa
andrzejsliwa / cowboy_debug.erl
Last active August 26, 2016 07:30
erlang - cowboy debugging helper request/response
%% See LICENSE for licensing information.
-module(cowboy_debug).
-export([onrequest_hook/1]).
-export([onresponse_hook/4]).
onrequest_hook(Req) ->
Method = to_string(extract(cowboy_req:method(Req))),
Path = to_string(extract(cowboy_req:path(Req))),
Params = params_to_string(extract(cowboy_req:qs_vals(Req))),
@leandrosilva
leandrosilva / README
Created March 10, 2011 23:22
Sample on how I use websocket_client to test Erlang WebSocket-based applications
This is a quick sample on how I have used websocket_client to test Erlang WebSocket-based applications. To
taste it you will need to have a copy of websocket_client from my fork, available at:
https://github.com/leandrosilva/erlang_websocket/blob/master/src/websocket_client.erl
The websocket_client module was made by Dave Bryson on erlang_websocket project:
https://github.com/davebryson/erlang_websocket
Enjoy!