Results for “require”
Small, practical examples. Search by task or narrow things down below.
Print a number with two decimal places
TypeScript: Format a small decimal value consistently for display.
TypeScript✓ Tested
Print text containing percent characters literally
Bash Scripts: Never use untrusted text as the printf format string.
Bash Scripts✓ Tested
Process every array element
PowerShell: Process every array element using PowerShell 7.
PowerShell✓ Tested
Produce a lazy sequence with a generator
TypeScript: A generator yields one value per iteration without building an intermediate array.
TypeScript✓ Tested
Protect a Compose service’s root filesystem
Docker / Compose: read_only rejects writes to the image filesystem.
Docker / Compose✓ Tested
Provide a default environment value
Set a runtime default that can be overridden at startup.
Dockerfile✓ Tested
Pull without creating a merge commit
Update a branch only when its upstream can be fast-forwarded.
pull✓ Tested
Push a new branch and set its upstream
Connect a feature branch with its remote counterpart.
push✓ Tested
Push one selected release tag
Git: Naming a single tag avoids pushing every local tag unintentionally.
Git✓ Tested
Put an optional service behind a profile
Keep a utility service separate from a normal Compose startup.
Compose✓ Tested
Rank tied scores with competition gaps
SQL Server: RANK leaves a gap after tied rows, unlike DENSE_RANK.
SQL Server✓ Tested
Rank tied scores with competition gaps
Postgres: RANK leaves a gap after tied rows, unlike DENSE_RANK.
Postgres✓ Tested