More in Ruby
Random picks
Iterate and collect in Rust
Systems
Filter and map fuse into a single pass; collect decides what comes out the other end.
Responsive grid without media queries
Web & CSS
auto-fill with minmax reflows on its own, so the column count follows the container rather than a breakpoint list.
Time a block of code
Python
A context manager that prints how long its body took, without scattering time.perf_counter calls through the function.
Serve the current directory over HTTP
Shell
Three ways to put a folder on localhost when you need to test something quickly.
Freeze time in a test
Testing
Node's mock timers make anything date-dependent deterministic without injecting a clock everywhere.
Find the largest files under a directory
Shell
Sorts everything beneath the working directory by real disk usage and shows the twenty worst offenders.
Merge dictionaries
Python
The | operator returns a new dict; |= updates in place. Later keys win in both.
Truncate text to a number of lines
Web & CSS
Ellipsis after two lines. The -webkit- prefixes are still required despite being supported everywhere.