Skip to content

Instantly share code, notes, and snippets.

View arcusfelis's full-sized avatar

Michael Uvarov arcusfelis

View GitHub Profile
@arcusfelis
arcusfelis / gist:3973448
Created October 29, 2012 13:10
Translit cyrillic texts in erlang
(i18n@omicron)5> T = i18n_transliteration:open('Cyrillic-Latin').
<<>>
(i18n@omicron)7> S = i18n:to(i18n_transliteration:do(T, i18n:from("эрланг"))).
<<"érlang">>
(i18n@omicron)8> io:format("~ts", [S]).
érlangok
@arcusfelis
arcusfelis / bm.erl
Created October 15, 2012 09:34
internal error in core_dsetel_module
-module(bm).
-compile([export_all]).
-record(rec, {f1 = 1, f2 = 2}).
-record(rec2, {f2 = b, f3 = c}).
tst(A, K) ->
case true of
true -> #rec{f2 = V} = #rec2{f2 = V} = A#rec{f1 = updated}
end,
V.
join([B|Bs], Sep) when is_binary(Sep) ->
R = << <<Sep/binary, X/binary>> || X <- Bs >>,
<<B/binary, R/binary>>;
join([], _Sep) ->
<<>>.
join2([B|Bs], Sep) when is_binary(Sep) ->
R = [ [Sep, X] || X <- Bs ],
@arcusfelis
arcusfelis / emark.err.log
Created July 28, 2012 12:41
emark and rebar 3.0.0
==> csv_parser (emark)
ERROR: emark failed while processing /home/user/erlang/csv_parser: {'EXIT',
{undef,
[{rebar_erlc_compiler,doterl_compile,
[{config,"/home/user/erlang/csv_parser/deps/emark",
[{erl_first_files,[]},
{erl_opts,[{d,'BENCHMARK'}]},
{deps,
[{proper,".*",{git,"git://github.com/manopapad/proper.git","HEAD"}},
{emark,".*",{git,"git://github.com/ftrvxmtrx/emark.git","HEAD"}}]},
@arcusfelis
arcusfelis / gist:3116637
Created July 15, 2012 12:42
Fix underscore or asterisk inside an inline code block in Vim with markdown syntax highlighting
Add to /usr/share/vim/vim73/syntax/markdown.vim:
syn region markdownCode start=/^`\{3,3}\s*\w*\s*$/ end=/^`\{3,3}\s*$/
@arcusfelis
arcusfelis / gist:3103416
Created July 13, 2012 07:38
Monitor messages of the gen_event on console
sys:trace(ccd3_event, true).
@arcusfelis
arcusfelis / bjoin.erl
Created July 12, 2012 08:58
bjoin.erl
bjoin([H|T], Delim) ->
BinT = << <<Delim/binary, X/binary>> || X <- T>>,
<<H/binary, BinT/binary>>.
bjoin([], _Delim) ->
<<>>.
@arcusfelis
arcusfelis / gist:3096561
Created July 12, 2012 08:02
Erlang and wxwidgets deps on Debian
aptitude install libwxgtk2.8-dev libgl1-mesa-dev libglu1-mesa-dev libpng3
apt-get build-dep erlang
@arcusfelis
arcusfelis / rebar-i18n-ta-targetvar.log
Created June 15, 2012 18:31
rebar-i18n-ta-targetvar.log
DEBUG: Rebar location: "/home/user/erlang/i18n/rebar"
DEBUG: Consult config file "/home/user/erlang/i18n/rebar.config"
DEBUG: is_app_available, looking for App triq with Path "/home/user/erlang/i18n/deps/triq"
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "0.1.0"
INFO: Looking for triq-.* ; found triq-0.1.0 at /home/user/erlang/i18n/deps/triq
DEBUG: is_app_available, looking for App rebar_i18n_plugin with Path "/home/user/erlang/i18n/deps/rebar_i18n_plugin"
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "1"
INFO: Looking for rebar_i18n_plugin-.* ; found rebar_i18n_plugin-1 at /home/user/erlang/i18n/deps/rebar_i18n_plugin
DEBUG: is_app_available, looking for App edown with Path "/home/user/erlang/i18n/deps/edown"
DEBUG: vcs_vsn: Primary vcs used for /home/user/erlang/i18n/deps/edown
@arcusfelis
arcusfelis / rebar-i18n-old.log
Created June 15, 2012 18:05
rebar-i18n-old.log
[22:00:58] user@delta i18n :) ./rebar --version
rebar version: 2 date: 20110930_055606 vcs: git f51e3df
[22:01:02] user@delta i18n :) ./rebar clean skip_deps=true
==> i18n (clean)
[22:01:06] user@delta i18n :) cat rebar.config
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-