Welcome to ElixirDrops!

Hello there and welcome to the ultimate hub for the Elixir community! Whether you're a seasoned developer or just starting your journey, ElixirDrops is the perfect place to discover, share, and discuss the best tips and tricks for mastering Elixir. Sign in to explore, learn and become a contributor on this platform.

String.downcase/1 can turn garbage into valid input: use :ascii

String.downcase/1 and String.upcase/1 follow Unicode case mapping. That's usually what you want for human text, but not for identifiers:...
igorgbr

igorgbr

4 hours ago

0

Choosing Elixir tools with elixir.menu

elixir.menu is a guide to choosing tools for Elixir applications, from command-line utilities to Phoenix web apps. It covers libraries and built-in OT...
almirsarajcic

almirsarajcic

yesterday

0

Admit when you’re wrong

People in the Elixir community shouldn't be butthurt about DHH's Campfire benchmarks. We should use them as an opportunity to look at the state of the...
almirsarajcic

almirsarajcic

9 days ago

1

Trapping exits so terminate/2 actually runs

A GenServer that flushes buffered work in terminate/2 loses it when its supervisor shuts it down, unless the process traps exits:...
almirsarajcic

almirsarajcic

16 days ago

0

Keeping compile_env values out of runtime.exs

Application.compile_env/3 bakes a value into the module when it compiles. If config/runtime.exs sets the same key, the two can disagree without anyone...
almirsarajcic

almirsarajcic

20 days ago

0

Sorting DateTime lists with Enum.sort/2

Enum.sort/1 puts January 31 after February 1:...
almirsarajcic

almirsarajcic

21 days ago

0

Setting updated_at yourself in Repo.update_all/3

Repo.update_all/3 writes the columns you give it and nothing else, so updated_at keeps its old value:...
almirsarajcic

almirsarajcic

22 days ago

0

How we use ETS as a live code-graph database in Synapse MCP

We have built/building Synapse MCP — a tool that gives AI agents a persistent map of your codebase — and one design question came up early: where does...
spasm-myelixlabs

spasm-myelixlabs

22 days ago

0

Running doctests against the database

Doctests are straightforward until an example calls Repo. A plain ExUnit case doesn't check out an Ecto sandbox connection, so run database-backed doc...
almirsarajcic

almirsarajcic

23 days ago

0

Keeping Oban's time units explicit

Oban's Lifeline and Pruner accept raw integers in different units: rescue_after is milliseconds, while max_age is seconds. On current Oban releases, ...
almirsarajcic

almirsarajcic

24 days ago

0

Catching GenServer.call/3 timeout exits

GenServer.call/3 does not return {:error, :timeout} when the server misses its deadline. It exits the caller instead....
almirsarajcic

almirsarajcic

25 days ago

0

Keeping self() straight in on_exit callbacks

An on_exit callback looks like it belongs to the test that registered it, but self() inside the callback is not the test PID:...
almirsarajcic

almirsarajcic

26 days ago

0

Clearing inherited variables in System.cmd

Passing env: [] to System.cmd/3 does not clear the child environment....
almirsarajcic

almirsarajcic

27 days ago

0

Running Task.async_stream/3 for side effects

Calling Task.async_stream/3 does not start any tasks:...
almirsarajcic

almirsarajcic

28 days ago

0

Keeping timeouts active while tracing tests

A test can stop timing out when you rerun it with --trace:...
almirsarajcic

almirsarajcic

29 days ago

0