FIND YOUR NEXT FEW LINES

Results for “require”

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

1101 snippets foundClear filters
GitBranches & ancestry

Count commits unique to each of two branches

Git: The symmetric difference with left-right separates commits reachable from only one side.

Git✓ Tested
SQL ServerDates & text

Count day boundaries between dates

Compare date values with DATEDIFF.

DATEDIFF✓ Tested
PowerShellDates & numeric validation

Count days between calendar dates

PowerShell: Parse an unambiguous format before subtracting date values.

PowerShell✓ Tested
TypeScriptUTC date operations

Count days between UTC-midnight dates

TypeScript: A day is exactly 86400000 milliseconds for these explicitly UTC-midnight inputs.

TypeScript✓ Tested
SQL ServerReporting & grouped calculations

Count distinct values within a result

SQL Server: COUNT DISTINCT counts distinct non-null values.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Count distinct values within a result

Postgres: COUNT DISTINCT counts distinct non-null values.

Postgres✓ Tested
SQLiteReporting & grouped calculations

Count distinct values within a result

SQLite: COUNT DISTINCT counts distinct non-null values.

SQLite✓ Tested
Bash ScriptsGetting Started

Count down with a while loop

Bash Scripts: Count down with a while loop with a small standalone Bash program.

Bash Scripts✓ Tested
PowerShellCollections & objects

Count items by group

Group repeated values and report each count.

Group-Object✓ Tested
Linux CommandsText processing

Count lines in a file

Count newline characters in a text file, printing only the count without the filename.

lines✓ Tested
PythonCollections

Count occurrences in a list

Count how often each value appears using Counter from the standard library.

count✓ Tested
SQL ServerReporting & grouped calculations

Count rows satisfying separate conditions

SQL Server: SUM over CASE expressions calculates several conditional counts in one scan.

SQL Server✓ Tested