FIND YOUR NEXT FEW LINES

Results for “os”

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

809 snippets foundClear filters
PostgresConstraints & defaults

Block deletion of a referenced parent

Postgres: The default foreign-key action prevents deletion while a child still refers to the parent.

Postgres✓ Tested
PostgresSubqueries & ranked selection

Build a query from several named stages

Postgres: Separate row selection from aggregation using two common table expressions.

Postgres✓ Tested
Docker / ComposeGetting Started

Build an image with a default command

Docker / Compose: Build an image with a default command with a complete introductory Dockerfile.

Docker / Compose✓ Tested
PostgresWindow analytics

Calculate a cumulative integer percentage

Postgres: Divide a running window sum by the complete total using a unique ordering key.

Postgres✓ Tested
PostgresGetting Started

Calculate a total for each group

Postgres: Group nonmissing categories and calculate separate totals.

Postgres✓ Tested
PostgresGetting Started

Calculate a value with SELECT

Postgres: Evaluate a small arithmetic expression on the database server.

Postgres✓ Tested
PostgresReporting & grouped calculations

Calculate each group’s integer percentage of the total

Postgres: Multiply before division and protect against a zero denominator.

Postgres✓ Tested
PostgresReporting & grouped calculations

Calculate each group’s numeric spread

Postgres: Subtract MIN from MAX to report the difference between extremes.

Postgres✓ Tested
Bash ScriptsFunction scope & composition

Capture output while handling a failed command

Bash Scripts: An assignment inherits the status of its command substitution, allowing both output and status to be handled.

Bash Scripts✓ Tested
CSSPositioning & stacking

Center a fixed-size absolute child with auto margins

CSS: An all-zero inset plus auto margins distributes the available space around the child.

CSS✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Check a script’s syntax without executing its body

Bash Scripts: bash -n parses commands but does not run ordinary script statements.

Bash Scripts✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Check for an installed command

Bash Scripts: command -v checks command resolution without assuming a specific installation path.

Bash Scripts✓ Tested