Skip to content

Instantly share code, notes, and snippets.

View garazdawi's full-sized avatar

Lukas Larsson garazdawi

  • Erlang Solutions
  • Stockholm
View GitHub Profile
> infocmp xterm
# Reconstructed via infocmp from file: /lib/terminfo/x/xterm
xterm|xterm-debian|X11 terminal emulator,
am, bce, km, mc5i, mir, msgr, npc, xenl,
colors#8, cols#80, it#8, lines#24, pairs#64,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
keyfind(Key,Value,[H|T]) ->
case maps:find(Key,H) of
{ok, Value} ->
H;
_ ->
keyfind(Key,Value,T)
end;
keyfind(_,_,[]) ->
false.
nmap(F,List) ->
nmap(F,erlang:fun_info(F,arity),List).
nmap(F,Ar,List) ->
{Hd,Tl} = lists:split(Ar,List),
[apply(F,Hd)|nmap(Tl)];
nmap(_F,_,[]) ->
[].