FIND YOUR NEXT FEW LINES

Results for “utility type”

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

219 snippets foundClear filters
PostgresGetting Started

Create a table and insert its first row

Postgres: Define column types and a primary key, then insert one row using an explicit column list.

Postgres✓ Tested
SQLiteGetting Started

Create a table and insert its first row

SQLite: Define column types and a primary key, then insert one row using an explicit column list.

SQLite✓ Tested
CBinary formats & structured parsing

Decode a 16-bit big-endian integer

C: Promote bytes to an unsigned integer type before combining shifted values.

C✓ Tested
TypeScriptTypes & functions

Describe an object with an interface

Require named fields on a reusable object shape.

interface✓ Tested
C#JSON & binary formats

Deserialize a JSON object into a dictionary

C#: Specify the value type expected from a known JSON shape.

C#✓ Tested
jQueryHTTP requests

Fetch a plain-text resource

jQuery: An explicit text data type keeps the response as a string.

jQuery✓ Tested
TypeScriptCollections & records

Filter and transform an array

Keep active objects and extract their names.

filter✓ Tested
Linux CommandsFinding & selecting files

Find empty regular files

Linux Commands: Use the empty predicate with a file type constraint.

Linux Commands✓ Tested
TypeScriptTypes & functions

Give an optional property a default

Handle missing object fields with nullish coalescing.

optional✓ Tested
TypeScriptSafe data handling

Handle a result with a discriminated union

Separate success data from an error message.

discriminated union✓ Tested
PowerShellFunctions & control

Handle a terminating error

Catch conversion failures and produce a clear fallback.

try catch✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Identify whether a name resolves to a builtin

Bash Scripts: type -t reports the command kind without printing a machine-specific path.

Bash Scripts✓ Tested