Number rows within a partition — the most common "give me the Nth thing per group" pattern. Pair with a WHERE rn = 1 in an outer query to keep just the top row per group.
`json.RawMessage` is a `[]byte` that survives a decode pass. Use it for envelope-style JSON where one field's type depends on another (e.g. `{"type":"X","payload":{...}}`).
Iterate over a CSV row-by-row as a dict — never loading the whole file. Tolerant of UTF-8 BOMs (utf-8-sig). Generator wrapper makes consumers naturally use for/break.
Remove a directory and everything under it. Defensive against symlinks (unlinks the symlink rather than recursing into it). Returns the count of items removed.
Render an email address as HTML that is human-readable but resistant to naive scraping bots. Uses entity encoding and an optional Caesar-style ROT for the mailto link.
A keyboard- and screen-reader-friendly breadcrumb. The `aria-label="Breadcrumb"` on `<nav>` announces the role; `aria-current="page"` marks the final segment. Add the JSON-LD for Google's rich result.
JUnit 5 is the modern standard. `@Test` marks a method as a test; `Assertions.*` provides the assertion API. `@BeforeEach` runs setup before every test.
`anyhow::Result<T>` is `Result<T, anyhow::Error>` — a type-erased error that captures any other error AND adds context via `.context()`. The app-author's pick (use thiserror for libraries).
One-liner wrapper around json_encode with the right flags: indented, no escaped slashes, no escaped unicode. Use it everywhere instead of raw json_encode for human-readable output.
Yield each date in a [start, end] interval as a DateTimeImmutable, with a configurable step. Builds on DatePeriod under the hood — but exposes a generator so you can break out early.
Convert a timestamp into a short relative phrase: "just now", "5 minutes ago", "3 days ago". Falls back to an absolute date once the delta exceeds a year.
`EXTRACT(field FROM timestamp)` pulls year, month, hour, day-of-week, week, epoch — whatever you need to group, filter, or render. Standard SQL across every database.
Plain `string` can't represent SQL NULL. Use `sql.NullString` (and its siblings `NullInt64`, `NullBool`, etc.) for columns where NULL is a real value distinct from empty.
`rayon` lets you parallelize CPU-bound iterator chains by changing `.iter()` to `.par_iter()`. Handles thread-pool, work-stealing, and synchronization for you.