Skip to content

Instantly share code, notes, and snippets.

View kagami-ryuuji's full-sized avatar

Ryuuji Kagami kagami-ryuuji

View GitHub Profile
@kagami-ryuuji
kagami-ryuuji / pipe.erl
Last active March 5, 2016 12:58
Elixir-like pipe in Erlang
-module(pipe).
-compile(export_all).
parse_transform(Forms, Options) ->
Forms2 = replace(Forms),
io: format("~p~n", [Forms2]),
Forms2.
replace({lc, Line, {atom, Line2, '|>'}, Path}) ->
pipe(Path);
@kagami-ryuuji
kagami-ryuuji / send_after_test.erl
Created February 21, 2016 14:21
Test erlang:send_after
-module(send_after).
-compile(export_all).
start(N) ->
spawn(?MODULE, init0, [N]).
init0(N) ->
loop(N).
loop(0) -> erlang:send_after(20000, self(), stop), loop({0, 0});