FIND YOUR NEXT FEW LINES

Results for “require”

Small, practical examples. Search by task or narrow things down below.

1101 snippets foundClear filters
TypeScriptGetting Started

Print a number with two decimal places

TypeScript: Format a small decimal value consistently for display.

TypeScript✓ Tested
Bash ScriptsText parsing & arithmetic

Print text containing percent characters literally

Bash Scripts: Never use untrusted text as the printf format string.

Bash Scripts✓ Tested
PowerShellGetting Started

Process every array element

PowerShell: Process every array element using PowerShell 7.

PowerShell✓ Tested
TypeScriptPromises & iteration protocols

Produce a lazy sequence with a generator

TypeScript: A generator yields one value per iteration without building an intermediate array.

TypeScript✓ Tested
Docker / ComposeCompose service options

Protect a Compose service’s root filesystem

Docker / Compose: read_only rejects writes to the image filesystem.

Docker / Compose✓ Tested
Docker / ComposeBuild images

Provide a default environment value

Set a runtime default that can be overridden at startup.

Dockerfile✓ Tested
GitRemotes & collaboration

Pull without creating a merge commit

Update a branch only when its upstream can be fast-forwarded.

pull✓ Tested
GitRemotes & collaboration

Push a new branch and set its upstream

Connect a feature branch with its remote counterpart.

push✓ Tested
GitRemotes & additional checkouts

Push one selected release tag

Git: Naming a single tag avoids pushing every local tag unintentionally.

Git✓ Tested
Docker / ComposeCompose applications

Put an optional service behind a profile

Keep a utility service separate from a normal Compose startup.

Compose✓ Tested
SQL ServerWindow analytics

Rank tied scores with competition gaps

SQL Server: RANK leaves a gap after tied rows, unlike DENSE_RANK.

SQL Server✓ Tested
PostgresWindow analytics

Rank tied scores with competition gaps

Postgres: RANK leaves a gap after tied rows, unlike DENSE_RANK.

Postgres✓ Tested