avatar

elixir

Elixir is a functional programming language.

grimoire

labeling IO.inspect

IO.inspect("meow", label: "cat")
cat: "meow"

truncating maps in IO.inspect

IO.inspect(["Hello", "world"], limit: 1) # :infinity
["Hello", ...]
["Hello", "world"]

IO.inspect in colour

IO.inspect(_, syntax_colors: IO.ANSI.syntax_colors())

using cassettes

describe "function/1" do
  test "case" do
    use_cassette "path/cassette", match_requests_on: [:headers] do
      # ...
    end
  end
end
def check(condition) do
  if condition, do: "yes", else "no"
end
def check(true), do: "yes"
def check(false), do: "no"

mix

checking code coverage

MIX_ENV=test mix coveralls.detail --filter file.ex

list outdated dependencies and purge unused dependencies

mix hex.outdated
mix deps.clean --unlock --unused