Skip to main content
ZombieMutex

30 results · ↑ ↓ navigate · Enter open · Esc close

Engineering Workbench

Code recipes / Mobile & backend

Useful snippets, without the fluff.

My small Swift, Kotlin, TypeScript and SQL implementations, with the trust boundary and failure case visible. The examples use controlled inputs rather than confidential customer code.

8 recipes

TypeScript / Tested teaching helper

Bound a synthetic actuator command

Clamp a finite command into a configured range; reject malformed limits.

Open recipe →

TypeScript / Tested teaching helper

Allowlist a synthetic sensor message

Validate a small telemetry payload and drop unknown fields.

Open recipe →

Swift / Reference example

Observe cancellation inside a Swift task

Stop a loop cooperatively; cancellation is not remote transaction rollback.

Open recipe →

Kotlin / Reference example

Preserve Kotlin coroutine cancellation

Explicitly check coroutine cancellation in a long-running suspend function.

Open recipe →

SQL / Reference example

Scope an idempotency key by tenant

A uniqueness constraint is the foundation for atomic operation claims.

Open recipe →

TypeScript / Tested teaching helper

Separate identity from resource authorization

A client or attestation verdict cannot grant access to someone else's object.

Open recipe →

TypeScript / Tested teaching helper

Calculate a bounded retry delay

Cap exponential retry delays and let the caller enforce a total deadline.

Open recipe →

TypeScript / Tested teaching helper

Allowlist safe authentication telemetry

Create a structured outcome without recording the input's token or password.

Open recipe →