Cleanly truncate a string to a max length without breaking words mid-character. Adds a trailing ellipsis when truncated and never exceeds the requested length including the ellipsis.
`<article>` for self-contained content (blog post, comment, news item). Each article gets its own header, body, and (optionally) footer. Helps screen readers, RSS, and Google understand structure.
Native OS threads with `std::thread::spawn`. The returned `JoinHandle` lets you wait for the thread and get its return value. Use `move` to transfer ownership of captured variables.
`<details>` is the built-in "click to expand" widget. Free keyboard navigation, search-engine-indexable content (open or closed), no JS needed. Style with CSS to match your design.
The modern SQLAlchemy 2.0 style: typed Mapped[] columns, the new `select()` API, and Session.scalars() for clean row access. Replaces the legacy Query syntax.
`strconv.Atoi` / `Itoa` for the common int<->string case; `ParseFloat`, `ParseBool`, `Quote` for everything else. Always handle the error — strings can be anything.
Embed expressions inside double-quoted strings with `$var` or `${expr}`. No printf/format needed for 95% of cases. Raw strings (triple-quoted) skip escape processing for multiline / regex / SQL.
Wrap every case-insensitive occurrence of a search term in <mark> tags for quick visual highlighting in search results. Properly escapes HTML so user input cannot inject markup.
`as const` freezes a value as deeply readonly and infers the narrowest possible literal types. Replaces enums for most use cases — better tree-shaking, no runtime cost.
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.