↓ Skip to main content

Writing

A printing press inside a glass bowl, turning falling coloured shapes into a stack of report pages while its flywheel spins.

Render PDFs in Elixir with the Typst NIF

· 6 mins

A Phoenix app renders its report PDFs inside the BEAM with the typst package's NIF. Why not headless Chrome or the Typst CLI, the checks a NIF has to pass, and a benchmark against the CLI.

A risograph print of three different doors opening onto one room, a luggage tag on a string passing through each

Make the Phoenix scope the first argument

· 3 mins

Pass Phoenix 1.8's Scope first to almost every public context function, and the context becomes one authorization layer for your LiveViews, controllers, APIs and MCP server.

A cutaway of walled rooms, each with one doorway, and a rubber stamp coming down on a cable that tries to go through a wall instead.

Enforce Phoenix contexts with boundary

· 5 mins

Phoenix contexts are a convention until something checks them. boundary makes a call from the web layer into a context's internals fail the build, even on an app that already breaks the rules.

A risograph print of a robot hand plugging a cable into one socket, with a second, tagged socket beside it left empty

MCP before REST when the caller is an agent

· 5 mins

We wanted AI agents to work with our app. I built an MCP server with OAuth first, and REST only when a script that doesn't speak MCP needed the app too.

A pink drawer full of green ticked cards, with small blocks spilling out unnoticed underneath, while a dart races past a snail.

Mutation Testing Finds What Coverage Misses

· 4 mins

Line coverage said our Phoenix app was 96% tested. Mutation testing with Muex, run only on a branch's changed lines and fast tests, found 17 changes no test caught.

Which id belongs in the URI

· 3 mins

A record with its own primary key and an id from the upstream system that sent it. The upstream id usually belongs in the URI, when it passes three tests.

Where to block PromEx's /metrics

· 3 mins

PromEx's plug serves /metrics on the Phoenix app's public port. Why blocking it at the load balancer beats an ingress-nginx snippet, and when a separate metrics port is simpler.

A Space Broke the Drata Agent

· 1 min

A simple but frustrating issue with directory names containing spaces causing the Drata Agent to fail

NIST and AWS Password Policies

· 2 mins

What NIST 800-63 section 5 says about passwords, where the AWS account password policy cannot follow it, and the Pulumi resource that sets what it can.