`select` is like a switch for channels — runs whichever case is ready. Use `default` for non-blocking sends/receives; `case <-time.After(d)` for timeouts.
Sensible HTML5 starting template: UTF-8 charset, responsive viewport, language attribute, semantic landmarks. Drop this in every new project before adding anything else.
Implement `From` and you get `Into` for free. Then `.into()` and `T::from(x)` both work. The single most idiomatic way to express type conversions in Rust.
Compose is Android's modern declarative UI toolkit. A `@Composable` function describes UI; the runtime re-runs it when inputs change. Replaces XML layouts entirely.
When you have an `interface{}` (or any) and need to dispatch on its underlying type, use `switch v := x.(type)`. Cleaner than a chain of type-assertions.
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.
`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).
PostgreSQL `LATERAL` lets a join's right-hand side reference the left-hand row — like a correlated subquery, but supplying multiple columns or rows. Perfect for "top-N per group".
Go 1.16+ `signal.NotifyContext` returns a context that's canceled on the listed signals. Cleaner than the legacy `signal.Notify(channel)` dance for graceful shutdown.
Yield every file under a directory using a generator and SPL's RecursiveIteratorIterator. Filter by extension or any other predicate without slurping all paths into memory first.