Use `find -print0` + `read -d ""` to safely iterate filenames that may contain spaces, newlines, or quotes. Standard bash for-loop over `find` output breaks on these.
`withTimeout(ms) { ... }` cancels the inner coroutine if it doesn't finish in time and throws `TimeoutCancellationException`. `withTimeoutOrNull` returns null instead.
Race a promise against a timeout — if the work takes longer than `ms`, reject with a timeout error. Cancels nothing on its own (use AbortController for that), but unblocks the caller.
Like array_unique, but the uniqueness test is a callback that returns the key to dedupe by. Useful for "unique by ID" or "unique by lowercased email" across arrays of objects/rows.
`EXPLAIN` shows the query plan; `EXPLAIN ANALYZE` actually runs it and shows real timings. The first tool when a query is slow — look for sequential scans on big tables.
Cancellation is cooperative — your coroutine must check via `ensureActive()`, `yield()`, or any other suspending call. CPU-busy loops without a suspend point are NOT cancellable.
Delete rows from one table conditional on a related table. PostgreSQL uses `USING`; MySQL uses join syntax in the DELETE. Run as a SELECT first to verify what you're about to remove.
Per-session CSRF token helpers using hash_equals for constant-time comparison. Token is regenerated on logout but persists across requests within a session.
Beyond filter_var, also require the URL to have an http(s) scheme and a non-empty host. Rejects "javascript:" and other risky pseudo-schemes commonly seen in stored XSS.
Bash 4+ arrays — declare, access by index, get all elements with [@], length with #. The quoting matters: "${arr[@]}" preserves each element; ${arr[@]} word-splits.
Channels are typed pipes between goroutines. Unbuffered = synchronous handoff; buffered = up to N values queued. Close a channel to signal "no more values" — receivers see ok=false.
Distribute work across N workers (fan-out), then merge their results back into one channel (fan-in). Used when you can't process items strictly in order but want to retain output as one stream.
`runTest { }` from kotlinx-coroutines-test gives you a virtual time scheduler — `delay(1000)` finishes instantly while preserving ordering. No more flaky 1-second test sleeps.
`zip` pairs elements positionally; the result is the length of the shorter list. `withIndex()` gives you `(index, value)` pairs without the manual `forEachIndexed`.
`withContext(dispatcher)` suspends the calling coroutine, runs the block on the given dispatcher, returns the result. Use `Dispatchers.IO` for blocking I/O, `Default` for CPU work, `Main` for UI updates.