Skip to content

Instantly share code, notes, and snippets.

@proto_version "1.0"
def process_options(opts) do
env_args()
|> (&process_in(opts, &1)).()
|> (&process_err(opts, &1)).()
|> (&process_dir(opts, &1)).()
end
defp process_in(opts, args) do
=ERROR REPORT==== 12-Jun-2014::15:23:03 ===
** Task <0.38.0> terminating │
** Started by local_name_or_pid │
** When Function == #Fun<erlang.hd.1> │
** Arguments == [[]]
** Reason for termination ==
** {badarg,[{erlang,hd,[[]],[]},
{'Elixir.Agent.Server',handle_call,3,
[{file,"lib/agent/server.ex"},{line,11}]},
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,580}]},
defmodule FibAgent do
def start_link do
cache = Enum.into([{0, 0}, {1, 1}], HashDict.new)
Agent.start_link(fn -> cache end)
end
def fib(pid, n) when n >= 0 do
Agent.get_and_update(pid, &do_fib(&1, n))
end
defmodule MyReceive do
defmacro my_receive(do: clauses) do
extra = quote do
other -> IO.puts "got #{inspect other}"
end
quote do
receive do: unquote(clauses ++ extra)
end
end
-module(pecypc_session).
-author('Vladimir Dronnikov <dronnikov@gmail.com>').
%% -----------------------------------------------------------------------------
%% API exports
%% -----------------------------------------------------------------------------
-export([
add/1,
add/2,
@fishcakez
fishcakez / restforbug.erl
Created April 2, 2013 21:32
Rest for one restart bug.
-module(restforbug).
-export([start/0]).
start() ->
ok = application:start(restforbug),
exit(whereis(restforbug_first), bye).
Dispatch = cowboy_router:compile([
{'_', [
{"/", cowboy_static,
[{directory, {priv_dir, web, []}},
{mimetypes, [{<<".html">>, [<<"text/html">>]}]},
{file, <<"index.html">>}]},
{"/js/[...]", cowboy_static,
[{directory, {priv_dir, web, [<<"js">>]}},
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},

#vim-erlang_tools

https://github.com/fishcakez/vim-erlang_tools

Vim plugin to combine vim and tmux to add support for some erlang tools to vim. Inspired by the vimux plugin. Currently erlc, ct_run, dialyzer, eunit and rebar have some support.

The plugin works by using a ct hook or an eunit listener to produce identical format to dialyzer -o outputfile. This means all tools' output can be parsed