Skip to content

Instantly share code, notes, and snippets.

View andrzejsliwa's full-sized avatar

Andrzej Śliwa andrzejsliwa

View GitHub Profile
@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))),
@andrzejsliwa
andrzejsliwa / pair
Created November 9, 2012 14:12
A erlang script to change pairs
#!/usr/bin/env escript
my_name() -> "Andrzej Sliwa".
my_email() -> "andrzej.sliwa@my_domain.com".
pairs() ->
[{"an-ar",
[{left, my_name()}, {right, "Artur Kowalski"},
{email, "andrzej+artur@my_domain.com"}]},
{"an-jan",