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.

Sharing ElixirDrops sponsorship revenue

I'm trying revenue sharing on ElixirDrops through the end of December. To qualify, you need at least five published Drops in total on ElixirDrops. Dro...
almirsarajcic

almirsarajcic

10 hours ago

0

Computing map defaults only when needed

If your app takes a region from its options and falls back to an environment variable, Map.get/3 can raise even when the region is already set:...
almirsarajcic

almirsarajcic

13 hours ago

0

Passing match suffix to ecto's foreign_key_constraint/3

TIL that ecto's foreign_key_constraint/3 can match constraint names by suffix. You don't have to list every constraint by its full name. You write the...
jrowah

jrowah

yesterday

0

Keeping the socket out of async tasks

If your assign_async/3 callback reads socket.assigns.user_id, it captures the whole socket, even though the query only needs an ID:...
almirsarajcic

almirsarajcic

4 days ago

0

Introducing KogenCredo 0.1.0

Generated code can repeat mistakes in error handling and tests, so KogenCredo 0.1.0 adds 35 configurable Credo checks for patterns worth reviewing. E...
almirsarajcic

almirsarajcic

5 days ago

2

Releasing OptimumCredo 0.5.0

OptimumCredo 0.5.0 adds a 74-check collection and moves three previously published checks to KogenCredo. If you use those checks, add KogenCredo as a...
almirsarajcic

almirsarajcic

5 days ago

0

Namespacing module attributes in libraries

I was refactoring an Ash app and wanted to put boundaries between its domains, so I tried adding use Boundary to the existing Ash domain modules. That...
almirsarajcic

almirsarajcic

8 days ago

0

Declaring opaque return types on constructors

Our Phoenix browser tests use PhoenixTest.Playwright to drive a real browser. Our additional-session helper asks the library to create a session, then...
almirsarajcic

almirsarajcic

10 days ago

0

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

20 days ago

1

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

21 days ago

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

29 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

1 month 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

1 month ago

0

Sorting DateTime lists with Enum.sort/2

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

almirsarajcic

1 month 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

1 month ago

0