Results for “Records & reliable control flow”
Small, practical examples. Search by task or narrow things down below.
Size a child relative to its containing block
CSS: A percentage width is based on the containing block’s available width.
CSS✓ Tested
Size a panel relative to viewport height
CSS: Viewport height units track the browser viewport rather than the parent element.
CSS✓ Tested
Sort lines by numeric value
Linux Commands: Use sort -n so 10 sorts after 2 instead of before it.
Linux Commands✓ Tested
Sort values in descending order
Linux Commands: Combine numeric sorting with reverse order.
Linux Commands✓ Tested
Sort version-like labels naturally
Linux Commands: Use GNU version sort to compare embedded digit runs numerically.
Linux Commands✓ Tested
Stop a child event from reaching its parent
jQuery: stopPropagation leaves other handlers on the same element intact.
jQuery✓ Tested
Style supporting text in italics
CSS: Font-style changes presentation without adding semantic emphasis by itself.
CSS✓ Tested
Use a fallback for a missing hashtable entry
PowerShell: Test the key explicitly so legitimate false or zero values are preserved.
PowerShell✓ Tested
Validate a field when focus leaves it
jQuery: focusout bubbles and can support delegated form validation.
jQuery✓ Tested
Allow a long flex child to shrink inside its container
CSS: Min-width zero removes the default content-size floor so local overflow handling can take effect.
CSS✓ Tested
Allow several selected options
HTML: A multiple select exposes each selected option as a value with the same control name.
HTML✓ Tested
Average a fixed set of readings
Accumulate sample values without overflowing a 16-bit total.
array✓ Tested