Skip to content

Instantly share code, notes, and snippets.

🇦🇷
Working from BA

Brujo Benavides elbrujohalcon

🇦🇷
Working from BA
Block or report user

Report or block elbrujohalcon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View joe.erl
-module joe.
-export [test/0, perms/1].
test() ->
[[]] = joe:perms(""),
["a"] = joe:perms("a"),
["ab", "ba"] = joe:perms("ab"),
["ba", "ab"] = joe:perms("ba"),
["123","132","213","231","312","321"] = joe:perms("123"),
View joe.erl
-module joe.
-export [test/0, perms/1].
test() ->
[[]] = joe:perms(""),
["a"] = joe:perms("a"),
["ab", "ba"] = joe:perms("ab"),
["ba", "ab"] = joe:perms("ba"),
["123","132","213","231","312","321"] = joe:perms("123"),
View joe.erl
-module joe.
-export [test/0, perms/1].
test() ->
[[]] = joe:perms(""),
["a"] = joe:perms("a"),
["ab", "ba"] = joe:perms("ab"),
["ba", "ab"] = joe:perms("ba"),
["123","132","213","231","312","321"] = joe:perms("123"),
View joe.erl
-module joe.
-export [test/0].
test() ->
[[]] = joe:perms(""),
["a"] = joe:perms("a"),
["ab", "ba"] = joe:perms("ab"),
["ba", "ab"] = joe:perms("ba"),
["123","132","213","231","312","321"] = joe:perms("123"),
View my_modules.ex
defmodule MyODT do
@opaque t() :: %{required(:f1) => boolean, required(:f2) => atom}
@spec new(boolean, atom) :: t
def new(f1, f2), do: %{f1: f1, f2: f2}
@spec f1(t) :: boolean
def f1(%{f1: f1}), do: f1
def f2(%{f2: f2}), do: f2
View my.file
This is just a file.
View gist:4c787937cb1052018a9546ef455c1466
1> A = [ [1,2,3],[4,5,6]].
[[1,2,3],[4,5,6]]
2> B = [ [a,b,c],[d,e,f]].
[[a,b,c],[d,e,f]]
3> [lists:zip(X, Y)|| X <- A, Y <- B].
[[{1,a},{2,b},{3,c}],
[{1,d},{2,e},{3,f}],
[{4,a},{5,b},{6,c}],
[{4,d},{5,e},{6,f}]]
@elbrujohalcon
elbrujohalcon / crazy_shorties.erl
Last active May 7, 2019
Esos Locos Bajitos (by Joan Manuel Serrat)
View crazy_shorties.erl
-module crazy_shorties.
-author(joan_manuel).
-export [new/0, teach/1, direct/1].
new() ->
Child = spawn_link(fun live/0),
timer:send_interval(1000, Child, tick),
Child.
@elbrujohalcon
elbrujohalcon / in.erl
Last active Apr 10, 2018
In My Life (by The Beatles)
View in.erl
-module(in).
-author(john).
-author(paul).
-author(george).
-author(ringo).
-export([my_life/1]).
my_life(NewPlaces) ->
View plusplus.erl
-module(plusplus).
-export([first/0, second/0, third/0]).
-spec first() -> 'something'.
first() -> [] ++ something.
-spec second() -> none().
second() -> something ++ [].
You can’t perform that action at this time.