Convert any string to a URL-safe slug using only stdlib. Normalizes Unicode (NFKD), strips combining marks, lowercases, replaces non-alphanumerics with a separator.
Convert between camelCase and snake_case identifiers. Handy when mapping JS API responses (camelCase) into PHP database column names (snake_case) and vice versa.
Per-field attributes let you map between Rust's snake_case and the JSON's camelCase, skip optional fields, and tag enum variants the way external APIs expect.
Rust's ownership model: passing a value transfers ownership (move); taking a `&value` lets you read without taking ownership; `&mut value` lets you modify without taking ownership. Only one mutable borrow OR many immutable borrows at a time.
`<picture>` lets you serve DIFFERENT images at different breakpoints — not just different sizes of the same crop. Perfect for a wide desktop banner that becomes a square mobile poster.
Always wrap radio groups (and checkboxes that share semantics) in a `<fieldset>` with a `<legend>`. Screen readers announce the legend before each option — without it, the choice is contextless.
When you don't know the JSON shape up-front, parse into `serde_json::Value` and navigate via index / get(). Type-safe pattern matching converts back to Rust types.
Mask the middle of a string while keeping a few chars at each end. Useful for displaying credit cards, emails, or API keys in UI / logs without leaking the whole value.
Open a PDO connection with all the options you almost always want: real prepared statements, exceptions on error, associative-array fetch mode, UTF-8 charset.
`java.net.http.HttpClient` ships in the JDK — no Apache HttpClient or OkHttp needed for most cases. Reuse one client across the app; configure timeouts and follow-redirects up front.
Wrap your transaction in a function that commits on success and rolls back on error or panic. Drop-in: pass any `func(*sql.Tx) error` and forget about manual cleanup.
Declarative macros let you write functions that take token trees instead of values. Great for boilerplate reduction; cleaner than copy-paste, simpler than proc macros.
Download a file in chunks so memory stays flat regardless of file size, with a tqdm progress bar showing speed + ETA. Skips re-download if the file is already complete.