Sign in

Christian Alexander

@phx.dev
126 followers 14 following 17 posts

I write code and do stuff. youtube.com/@CodeAndStuff

PostsRepliesMedia
Christian Alexander @phx.dev · 03/08/2025
I made an Ash extension! Elixir is capable of hitting services hard; great for throughput but harsh when those services are trying to recover from an outage. The circuit breaker pattern addresses this issue and is now available in Ash! #MyElixirStatus hex.pm/packages/ash...
An example resource with a circuit breaker defined. If 10 failures are hit within 10 seconds, the action will fast fail for a minute to let the circuit reset.
1417
Christian Alexander @phx.dev · 15/07/2025
LLMs don't do a great job of cleaning up after themselves. The result: developers include way too much of this AI slop in their commits. Did nobody teach them about git add --patch?
030
Christian Alexander @phx.dev · 14/07/2025
Coming soon: learn how to model payment states with ash_state_machine! The demo also includes background job processing to simulate payments, auth policies, and real time updates. All made easy with Ash! Which part are you interested in learning? #ElixirLang #AshFramework
3403
Christian Alexander @phx.dev · 17/06/2025
Embedded Ecto schemas in forms and a brief intro to Multi? Coming soon in the Budgie series on Code and Stuff! #MyElixirStatus
An example of an Ecto embedded schema, containing a full budget object and an additional decimal field called `period_funding_amount`.


  embedded_schema do
    field :period_funding_amount, :decimal
    embeds_one(:budget, Budget)
  endAn Elixir function called `construct_multi`, which inserts a budget and funds it if necessary.


defp construct_multi(data) do
    Ecto.Multi.new()
    |> Ecto.Multi.insert(:budget, data.budget)
    |> Ecto.Multi.run(:fund_budget, fn repo, %{budget: budget} ->
      fund_budget_if_necessary(repo, budget, data)
    end)
  end
050
Christian Alexander @phx.dev · 15/06/2025
Did you know @ash-hq.org can import existing database tables as resources automatically? It can even generate relationships and constraints! #AshFramework #ElixirLang
1243