Results for “k”
Small, practical examples. Search by task or narrow things down below.
Fit an entire image inside a differently shaped box
CSS: Contain preserves the image aspect ratio while keeping all of it visible inside the specified content box.
CSS✓ Tested
Fit as many columns as possible
Use auto-fit and minmax for a CSS grid that responds to its available width.
CSS✓ Tested
Flatten nested collections
Flatten nested collections in a complete Rust program using the standard library.
Rust✓ Tested
Focus an input through a ref
Focus an input through a ref with a small React component and explicit browser behavior.
React✓ Tested
Focus an input through its template reference
Focus an input through its template reference with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format a date in an explicit timezone
Format a date in an explicit timezone with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format a decimal amount
Use invariant culture to print a C# decimal with two places.
C#✓ Tested
Format a decimal number
Format a Java decimal with two digits and a fixed locale.
Java✓ Tested
Format a fractional value as a percentage
Format a fractional value as a percentage with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format a nonnegative integer amount as whole and fractional units
C: Keep the calculation in integer minor units and use two digits for the remainder.
C✓ Tested
Format a number with fixed decimal places
Format a number with fixed decimal places with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format a numeric label with leading zeroes
Bash Scripts: Use a constant printf format string and supply values as separate arguments.
Bash Scripts✓ Tested