Master 1Password: vaults, Watchtower, passkeys, SSH agent, CLI, and family/team administration. Use when getting full value from 1Password personally or administering it for others.
中文简介正在准备中。当前显示原文说明。
Idiomatic Elixir: functional design, OTP supervision, GenServers, Ecto, and Phoenix patterns. Use when writing, reviewing, or structuring Elixir applications.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Elixir's superpower — fault-tolerant, concurrent systems via OTP on the BEAM — comes with a philosophy: let processes crash and supervisors restart them; keep state isolated in processes; model with pure functions and pipelines. Professional Elixir means thinking in processes and supervision trees, writing small composable functions, and using Phoenix/Ecto idiomatically.
The through-line: embrace "let it crash" — but design the supervision tree so crashes don't matter.
|>) for data transformation pipelines. Side effects pushed to the edges;
business logic as composable pure functions that are trivial to test.Task for one-off async work,
GenServer for stateful services, Agent for simple state (rarely — prefer GenServer),
ETS for shared in-memory lookup (with ownership discipline), Broadway for data pipelines.
Don't reach for GenServer when a pure function suffices.Accounts, Orders, Billing — contexts group related
functionality and are the public API of that domain. Controllers/LiveViews talk to contexts,
never directly to Ecto schemas across boundaries. This is where your architecture lives.Ecto.Query for readable data access; database
constraints as the final integrity guarantee; migrations backward-compatible.handle_call({:deposit, amt}, _, %{balance: b})) — clearer than nested ifs and the compiler
warns on unreachable or non-exhaustive patterns in many cases.one_for_one vs one_for_all vs rest_for_one), max restarts. Stateless workers restart
trivially; stateful ones need a recovery story (rebuild from DB, not from memory).Task.async_stream for bounded parallel work with
backpressure; GenServer call (sync, with timeouts) vs cast (async, no backpressure —
beware mailbox flooding); monitor don't link across trust boundaries.:observer in dev, telemetry + Prometheus/Grafana in prod; watch
process counts, mailbox sizes, and memory — BEAM systems fail in BEAM-specific ways (a
GenServer mailbox growing unboundedly is the classic).Idiomatic snippets:
# Pipeline + pattern matching over conditionals
def checkout(cart, user) do
cart
|> validate_cart()
|> apply_discounts(user)
|> charge_payment()
|> create_order()
end
defp apply_discounts({:error, _} = err, _user), do: err
defp apply_discounts({:ok, cart}, %{tier: :gold}), do: {:ok, Discounts.gold(cart)}
defp apply_discounts({:ok, cart}, _user), do: {:ok, cart}
# Bounded concurrency with backpressure
urls
|> Task.async_stream(&fetch/1, max_concurrency: 10, timeout: 5_000)
|> Enum.map(fn {:ok, result} -> result end)
GenServer.cast with no backpressure under load → mailbox grows until the
VM struggles. Prefer call with timeouts, or add explicit backpressure (GenStage/Broadway).String.to_atom on user input; use to_existing_atom), structs for domain data, not bare maps
passed six functions deep.spawn) that outlive their
purpose. Everything runs under a supervisor, or it's a leak with a timer.还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Master 1Password: vaults, Watchtower, passkeys, SSH agent, CLI, and family/team administration. Use when getting full value from 1Password personally or administering it for others.
中文简介正在准备中。当前显示原文说明。
Create 3D visuals with modeling, texturing, lighting, rendering, and optimization for web and product.
中文简介正在准备中。当前显示原文说明。
Create 3D web experiences: scene setup, models, materials, lighting, animation, scroll-driven scenes, and performance budgets. Use when adding 3D to websites beyond basic demos.
中文简介正在准备中。当前显示原文说明。
Writing abstracts that get papers read — structured content, the 5-sentence core, and journal-specific constraints.
中文简介正在准备中。当前显示原文说明。
Learn effectively from courses and academies: choosing programs, studying actively, and converting courses into skills. Use when investing time/money in structured learning.
中文简介正在准备中。当前显示原文说明。
Audit designs for accessibility with WCAG checklists covering color, type, focus, motion, and content.
中文简介正在准备中。当前显示原文说明。