FIND YOUR NEXT FEW LINES

Results for “Functions & parameter validation”

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

202 snippets foundClear filters
TypeScriptTypes & functions

Return the first item with a generic function

Preserve the element type while allowing empty arrays.

generics✓ Tested
SQLWindow analytics

Select the top row in each group with a tie-breaker

SQL: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

SQL✓ Tested
SQL ServerWindow analytics

Select the top row in each group with a tie-breaker

SQL Server: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

SQL Server✓ Tested
PostgresWindow analytics

Select the top row in each group with a tie-breaker

Postgres: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

Postgres✓ Tested
SQLiteWindow analytics

Select the top row in each group with a tie-breaker

SQLite: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

SQLite✓ Tested
Bash ScriptsInput streams & redirection

Substitute values into a multiline template

Bash Scripts: An unquoted heredoc delimiter enables parameter expansion in the template.

Bash Scripts✓ Tested
PowerShellFunctions & control

Transform each item in a collection

Build a result array with a foreach expression.

foreach✓ Tested
jQueryEvent control

Validate a field when focus leaves it

jQuery: focusout bubbles and can support delegated form validation.

jQuery✓ Tested
HTMLForms

Validate an email input

Use browser constraint validation for a required HTML email field.

HTML✓ Tested
Bash ScriptsInput streams & redirection

Write a literal multiline block

Bash Scripts: Quoting the heredoc delimiter disables parameter and command expansion inside it.

Bash Scripts✓ Tested