# ElixirDrops Index

A collection of Elixir tips, tricks, and code snippets shared by the community.

---

## [String.downcase/1 can turn garbage into valid input: use :ascii](https://elixirdrops.net/d/cR2BfXbM.md)

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

- Author: igorgbr
- Created: October 14, 2026


## [Choosing Elixir tools with elixir.menu](https://elixirdrops.net/d/ZrQo16P3.md)

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 OTP tools, with reasons to use them, their limitatio...

- Author: almirsarajcic
- Created: October 13, 2026


## [Admit when you’re wrong](https://elixirdrops.net/d/rNXGVxhW.md)

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 ecosystem and review some of the assumptions that...

- Author: almirsarajcic
- Created: October 05, 2026


## [Trapping exits so terminate/2 actually runs](https://elixirdrops.net/d/ZFDbvCtx.md)

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

- Author: almirsarajcic
- Created: September 28, 2026


## [Keeping compile_env values out of runtime.exs](https://elixirdrops.net/d/sLV42DYt.md)

`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 noticing:

- Author: almirsarajcic
- Created: September 24, 2026


## [Sorting DateTime lists with Enum.sort/2](https://elixirdrops.net/d/fFwUcmbe.md)

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

- Author: almirsarajcic
- Created: September 23, 2026


## [Setting updated_at yourself in Repo.update_all/3](https://elixirdrops.net/d/eGNMsW1q.md)

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

- Author: almirsarajcic
- Created: September 22, 2026


## [How we use ETS as a live code-graph database in Synapse MCP](https://elixirdrops.net/d/N9Cs6tRB.md)

We have built/building [Synapse MCP](https://synapse-mcp.dev) — a tool that gives AI agents a persistent map of your codebase — and one design question came up early: where does the call graph live?

- Author: spasm-myelixlabs
- Created: September 22, 2026


## [Running doctests against the database](https://elixirdrops.net/d/xemXGQJq.md)

Doctests are straightforward until an example calls `Repo`. A plain ExUnit case doesn't check out an Ecto sandbox connection, so run database-backed doctests through your application's `DataCase`:

- Author: almirsarajcic
- Created: September 21, 2026


## [Keeping Oban's time units explicit](https://elixirdrops.net/d/kz7648Vu.md)

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

- Author: almirsarajcic
- Created: September 20, 2026


## [Catching GenServer.call/3 timeout exits](https://elixirdrops.net/d/zFC2h9WN.md)

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

- Author: almirsarajcic
- Created: September 19, 2026


## [Keeping self() straight in on_exit callbacks](https://elixirdrops.net/d/i4LKDQFf.md)

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

- Author: almirsarajcic
- Created: September 18, 2026


## [Clearing inherited variables in System.cmd](https://elixirdrops.net/d/KpFePAjf.md)

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

- Author: almirsarajcic
- Created: September 17, 2026


## [Running Task.async_stream/3 for side effects](https://elixirdrops.net/d/HjTWfkFL.md)

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

- Author: almirsarajcic
- Created: September 16, 2026


## [Keeping timeouts active while tracing tests](https://elixirdrops.net/d/zBackG2b.md)

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

- Author: almirsarajcic
- Created: September 15, 2026


## [Starting only what a FLAME runner needs](https://elixirdrops.net/d/fjeqAM8C.md)

When FLAME boots a remote runner, it starts your application there, so your application has to decide which supervision children belong on that runner. Here is how ElixirDrops.Application tags each ch...

- Author: almirsarajcic
- Created: September 14, 2026


## [Keeping stale gzip assets out of Phoenix tests](https://elixirdrops.net/d/j1f6rgYb.md)

I spent too long debugging a LiveView hook in ElixirDrops because the browser kept running old JavaScript. The source and freshly built `app.js` were correct.

- Author: almirsarajcic
- Created: September 13, 2026


## [Let ExUnit shut down your test processes](https://elixirdrops.net/d/LgBiUAfo.md)

Start test-owned processes with `start_supervised!/1` so ExUnit waits for them to shut down before running your cleanup callbacks.

- Author: almirsarajcic
- Created: September 12, 2026


## [Put `phx-change` inputs inside a form](https://elixirdrops.net/d/pEqwfUMa.md)

Put every input with its own `phx-change` binding inside a form. Outside one, the markup looks wired, but LiveView will not send the event.

- Author: almirsarajcic
- Created: September 11, 2026


## [Check the exit status from `System.cmd/3`](https://elixirdrops.net/d/6vkWzNYn.md)

Check the exit status when wrapping an external command. A nonzero exit from the program does not make `System.cmd/3` raise.

- Author: almirsarajcic
- Created: September 10, 2026


## [Make `capture_log` assertions test-specific](https://elixirdrops.net/d/3HNPGZjp.md)

Do not assert on generic text in logs captured by async tests.

- Author: almirsarajcic
- Created: September 09, 2026


## [Avoid `File.cd!/2` in async tests](https://elixirdrops.net/d/ZkUiYApD.md)

Do not use `File.cd!/2` to isolate filesystem work in concurrent tests. Its callback looks scoped, but the current working directory belongs to the entire BEAM.

- Author: almirsarajcic
- Created: September 08, 2026


## [Build sequence diffs with List.myers_difference/2](https://elixirdrops.net/d/TQznfG6p.md)

Use `List.myers_difference/2` to turn two sequences into an edit script without adding a diff dependency.

- Author: almirsarajcic
- Created: September 07, 2026


## [Capture warnings with Code.with_diagnostics/2](https://elixirdrops.net/d/N8vneTPL.md)

Use `Code.with_diagnostics/2` when warnings and errors need to become structured data instead of terminal text.

- Author: almirsarajcic
- Created: September 05, 2026


## [Update matching list items with Access.filter/1](https://elixirdrops.net/d/tUruhd8q.md)

Use `Access.filter/1` to update only the list elements that match a predicate, without mapping and rebuilding the surrounding structure yourself.

- Author: almirsarajcic
- Created: September 04, 2026


## [Discard late replies with process aliases](https://elixirdrops.net/d/yhZsXAMa.md)

Send hand-rolled request replies to a process alias, then deactivate the alias when the caller stops waiting.

- Author: almirsarajcic
- Created: September 03, 2026


## [Reject unknown struct keys with struct!/2](https://elixirdrops.net/d/1QBcMjiG.md)

Use `struct!/2` when runtime attributes must contain only fields that belong to the struct.

- Author: almirsarajcic
- Created: September 02, 2026


## [The Module Behind the Curtain](https://elixirdrops.net/d/d8T1X4sN.md)

Use `defdelegate` when a function should simply forward its arguments to another module.

- Author: spapiernik
- Created: September 01, 2026


## [Build strings with iodata, not concatenation](https://elixirdrops.net/d/2XDNkzsc.md)

Building a string by repeatedly `<>`-ing onto an accumulator can be quadratic — but not for the reason most people think. The BEAM has a runtime optimization that lets `acc <> new` grow a binary in pl...

- Author: almirsarajcic
- Created: September 01, 2026


## [Ecto's :utc_datetime silently drops microseconds](https://elixirdrops.net/d/jb2TzQGZ.md)

`:utc_datetime` stores second precision. Hand it a `DateTime.utc_now/0` value — which carries microseconds — and `Ecto.Type.cast/2` truncates it with no warning, no error, nothing in the return value ...

- Author: almirsarajcic
- Created: August 31, 2026


## [get_in/2 needs Access.key!/1 for structs](https://elixirdrops.net/d/TgPNG7nA.md)

`get_in/2`, `put_in/3`, and `update_in/3` walk a path of atom keys through maps and keyword lists just fine — but the same atom path raises on a struct.

- Author: almirsarajcic
- Created: August 30, 2026


## [Decimal `==` is not value equality](https://elixirdrops.net/d/mo82YVG9.md)

`Decimal.new("1.0")` and `Decimal.new("1.00")` represent the same number, but Elixir's `==` says they are different:

- Author: almirsarajcic
- Created: August 29, 2026


## [`dbg/2` shows every step of your pipeline](https://elixirdrops.net/d/DyiMo9nB.md)

Debugging a pipeline usually means breaking it apart with `IO.inspect/2` calls between every stage, labelling each one so you can tell them apart, then deleting them all afterwards. Elixir has shipped...

- Author: almirsarajcic
- Created: August 28, 2026


## [Stop blocking your supervisor in `init/1`](https://elixirdrops.net/d/z1bJQT3c.md)

Every millisecond spent in `init/1` is a millisecond your entire supervision tree is frozen. `start_link/1` does not return until `init/1` does, and the supervisor starts children one at a time — so a...

- Author: almirsarajcic
- Created: August 24, 2026


## [Name dynamic processes with `:via` tuples](https://elixirdrops.net/d/BaQytUDT.md)

The moment you need one process per game, per room, or per upload, the naming problem shows up — and the tempting fix is `String.to_atom("game_#{id}")`. That builds an atom from user input, which is n...

- Author: almirsarajcic
- Created: August 23, 2026


## [`attr` turns component bugs into compile errors](https://elixirdrops.net/d/tEmaCWdG.md)

A function component is just a function taking `assigns`, which means a typo'd or forgotten assign fails the way any missing map key fails: at render time, in production, on whichever page happens to ...

- Author: almirsarajcic
- Created: August 22, 2026


## [`Ecto.Enum` maps atoms to integer columns](https://elixirdrops.net/d/Cog9EhkR.md)

Status columns tend to rot the same way everywhere: an integer in the database, a string in the params, an atom in the business logic, and `String.to_atom/1` calls scattered across three contexts to b...

- Author: almirsarajcic
- Created: August 21, 2026


## [Sub-binaries keep the whole payload in memory](https://elixirdrops.net/d/PsC3WBxR.md)

Slicing a binary in Elixir does not copy it. `binary_part/3` on a 1 MB payload hands you 100 bytes that quietly reference all 1 MB — and the parent cannot be garbage collected while your 100-byte slic...

- Author: almirsarajcic
- Created: August 20, 2026


## [Keep related writes together with `prepare_changes/2`](https://elixirdrops.net/d/bu8mvaGn.md)

If a database write belongs to a changeset operation, `prepare_changes/2` can run it in the same transaction. A common example is updating a counter when a record is inserted.

- Author: almirsarajcic
- Created: August 19, 2026


## [Download/Read Hex Library Doc Offline](https://elixirdrops.net/d/Ptdx93pN.md)

You can use `mix hex.docs fetch ash` to download documentation and read them offline with `mix hex.docs offline ash`.

- Author: mnkhod
- Created: August 18, 2026


## [Give background processes useful labels](https://elixirdrops.net/d/v2u74x6a.md)

PIDs are not much help when several copies of the same worker are running. `Process.set_label/1` adds a term that identifies what each process is doing.

- Author: almirsarajcic
- Created: August 17, 2026


## [Build an Ecto select a field at a time](https://elixirdrops.net/d/bQ8c2V6U.md)

An Ecto query has one `select`, which can make optional query helpers awkward. `select_merge/3` lets each helper add fields to an existing map select.

- Author: almirsarajcic
- Created: August 16, 2026


## [Find wide compile dependencies with `mix xref graph`](https://elixirdrops.net/d/B9qxNc8h.md)

When a small change recompiles a large part of an application, `mix xref graph` can show which file has the widest compile-time reach.

- Author: almirsarajcic
- Created: August 15, 2026


## [Test CLI input and output with `CaptureIO`](https://elixirdrops.net/d/nmQw4hUr.md)

Test terminal behavior through the real IO calls instead of replacing `IO.gets/1` or `IO.write/2` with mocks. `ExUnit.CaptureIO.capture_io/2` supplies stdin, captures stdout, and restores the test pro...

- Author: almirsarajcic
- Created: July 31, 2026


## [`GenServer.call/3` timeout does not cancel work](https://elixirdrops.net/d/n4aGTQYq.md)

Treat the third argument to `GenServer.call/3` as a caller deadline, not a cancellation mechanism. When the deadline expires, the call exits the caller while the GenServer continues processing the req...

- Author: almirsarajcic
- Created: July 29, 2026


## [Let `Task.async_stream/3` emit fast work first](https://elixirdrops.net/d/KiWh4GLy.md)

`Task.async_stream/3` quietly holds fast results behind the earliest slow input because `ordered` defaults to `true`. When independent IO work does not need input order, opt out explicitly and set a b...

- Author: almirsarajcic
- Created: July 28, 2026


## [How LiveView decides what to re-render](https://elixirdrops.net/d/7hB6qX9z.md)

Your LiveView does **not** re-render its template when an assign changes. It re-runs only the *fragments that read an assign that actually changed*, and computes every other fragment to `nil` so it ne...

- Author: almirsarajcic
- Created: July 09, 2026


## [Build a LiveView wizard that remembers every step](https://elixirdrops.net/d/xL7nH81N.md)

Multi-step forms usually break in one of two ways: they lose everything when the user clicks "Back", or they defer all validation to the final submit. Keep the current step and the data collected so f...

- Author: almirsarajcic
- Created: July 02, 2026


## [Schemaless changesets validate forms without the database](https://elixirdrops.net/d/kg3pPtVH.md)

Need to validate form data, preview changes, or validate multi-step workflows without hitting the database? Use schemaless changesets with `Ecto.Changeset.apply_action/2` to get validation errors and ...

- Author: almirsarajcic
- Created: June 26, 2026


## [Stop mounting your LiveView twice](https://elixirdrops.net/d/9mrw2kg3.md)

Every LiveView mounts **twice** on first page load — once for the static HTTP "dead render," then again when the WebSocket connects. If `mount/3` loads data unconditionally, you run that query, hit th...

- Author: almirsarajcic
- Created: June 23, 2026


## [`:persistent_term` outperforms ETS for static data](https://elixirdrops.net/d/pyxqzbGX.md)

ETS is the default for shared lookups, but for read-only data that never changes at runtime it does work you don't need: every read copies the term out of the table and takes a lock. `:persistent_term...

- Author: almirsarajcic
- Created: June 08, 2026


## [Speed up CI with parallel ExUnit partitions](https://elixirdrops.net/d/9yfNCu2j.md)

Running your full test suite sequentially in CI is wasted time. ExUnit has built-in support for partitioning — split your suite into N slices and run them in parallel, each in its own process.

- Author: almirsarajcic
- Created: May 27, 2026


## [`assign_new/3` prevents expensive recomputations in LiveView](https://elixirdrops.net/d/aDFdrUhK.md)

Calling `assign/2` recalculates values every time the socket updates, even if the data hasn't changed. Use `assign_new/3` to compute expensive operations only once and preserve them across LiveView up...

- Author: almirsarajcic
- Created: May 20, 2026


## [`Req.Test` stubs keep HTTP out of your tests](https://elixirdrops.net/d/jTokrLpB.md)

`Req` ships with a built-in test stub mechanism. No Bypass, no Mox, no additional dependencies — just three small changes and your HTTP calls never hit the network in tests.

- Author: almirsarajcic
- Created: May 13, 2026


## [Chain failable operations cleanly with `with`](https://elixirdrops.net/d/R1gkGfji.md)

Nested `case` statements for operations that can fail look neat at first — until you need three of them. `with` lets you sequence failable operations and handle every failure path in one place, withou...

- Author: almirsarajcic
- Created: May 06, 2026


## [Split async and sync tests in one file](https://elixirdrops.net/d/TNYqKsbv.md)

Marking a test module `async: false` serializes every test inside it. If only two tests genuinely need it — because they touch a globally-named `Task.Supervisor` or a singleton GenServer — the other t...

- Author: almirsarajcic
- Created: April 29, 2026


## [optimum_credo v0.4.0](https://elixirdrops.net/d/pVw8Kzby.md)

We've moved to almost fully autonomous AI-driven development and rely less on human code review. We're pushing more into Credo — mechanical rules that catch low-quality patterns deterministically, wit...

- Author: almirsarajcic
- Created: April 29, 2026


## [Override config in async tests](https://elixirdrops.net/d/6yRZohAb.md)

`Application.put_env/3` in tests mutates global state. Two concurrent tests overwriting the same key will race — the restore in `on_exit` runs after the other test already read the wrong value. The us...

- Author: almirsarajcic
- Created: April 22, 2026


## [`Phoenix.Token` beyond `mix phx.gen.auth`](https://elixirdrops.net/d/tx1mHVTh.md)

If you've used `mix phx.gen.auth`, you've already seen `Phoenix.Token` at work — it's what powers the email verification and password reset links in the generated code. But most developers never reach...

- Author: almirsarajcic
- Created: April 15, 2026


## [Chain failable operations cleanly with `with`](https://elixirdrops.net/d/yHJXeY2A.md)

Nested `case` statements for operations that can fail look neat at first — until you need three of them. `with` lets you sequence failable operations and handle every failure path in one place, withou...

- Author: almirsarajcic
- Created: April 08, 2026


## [`Repo.stream/2` processes database results without loading all rows](https://elixirdrops.net/d/gXQsr2qo.md)

Exporting a million database rows? `Repo.all/2` loads everything into memory first. `Repo.stream/2` uses database cursors to fetch rows in batches, keeping memory constant regardless of result size.

- Author: almirsarajcic
- Created: April 01, 2026


## [optimum_credo v0.3.0](https://elixirdrops.net/d/EXnpte3Z.md)

optimum_credo version 0.3.0 was released.

- Author: almirsarajcic
- Created: March 31, 2026


## [Pause an Oban job with `{:snooze, seconds}`](https://elixirdrops.net/d/QiNjMD2p.md)

Sometimes a job isn't ready to run yet — a third-party API is rate-limiting you, a resource hasn't been created, or you just need to wait a few minutes before retrying. Returning `{:snooze, seconds}` ...

- Author: almirsarajcic
- Created: March 25, 2026


## [Use `Integer.parse/1` for params, not `String.to_integer/1`](https://elixirdrops.net/d/3FNfK2Q6.md)

Phoenix does zero automatic type coercion. Every value in `params` arrives as a string — or not at all. Reaching for `String.to_integer/1` on user-supplied params is a crash waiting to happen in two d...

- Author: almirsarajcic
- Created: March 18, 2026


## [github_workflows_generator v0.1.4](https://elixirdrops.net/d/U9bXCD7Q.md)

github_workflows_generator version 0.1.4 was released with escript support, making it usable in projects without mix.

- Author: almirsarajcic
- Created: March 17, 2026


## [optimum_credo v0.2.0](https://elixirdrops.net/d/3mFvxuhp.md)

We added 6 new Credo checks to optimum_credo: unused types, private function specs, verbose nil assertions, extractable spec types, module organization, and documentation formatting.

- Author: almirsarajcic
- Created: March 13, 2026


## [Structure context tests with `describe` blocks](https://elixirdrops.net/d/wY7TeKHm.md)

Phoenix context test files grow fast. A single `accounts_test.exs` can easily reach 300+ lines, and without structure it becomes hard to find tests, spot missing coverage, or understand what a functio...

- Author: almirsarajcic
- Created: March 11, 2026


## [`Phoenix.LiveView.JS` for client-side interactions](https://elixirdrops.net/d/qrwJWtkg.md)

Not every click needs a server roundtrip. Toggling a dropdown, showing a modal, or hiding a deleted item are all pure UI operations — but they're often implemented with `handle_event/3` and a socket a...

- Author: almirsarajcic
- Created: March 04, 2026


## [`Oban.insert_all/1` doesn't enforce unique job constraints unless you're on the pro license](https://elixirdrops.net/d/ouwihTr7.md)

Configured unique constraints on your Oban worker but still seeing duplicate jobs when using bulk inserts? The Basic engine only enforces uniqueness with `Oban.insert/2`, not `insert_all/1`.

- Author: amos-kibet
- Created: January 30, 2026


## [Mix.env() doesn't work in releases](https://elixirdrops.net/d/TRjMZGwf.md)

`Mix.env()` doesn't exist in production releases. Your conditional routes will silently fail, and you won't know until deployment. Use `Application.compile_env/2` instead.

- Author: almirsarajcic
- Created: January 07, 2026


## [Add query params to Phoenix verified routes with `~p`](https://elixirdrops.net/d/Up8FbgDN.md)

Phoenix verified routes handle query parameters with the same `~p` sigil you use for paths. Pass a map or keyword list after `?#{}` and get compile-time verification plus automatic URL encoding.

- Author: almirsarajcic
- Created: December 31, 2025


## [`defguard` creates reusable guard expressions](https://elixirdrops.net/d/CJv97pHE.md)

Repeating the same guard logic across multiple functions? Define it once with `defguard` and use it everywhere - in function heads, `case`, `cond`, and `with` clauses.

- Author: almirsarajcic
- Created: December 24, 2025


## [`tap/2` runs side effects in pipelines](https://elixirdrops.net/d/vcnU82L4.md)

Need to log, send a message, or cache a value mid-pipeline without breaking the flow? `tap/2` executes a function for its side effect, ignores the return value, and passes the original input through u...

- Author: almirsarajcic
- Created: December 17, 2025


## [Use `Ecto.Multi` for complex transactions in Phoenix contexts](https://elixirdrops.net/d/NfbMUJPX.md)

Manual transaction management with nested operations becomes unreadable and error-prone. `Ecto.Multi` provides named operations, automatic rollback, and clear transaction composition.

- Author: almirsarajcic
- Created: December 10, 2025


## [Live Sessions in Phoenix LiveView: Reducing navigation time between LiveViews](https://elixirdrops.net/d/RfXrKiFs.md)

The **main** idea behind **live sessions** is to reduce navigation time when navigating a group of routes. Normally what happens when navigating between LiveViews is a HTTP request gets sent to the se...

- Author: Deankinyua
- Created: December 09, 2025


## [`File.stream!/1` processes large files with constant memory](https://elixirdrops.net/d/V6BducLZ.md)

`File.read!/1` loads the entire file into memory. A 2GB log file? That's 2GB of RAM. Use `File.stream!/1` to process files line-by-line with constant memory usage, regardless of file size.

- Author: almirsarajcic
- Created: December 03, 2025


## [Stop using `Repo.preload` in loops - use `preload` in queries](https://elixirdrops.net/d/NWta3KyP.md)

Calling `Repo.preload/2` inside `Enum.map` or comprehensions creates N+1 queries - one query to fetch the parent records, then **one additional query for each parent** to load associations. Use Ecto's...

- Author: almirsarajcic
- Created: November 26, 2025


## [Use `Task.Supervisor` instead of bare `Task.async`](https://elixirdrops.net/d/sxEpwcGD.md)

Bare `Task.async` creates linked tasks that can crash your process or leave zombie tasks running. `Task.Supervisor` provides supervised tasks with automatic cleanup and proper error isolation.

- Author: almirsarajcic
- Created: November 19, 2025


## [Prevent race conditions with `Ecto.Query.lock/2`](https://elixirdrops.net/d/ZatqbwR2.md)

Two users buying the last item simultaneously can cause overselling. Use PostgreSQL row locks with `lock: "FOR UPDATE"` to prevent concurrent updates from reading stale data.

- Author: almirsarajcic
- Created: November 12, 2025


## [Use `temporary_assigns` for large lists in LiveView](https://elixirdrops.net/d/ryZidobn.md)

Sending entire lists over the socket on every LiveView update kills performance. Mark list assigns as temporary to send them once and drop them from socket state.

- Author: almirsarajcic
- Created: November 05, 2025


## [Use `send_update_after/4` for delayed LiveComponent updates](https://elixirdrops.net/d/2jPRUep6.md)

Manual timer management with `Process.send_after/3` in LiveComponents creates cleanup complexity. LiveView's `send_update_after/4` handles delayed updates automatically without timer tracking.

- Author: almirsarajcic
- Created: October 29, 2025


## [Use router `on_mount` hooks instead of duplicating LiveView mount logic](https://elixirdrops.net/d/6itDTwdu.md)

Copy-pasting the same assigns across every LiveView `mount/3` function creates maintenance nightmares. Router-level `on_mount` hooks run automatically before mount, eliminating duplication.

- Author: almirsarajcic
- Created: October 22, 2025


## [Stop mixing LiveView handlers with JavaScript hooks](https://elixirdrops.net/d/bGXjC2aT.md)

Handling the same event in both Phoenix and JavaScript creates race conditions and unpredictable behavior. Keep server logic in LiveView handlers and client-only interactions in JavaScript hooks.

- Author: almirsarajcic
- Created: October 15, 2025


## [The amazing v/1 helper function](https://elixirdrops.net/d/36hmFpeY.md)

I may be late on this one but today I learned about the v/1, a helper function that retrieves the value from a previous expression by its line number during an iex session.

- Author: jrowah
- Created: October 09, 2025


## [Phoenix contexts should return tuples, not raise](https://elixirdrops.net/d/1rFRUHfi.md)

Phoenix context functions that raise exceptions break LiveView error handling and force try/catch everywhere. Tagged tuples enable composable error handling with `with` statements and seamless form va...

- Author: almirsarajcic
- Created: October 08, 2025


## [Prevent duplicate Oban jobs with `unique` worker options](https://elixirdrops.net/d/HJwTCNgx.md)

Multiple button clicks or retries can enqueue the same background job multiple times, causing duplicate charges, emails, or API calls. Oban's built-in uniqueness prevents this without custom deduplica...

- Author: almirsarajcic
- Created: October 01, 2025


## [Stop rewriting Ecto queries from scratch - use `Ecto.Query.exclude/2` instead](https://elixirdrops.net/d/fDzU4NBm.md)

Building complex queries often means starting with a base query, then customizing it for different use cases. Most developers duplicate the entire query logic instead of using Ecto's built-in composit...

- Author: almirsarajcic
- Created: September 24, 2025


## [Fixing `Ecto.StaleEntryError` with optimistic locking patterns](https://elixirdrops.net/d/wWhPe3of.md)

Race conditions in concurrent updates cause cryptic `Ecto.StaleEntryError` crashes in production. The error happens when multiple processes try to update the same record simultaneously, leaving your u...

- Author: almirsarajcic
- Created: September 17, 2025


## [Phoenix application configuration](https://elixirdrops.net/d/sVEe4K3Y.md)

The config folder plays a pivotal role in any phoenix application. Its constituents are normally `config.exs`, `dev.exs`, `prod.exs`, `runtime.exs` and `test.exs`. But what is the purpose of these fil...

- Author: Deankinyua
- Created: September 16, 2025


## [Hunting down flaky tests with `--repeat-until-failure`](https://elixirdrops.net/d/WqiRtfHm.md)

Nothing destroys developer confidence like tests that randomly fail in CI. One day your build is green, the next it's red with the exact same code. The culprit? Flaky tests that pass locally but fail ...

- Author: almirsarajcic
- Created: September 10, 2025


## [Impelementing Infinite Scroll in Phoenix](https://elixirdrops.net/d/VjJfY2AM.md)

Infinite scroll is a listing-page design approach seen a lot on widely used apps such as TikTok and Instagram to keep the user engaged, loading additional content as the user scrolls down the page. On...

- Author: Deankinyua
- Created: September 08, 2025


## [Preventing atom exhaustion attacks with `String.to_existing_atom`](https://elixirdrops.net/d/qCts7drU.md)

Using `String.to_atom/1` on user input is a critical security vulnerability that can crash your entire BEAM VM through atom exhaustion. Here are two approaches to safely convert user input to atoms - ...

- Author: almirsarajcic
- Created: September 03, 2025


## [Executing OS processes using Elixir Ports](https://elixirdrops.net/d/gXpE1Tmy.md)

**Ports** in Elixir provide us an interface for communicating with external processes by sending and receiving messages. They make it easy to start and manage OS processes. You might have some bit of ...

- Author: Deankinyua
- Created: August 29, 2025


## [Speed up Phoenix with ETS content caching and TTL expiration](https://elixirdrops.net/d/3tT7zprm.md)

Database queries for content-heavy pages become performance bottlenecks fast. Redis adds infrastructure complexity. ETS gives you microsecond lookups built into the BEAM.

- Author: almirsarajcic
- Created: August 27, 2025


## [Fine tuning routing for a better UX](https://elixirdrops.net/d/F8gyYsR9.md)

Phoenix gives you a very cool and easier way to fine tune your routing and be able to effectively handle cases where, say a user has a typo in the url whenever they, for some reason, might have to man...

- Author: jrowah
- Created: August 27, 2025


## [Verifying Replicate Signatures](https://elixirdrops.net/d/8GfrPigb.md)

**Replicate** is a platform for running AI models without having to worry about setting up infrastructure. A more simple definition would be "The Cloud but for AI". There are a couple of advantages to...

- Author: Deankinyua
- Created: August 21, 2025


## [Using `@impl Phoenix.LiveView` instead of `@impl true` for clear callback contracts](https://elixirdrops.net/d/89DNGrL1.md)

Stop using `@impl true` in your Phoenix modules. The Elixir compiler provides much better safety and clarity when you specify the exact behaviour module name.

- Author: almirsarajcic
- Created: August 20, 2025


## [Sandbox modes in Ecto Testing](https://elixirdrops.net/d/iyUsn9AL.md)

A **sandbox** is an isolated testing environment that enables users to run programs or open files without affecting the application, system or platform on which they run. Ecto provides a sandbox that ...

- Author: Deankinyua
- Created: August 13, 2025


## [Pass arguments to Mix aliases with anonymous functions](https://elixirdrops.net/d/j1AECUTn.md)

Need to pass command-line arguments to your Mix aliases? Use anonymous functions instead of strings to capture and forward arguments.

- Author: almirsarajcic
- Created: August 13, 2025


## [Extracting repeated type specs to module-level `@type` declarations](https://elixirdrops.net/d/Y7gc9RzP.md)

Tired of Dialyzer warnings and repetitive type declarations? Clean up your specs by extracting repeated types to the module level. Your code becomes more readable and type changes only need updating i...

- Author: almirsarajcic
- Created: August 06, 2025


## [Debugging GenServer state with `:sys.get_state`](https://elixirdrops.net/d/CTsjphav.md)

Ever wondered what's actually inside your GenServer's state when things go wrong? Instead of adding debug prints or crashing the process, you can peek inside any running GenServer with Elixir's built-...

- Author: almirsarajcic
- Created: July 30, 2025


## [Asynchronous operations in Phoenix LiveView](https://elixirdrops.net/d/scyQgJ8z.md)

What do you understand by the term **"Expensive Computations"**? Theoretical computer science defines them as the ones taking the most memory and time to complete. If this is the case, then executing ...

- Author: Deankinyua
- Created: July 28, 2025


## [Inline CSS in Phoenix email templates](https://elixirdrops.net/d/bCPasvRK.md)

Most email clients don't support linked stylesheets, so you need to inline CSS for proper email rendering. Instead of manually copying styles or using external tools, you can automate this in Phoenix.

- Author: almirsarajcic
- Created: July 23, 2025


## [Pattern matching on Bitstrings](https://elixirdrops.net/d/Dqjau4Lx.md)

Assume that you have a long string of text that you want to display to the user. You want to display a maximum of 60 characters and add an ellipsis **if and only if** the text was longer than 60 chara...

- Author: Deankinyua
- Created: July 18, 2025


## [Fixing Wallaby's "Invalid Session ID" Error](https://elixirdrops.net/d/coFbH4d3.md)

When running Wallaby integration tests in your Phoenix application, you might encounter this cryptic error:

- Author: almirsarajcic
- Created: July 16, 2025


## [Using the "Use" Elixir Macro](https://elixirdrops.net/d/DXwfbtUP.md)

Suppose you have the following module directives in your current module: 

- Author: Deankinyua
- Created: July 15, 2025


## [Offset-based pagination in Elixir](https://elixirdrops.net/d/n3ZcYLdV.md)

**Pagination** is a technique used to break a large dataset into manageable “pages” (chunks) of results. It’s essential for:

- Author: Deankinyua
- Created: July 15, 2025


## [Testing Oban Workers](https://elixirdrops.net/d/oZjxdXQw.md)

**Background processing** refers to the execution of tasks as separate, detached processes. [Oban](https://hexdocs.pm/oban/Oban.html) is a robust background job framework that is widely used in Elixir...

- Author: Deankinyua
- Created: July 10, 2025


## [Reproducing failed CI tests locally with seeds](https://elixirdrops.net/d/NYvBntWe.md)

When tests fail in CI, you can use the test seed to reproduce the exact same test run locally. This is especially useful for debugging flaky tests or race conditions.

- Author: almirsarajcic
- Created: July 09, 2025


## [Creating and hosting sitemaps in Elixir/Phoenix](https://elixirdrops.net/d/ft2TXVnE.md)

Recently, we implemented sitemap generation for ElixirDrops, so I thought I'd share our approach.

- Author: almirsarajcic
- Created: July 02, 2025


## [Ecto fragments for complex queries](https://elixirdrops.net/d/Px8Dmd4s.md)

Sometimes when writing Ecto queries, you might discover that the conventional approach doesn't quite cut it. This is where **fragments** come in, which are a way to inject raw SQL into queries. Consid...

- Author: Deankinyua
- Created: July 01, 2025


## [Capturing Logs in Tests](https://elixirdrops.net/d/TNRi48U3.md)

Sometimes when you writing functions that may produce errors, you might want to log the error in the terminal : 

- Author: Deankinyua
- Created: June 26, 2025


## [Temporarily changing app config in tests](https://elixirdrops.net/d/qcreJkWo.md)

When testing functionality that depends on application configuration, you can temporarily set specific config values and ensure they're restored afterward.

- Author: almirsarajcic
- Created: June 25, 2025


## [Multi-process collaboration in Mox](https://elixirdrops.net/d/hv1t8jJk.md)

Mox enforces **process-based verification**, meaning only the process that defines expectations is **allowed** to call the mock by default. This can prove problematic when you are executing code that ...

- Author: Deankinyua
- Created: June 23, 2025


## [Gracefully handle 404s and other errors in Phoenix using Plug.ErrorHandler](https://elixirdrops.net/d/2JGs3zQB.md)

Instead of letting your Phoenix app crash with ugly errors, add this clean error handler:

- Author: amos-kibet
- Created: June 20, 2025


## [Cleaning up after tests (on_exit)](https://elixirdrops.net/d/bt3DmgNK.md)

When your tests create files, database records, or other side effects, you need to clean them up regardless of whether the test passes or fails.

- Author: almirsarajcic
- Created: June 18, 2025


## [Auto-disappearing flash messages in Phoenix LiveView](https://elixirdrops.net/d/jeEyHWzd.md)

Use this LiveView hook to make flash messages automatically disappear after 5 seconds in your Phoenix app.

- Author: almirsarajcic
- Created: June 11, 2025


## [Enhanced missing gettext translations check in CI](https://elixirdrops.net/d/hLBYETku.md)

Earlier I wrote about a check for strings that haven't been extracted yet to .pot and .po gettext files ([link](https://elixirdrops.net/d/xbrNPY7k)).

- Author: almirsarajcic
- Created: June 04, 2025


## [Using Playwright MCP in Cursor](https://elixirdrops.net/d/mWhiu3Kp.md)

Building Phoenix LiveViews and want to see how they actually work in a real browser? Playwright MCP in Cursor lets your AI agent check your features as you build them.

- Author: almirsarajcic
- Created: May 28, 2025


## [Improving code coverage with AI agents](https://elixirdrops.net/d/hXo9fgcq.md)

Did you know AI agents can even help you with code coverage? Maybe you wanted to figure out all the scenarios you haven't covered in your tests. That's one of my favorite use cases for them, relieving...

- Author: almirsarajcic
- Created: May 21, 2025


## [optimum_gen_infra v0.2.0](https://elixirdrops.net/d/tKiW18hc.md)

optimum_gen_infra version 0.2.0 was released.

- Author: almirsarajcic
- Created: May 14, 2025


## [Optimum Credo checks](https://elixirdrops.net/d/AsEtmHUq.md)

During code reviews, we've noticed some patterns emerge. To avoid wasting time and attention on these pesky details, we started using Credo in all our projects.

- Author: almirsarajcic
- Created: May 13, 2025


## [Cursor rules for Elixir and Phoenix app development](https://elixirdrops.net/d/29oQ4Tub.md)

We've been experimenting with vibe-coding using Cursor and Claude for a while now, and noticed some of its shortcomings. Sometimes we've had to make some instructions explicit, so we've codified these...

- Author: almirsarajcic
- Created: May 12, 2025


## [Using Tidewave with new MCP Proxy (Rust)](https://elixirdrops.net/d/UAo4BtYi.md)

[Elixir MCP Proxy](https://elixirdrops.net/d/uX3gTNPJ) has been deprecated, and it's time to switch to the Rust one.

- Author: almirsarajcic
- Created: May 08, 2025


## [Custom Phoenix generator templates](https://elixirdrops.net/d/6UJjiKBt.md)

Suppose you have strict Credo rules in your app. After running Phoenix generators like mix phx.gen.live, you probably have to fix many code style issues before moving on. That's because the default Ph...

- Author: almirsarajcic
- Created: May 07, 2025


## [Code quality checks for AI code generation in Elixir apps](https://elixirdrops.net/d/3LnaH8UV.md)

Good code checks are more important than ever, especially as AI code generation tools increasingly rely on them to verify generated code.

- Author: almirsarajcic
- Created: May 02, 2025


## [Using Tidewave with MCP proxy (deprecated)](https://elixirdrops.net/d/uX3gTNPJ.md)

DEPRECATED: use the new MCP Proxy written in Rust: https://elixirdrops.net/d/UAo4BtYi.

- Author: almirsarajcic
- Created: May 01, 2025


## [Setting up Tidewave in your Phoenix app](https://elixirdrops.net/d/GBHvQwrC.md)

If you're reading this, you're ready to ride this wave of coding using AI agents. Just follow these simple instructions and you'll be more productive in no time.

- Author: almirsarajcic
- Created: April 30, 2025


## [optimum_gen_infra v0.1.5](https://elixirdrops.net/d/eGsr4PpK.md)

optimum_gen_infra version 0.1.5 was released.

- Author: almirsarajcic
- Created: April 23, 2025


## [Accessing localhost app on other devices in the same network for testing.](https://elixirdrops.net/d/qgW2zv1B.md)

Today I found a solution to a problem I had, but then the solution came with a whole new development experience I did not have in mind. Initially, I had to switch from one machine to the other as one ...

- Author: jrowah
- Created: April 21, 2025


## [Executing scripts inside Elixir releases](https://elixirdrops.net/d/NfwUp7HW.md)

Inside the default runner Docker image provided by Phoenix Elixir is not available, so we can't execute something like `elixir priv/script.exs`. But we can load the file using `Code.load_file/1`.

- Author: almirsarajcic
- Created: April 16, 2025


## [Uploading files to the cloud (s3 compatible)](https://elixirdrops.net/d/auRTockr.md)

As profile images have become a standard in web applications, implementing this feature has become increasingly important. After a user fills in their user name, they are encouraged to share a picture...

- Author: Deankinyua
- Created: April 09, 2025


## [Enabling history in the Elixir's Interactive Shell (IEx)](https://elixirdrops.net/d/hFpnyxqw.md)

Do you miss your favorite shell's ability to remember commands you executed in the last shell session when using IEx? When you just start `iex` and press the up arrow, nothing happens. Well, you can f...

- Author: almirsarajcic
- Created: April 09, 2025


## [Handling Mux Video Uploads in LiveView with Process Messaging](https://elixirdrops.net/d/mzqbvchf.md)

I recently faced a challenge where multiple users needed to upload video files as part of a form submission. We integrated Mux to handle these uploads and had to ensure that the form data was updated ...

- Author: kagure-nyakio
- Created: April 02, 2025


## [Waiting on results of Replicate predictions using webhooks](https://elixirdrops.net/d/hHu8NZb6.md)

Have you spent days figuring out how to package a regular Phoenix app with CUDA drivers and keep the Docker image reasonably sized? No? So it was just me?

- Author: almirsarajcic
- Created: April 02, 2025


## [Running multiple LLMs in Elixir as part of multiple FLAME pools](https://elixirdrops.net/d/EJ6UszeF.md)

Did you know you could run multiple FLAME pools, each running a different set of processes?

- Author: almirsarajcic
- Created: March 26, 2025


## [Providing HTML for Swoosh emails](https://elixirdrops.net/d/cAEY4pnm.md)

Phoenix comes out of the box with an email library called Swoosh. The user authentication generator creates a `UserNotifier`, which provides default emails, but only with plain text. If you want to in...

- Author: almirsarajcic
- Created: March 19, 2025


## [Simplify Pattern Matching with Map Updates](https://elixirdrops.net/d/VkuDdEtU.md)

Imagine you have a nested map structure representing a user with preferences:

- Author: jrowah
- Created: March 17, 2025


## [Memoization in Elixir](https://elixirdrops.net/d/WfCZeAod.md)

Coming to Elixir from Ruby, you probably miss wonderful memoization syntax:

- Author: almirsarajcic
- Created: March 12, 2025


## [Separate layouts for different parts of the app](https://elixirdrops.net/d/uUaiLnb9.md)

Your Phoenix app might have distinct parts of the frontend that don't share too much Javascript or CSS code. You don't want your users to download huge CSS and JS bundles for parts of the app they may...

- Author: almirsarajcic
- Created: March 05, 2025


## [Checking for missing gettext translations in CI](https://elixirdrops.net/d/xbrNPY7k.md)

Are you doing i18n of your Elixir app? How do you know whether all the strings you've predetermined for i18n have translations in all the languages you support?

- Author: almirsarajcic
- Created: February 26, 2025


## [Generating multiple test cases from a single test in Elixir using a for-comprehension!](https://elixirdrops.net/d/YLeyKC1U.md)

🧪 TIL: You can generate multiple test cases from a single test in Elixir using a for-comprehension! Super clean way to test similar scenarios.

- Author: amos-kibet
- Created: February 24, 2025


## [Working with ports](https://elixirdrops.net/d/qaEGFMDL.md)

Sometimes you need to find out which ports you have open, find a process listening on a specific port, or even kill the process. Here's how.

- Author: almirsarajcic
- Created: February 19, 2025


## [Using obfuscated production data locally](https://elixirdrops.net/d/cP2TtEAD.md)

You might have a bug in production that you can't replicate with an empty database, or you might want to do load testing with greater amounts of data, so you want to use the production data locally or...

- Author: almirsarajcic
- Created: February 12, 2025


## [Backing up Fly.io PostgreSQL DB with a one-liner](https://elixirdrops.net/d/pWj1KYfx.md)

Fly.io is in the process of turning their PostgreSQL DB offering into a managed database which might mean they'll have automated backups.

- Author: almirsarajcic
- Created: February 05, 2025


## [Starting child processes depending on the environment](https://elixirdrops.net/d/o1JHzjrs.md)

Sometimes, you don't want to run every part of your Elixir application in all Mix environments.  

- Author: almirsarajcic
- Created: January 29, 2025


## [Pluralization using Gettext in Elixir.](https://elixirdrops.net/d/NWGZxiJo.md)

I was previously using this to pluralise, 

- Author: jrowah
- Created: January 23, 2025


## [Checking the Mix environment in your Elixir app](https://elixirdrops.net/d/2KpcFEAG.md)

In your Elixir app, you might want to run some code conditionally, depending on the Mix environment, using `Mix.env()`.

- Author: almirsarajcic
- Created: January 22, 2025


## [Debugging assigns](https://elixirdrops.net/d/TP8UHbis.md)

How I quickly debug assigns inside heex templates

- Author: jrowah
- Created: January 16, 2025


## [openssl deprecation fix in Phx.tools](https://elixirdrops.net/d/UqKCzHtX.md)

(Not so) recently, openssl version 1.1 was disabled in Homebrew, so Phx.tools installation started failing.

- Author: almirsarajcic
- Created: January 15, 2025


## [Adding binary id to phoenix apps](https://elixirdrops.net/d/eUNm1VfG.md)

When generating a new phoenix application, you can pass the _--binary-id_ flag to get uuids. However, it is possible to forget this and when you do you can add this using two routes, one is longer whe...

- Author: jrowah
- Created: January 14, 2025


## [Sending a file to the user](https://elixirdrops.net/d/pHTz9g4n.md)

Sending a file to the user is easy. Use the `send_download/3` function in your Phoenix controller action like this.

- Author: almirsarajcic
- Created: January 08, 2025


## [Phx.tools updates following Elixir 1.18 release](https://elixirdrops.net/d/ghK7udCj.md)

Following the recent release of Elixir 1.18 and subsequent 1.18.1, we’ve updated Phx.tools.

- Author: almirsarajcic
- Created: January 01, 2025


## [optimum_gen_infra v0.1.4](https://elixirdrops.net/d/Etz2fMBY.md)

optimum_gen_infra version 0.1.4 was released.

- Author: almirsarajcic
- Created: December 20, 2024


## [Show relative time like GitHub](https://elixirdrops.net/d/iTobNHP9.md)

Yesterday, I wrote about using Timex to display relative time (https://elixirdrops.net/d/dkwi9Whb). While looking at how GitHub handles this, I discovered they have open-sourced their approach.

- Author: almirsarajcic
- Created: December 19, 2024


## [Showing relative time in HEEX using Timex](https://elixirdrops.net/d/dkwi9Whb.md)

Here's how to show when a record was created relative to the current time, e.g. "3 minutes ago".

- Author: almirsarajcic
- Created: December 18, 2024


## [Show the time in user's timezone in Phoenix LiveView](https://elixirdrops.net/d/mpUDT97i.md)

Here’s an easy way to shift the time/date to the user’s timezone in Phoenix LiveView without introducing new controls in the UI.

- Author: almirsarajcic
- Created: December 17, 2024


## [Upgrading Phoenix - the OCD approach](https://elixirdrops.net/d/XfLB8Uvp.md)

After reviewing the Phoenix upgrade guide, you want to ensure you've covered all the changes. You can use HexDiff and change the files yourself, but there's an easier way to do it.

- Author: almirsarajcic
- Created: December 16, 2024


## [Simple health check for Phoenix apps](https://elixirdrops.net/d/xHqG1Wb4.md)

When deploying a Phoenix app, you want to make sure your app works: the server is started, and the app is connected to the database.

- Author: almirsarajcic
- Created: December 13, 2024


## [Reducing diff noise from Gettext translation files](https://elixirdrops.net/d/PCW1fcsh.md)

If you've been using Gettext in your Elixir application, you quickly realized most of the diff in your PRs comes down to .po and .pot files because of all the references to strings in your app. These ...

- Author: almirsarajcic
- Created: December 12, 2024


## [Reserved names for new Phoenix apps](https://elixirdrops.net/d/4dQh76Ry.md)

Did you know there are some words you can't use as your Phoenix app name?  

- Author: almirsarajcic
- Created: December 11, 2024


## [Facilitating Phoenix upgrade process](https://elixirdrops.net/d/1FiGMKad.md)

Usually, when I upgrade apps to newer versions of Phoenix, I regenerate the app to ensure I get all the goodies.  

- Author: almirsarajcic
- Created: December 10, 2024


## [Limiting IO.inspect/2 output](https://elixirdrops.net/d/Rh6f4W9N.md)

Are you using the function `IO.inspect/2` for debugging? Are you getting overwhelmed with the outputs of large structs?

- Author: almirsarajcic
- Created: December 09, 2024


## [Phx.tools updates following Phoenix LiveView 1.0 release](https://elixirdrops.net/d/TYtJeLzi.md)

Following the recent release of Phoenix LiveView 1.0, a major milestone for the Elixir and Phoenix ecosystem, we've updated Phx.tools.

- Author: almirsarajcic
- Created: December 06, 2024


## [Running seeds in production](https://elixirdrops.net/d/NcURkjhe.md)

If you're deploying apps using Elixir releases and Docker containers, you've noticed Mix is not available, so you can't run any mix tasks. Running `mix phx.gen.release` helps with the migrations, but ...

- Author: almirsarajcic
- Created: December 05, 2024


## [Optimizing Elixir CI in GitHub Actions](https://elixirdrops.net/d/dWeZKPbj.md)

The Official GitHub Actions documentation suggests using the .lock file hash as the cache key, which makes the cache stale and the whole workflow slows down after some time.

- Author: almirsarajcic
- Created: December 04, 2024


## [Including dot files in the hex package archive](https://elixirdrops.net/d/UC7MuG6z.md)

There is a flag you can pass to the `mix archive.build` command to include dot ("hidden") files in your archive: `--include-dot-files`. The problem is, `hex.build` command doesn't support that flag.

- Author: almirsarajcic
- Created: December 03, 2024


## [optimum_gen_infra v0.1.3](https://elixirdrops.net/d/bKsrg4ah.md)

optimum_gen_infra version 0.1.3 was released.

- Author: almirsarajcic
- Created: December 02, 2024


## [Fixing slow caching in GitHub Actions](https://elixirdrops.net/d/AiTN6BcH.md)

A bug in GitHub Actions recently started causing saving cache to slow down the whole workflow. Separating cache into restore and save steps fixes it.

- Author: almirsarajcic
- Created: November 29, 2024


## [Fixing cross-platform Docker image build issue on Apple Silicon](https://elixirdrops.net/d/LZok4MGb.md)

If you're using an Apple Silicon processor and have an issue building a Docker image using `--platform linux/amd64` flag, you can fix it by adding the following line to your `Dockerfile`.

- Author: almirsarajcic
- Created: November 28, 2024


## [Using npm dependencies in Phoenix apps](https://elixirdrops.net/d/7paEUio9.md)

Adding npm dependencies to Phoenix apps is easy.  

- Author: almirsarajcic
- Created: November 27, 2024


## [Ignoring digested assets by git and Docker](https://elixirdrops.net/d/9GzAeXJx.md)

If you're testing releases locally with `MIX_ENV=prod`, you might notice git and Docker don't ignore your digested assets.

- Author: almirsarajcic
- Created: November 26, 2024


## [Phx.tools updates](https://elixirdrops.net/d/iQPFeamu.md)

A new version of the Phx.tools was released.

- Author: almirsarajcic
- Created: November 25, 2024


## [Streamlined Phx.tools installation](https://elixirdrops.net/d/Ff4UC3Gi.md)

Installing Erlang, Elixir, PostgreSQL, and Phoenix just got simpler.

- Author: almirsarajcic
- Created: November 22, 2024


## [Testing DateTime Equality in Elixir Tests](https://elixirdrops.net/d/Hzmr6L4P.md)

Ever run into flaky tests when comparing timestamps? Here's a common scenario:

- Author: amos-kibet
- Created: November 22, 2024


## [Purging Bumblebee AI models cache](https://elixirdrops.net/d/DXdTt8jw.md)

If you've experimented with Bumblebee your disk space is probably almost filled up. To free it, you can remove all AI models you've downloaded by running the following code in a Livebook or `iex`

- Author: almirsarajcic
- Created: November 21, 2024


## [Running your own Hex server](https://elixirdrops.net/d/76p8yUzx.md)

Whatever the reason, you might want to run your local Hex server and install a dependency that way. Here's a quick way to do it.

- Author: almirsarajcic
- Created: November 20, 2024


## [Deleting branches already merged to main](https://elixirdrops.net/d/3MvWzupb.md)

If you've been working on an app for a while, you probably have many stale local branches. To remove them, run this command

- Author: almirsarajcic
- Created: November 19, 2024


## [Debugging GitHub Actions with SSH](https://elixirdrops.net/d/DEceupAK.md)

Sometimes seeing logs from GitHub Actions isn't enough and you need to access the server.  

- Author: almirsarajcic
- Created: November 18, 2024


## [Silently failing code](https://elixirdrops.net/d/NqDzV2rM.md)

Such kinds of function calls can fail, and when they do, they don't crash the server or raise an error:

- Author: amos-kibet
- Created: November 16, 2024


## [optimum_gen_infra v0.1.2](https://elixirdrops.net/d/Q1PiUYpj.md)

optimum_gen_infra version 0.1.2 was released.

- Author: almirsarajcic
- Created: November 15, 2024


## [Reliable File Access in Elixir Release](https://elixirdrops.net/d/Aq8iVNtp.md)

When dealing with file access in Elixir releases, using File.read!(file_path) directly might cause issues, as it may not locate files bundled in the release. To ensure your file is correctly located w...

- Author: mbashia
- Created: November 14, 2024


## [Reduce waiting time for refute_has in Wallaby tests](https://elixirdrops.net/d/Hu7FeZVf.md)

You might be testing that some element on the page should disappear after you take an action and you might be using the `refute_has/2` function provided by Wallaby. But there's a better way to go abou...

- Author: almirsarajcic
- Created: November 14, 2024


## [Fine-tuning Erlang build on macOS using .kerlrc file](https://elixirdrops.net/d/zP1eDXN6.md)

Use all your cores for compilation on Apple Silicon, configure your Erlang build to use the OpenSSL library, and skip installing anything extra like ODBC and WX widgets by putting the following in you...

- Author: almirsarajcic
- Created: November 13, 2024


## [optimum_gen_infra v0.1.1](https://elixirdrops.net/d/4nLp98ZQ.md)

optimum_gen_infra version 0.1.1 was released.

- Author: almirsarajcic
- Created: November 12, 2024


## [Writing GitHub Actions workflows in Elixir](https://elixirdrops.net/d/vyMZznTp.md)

Wouldn't it be great if it was possible to write GitHub Actions workflows in Elixir?

- Author: almirsarajcic
- Created: November 11, 2024


## [Generate CI/CD and more for Elixir apps](https://elixirdrops.net/d/Fhp4dTqM.md)

Do you need:

- Author: almirsarajcic
- Created: November 08, 2024


## [Install Erlang, Elixir, PostgreSQL, and Phoenix with one command](https://elixirdrops.net/d/VrY6GLZA.md)

So, you’ve read about Elixir, played with it in Livebook and now you're ready for the big leagues. You want to start working on your new app idea with this great new stack.

- Author: almirsarajcic
- Created: November 07, 2024


## [Setting AppSignal revision](https://elixirdrops.net/d/gewK4EH7.md)

You can easily enable setting a new AppSignal revision every time you commit and deploy your Elixir application.

- Author: almirsarajcic
- Created: November 06, 2024


## [Freeing up storage in a dev machine](https://elixirdrops.net/d/7qe1HYCm.md)

If you're like me, you've started many pet projects, but you stopped working on them because you didn't have time and you're a hoarder so you fooled yourself you'll get back to them when you have time...

- Author: almirsarajcic
- Created: November 05, 2024
