Elixir Cheat Sheet

Iteration

Iterate over map keys and values

Enum.each(map, fn({k, v}) ->
  IO.puts("#{k} => #{v}")
end)

Sigils

~U(2000-01-01 23:00:00.000000Z) # DateTime with timezone
~N(2000-01-01 23:00:00.000000) # NativeDateTime
~w(hello world)a #atom

DateTime

DateTime.to_unix(params.from, :millisecond)
:os.system_time(:millisecond)
System.monotonic_time()