Pair to jwtSign: verify the signature, check the exp claim, and return the decoded payload — or null on any failure. Uses hash_equals for constant-time signature comparison.
Time a closure with microsecond precision and return both its result and the elapsed milliseconds. Great for quick perf experiments without pulling in a profiler.
Write a file in a way that other processes never see a half-written state. Write to a temp file in the same directory, then rename — rename is atomic on POSIX filesystems.
`repeat(n) { i -> ... }` for N-times loops where you don't care about index naming. `lateinit var` lets you declare a non-null var without initializing it — common for DI / framework injection.
`async` returns a `Deferred<T>` — like a Future. Use it when you need a RESULT back, in parallel. Call `.await()` to get the value (suspends until ready).
Build HTML strings with a tagged template literal that auto-escapes every interpolated value. Eliminates a class of XSS bugs without pulling in a templating library.
Marking up a product page with the Schema.org `Product` type unlocks Google's rich snippets — price, rating, availability appear directly in search results. JSON-LD is the recommended format.
Generate and verify a 6-digit time-based one-time password (RFC 6238) compatible with Google Authenticator / Authy. Uses a base32-encoded secret and 30-second time steps.
axum is the tokio-team's web framework — composable, type-safe handlers built on tower middleware. The hello-world is small enough to read in one screen.
Java 21's virtual threads are millions-of-them cheap — JVM multiplexes them onto a small carrier pool. Replaces async/reactive code for most I/O-bound workloads: just write blocking code that doesn't actually block a kernel thread.
Most Rust is safe. `unsafe` only lets you do 5 things the compiler can't check (raw pointer deref, mutable static, unsafe fn / trait, FFI, union access). Wrap unsafe operations in safe abstractions.
SQL date_trunc — Bucket Times into Hours/Days/Weeks
`date_trunc('day', ts)` rounds a timestamp down to the start of the day. Use for time-series GROUP BYs — daily/weekly/hourly buckets without messy arithmetic.
Use `State` to inject shared application state (DB pool, config, etc.) into every handler. `Path` and `Json` extractors deserialize URL params and request bodies for you.
Throw if a condition is false, with TypeScript narrowing the type afterwards. Replaces ad-hoc `if (!x) throw` ladders and gives you type-safe guards in one line.