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 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 ++ [].
View plusplus.erl
-module(plusplus).
-export([first/0, second/0]).
first() -> [] ++ something.
second() -> something ++ [].
View my_lists.erl
-module my_lists.
%% seq(Min, Max) -> [Min,Min+1, ..., Max]
%% seq(Min, Max, Incr) -> [Min,Min+Incr, ..., Max]
%% returns the sequence Min..Max
%% Min <= Max and Min and Max must be integers
-export [seq/2, seq/3].
-spec seq(From, To) -> Seq when
From :: integer(),
View my_lists.erl
-module(my_lists).
-export([seq/2, seq/3]).
%% seq(Min, Max) -> [Min,Min+1, ..., Max]
%% seq(Min, Max, Incr) -> [Min,Min+Incr, ..., Max]
%% returns the sequence Min..Max
%% Min <= Max and Min and Max must be integers
-spec seq(From, To) -> Seq when
View loading_sendmail.erl
1> code:load_file(sendmail).
=ERROR REPORT==== 10-Nov-2017::09:05:01 ===
/beam/sendmail.beam failed: badfile
=ERROR REPORT==== 10-Nov-2017::09:05:01 ===
beam/beam_load.c(1159): Error loading module sendmail:
not a BEAM file: no IFF 'FOR1' chunk
{error,badfile}
You can’t perform that action at this time.