Results for “du”
Small, practical examples. Search by task or narrow things down below.
Round a decimal with a chosen midpoint rule
PowerShell: Use decimal input and an explicit rounding policy for a reproducible decimal result.
PowerShell✓ Tested
Run cleanup after a promise settles
TypeScript: finally runs after success or failure and normally preserves the original outcome.
TypeScript✓ Tested
Run dependent async steps in order
TypeScript: Await one result before using it as the input of the next calculation.
TypeScript✓ Tested
Run your first program
TypeScript: Start with a complete program that prints one line. Follow the run instructions below.
TypeScript✓ Tested
Safely read a caught error
Check the error type before accessing its message.
unknown✓ Tested
Select fields with the Pick utility type
Expose a smaller view of a larger object type.
Pick✓ Tested
Separate a first item from the remaining items
JavaScript: Array destructuring and a rest element produce named pieces of a sequence.
JavaScript✓ Tested
Separate a first item from the remaining items
TypeScript: Array destructuring and a rest element produce named pieces of a sequence.
TypeScript✓ Tested
Separate an executable from default arguments
Docker / Compose: Separate an executable from default arguments with a complete introductory Dockerfile.
Docker / Compose✓ Tested
Serialize a hashtable as JSON
Produce compact JSON for a small data object.
JSON✓ Tested
Set a default non-root image user
Docker / Compose: Set a default non-root image user with a complete introductory Dockerfile.
Docker / Compose✓ Tested
Set and inspect a bit flag
Store several boolean states in one byte.
bitSet✓ Tested