FIND YOUR NEXT FEW LINES

Results for “Types & reliable control flow”

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

308 snippets foundClear filters
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
Linux CommandsArchive integrity & packaging

Create an archive from an explicit file list

Linux Commands: Use tar -T for a controlled list of relative archive members.

Linux Commands✓ Tested
Arduino / CTiming & control

Debounce a button with a stable-time check

Accept an input change only after it stays stable for 30 ms.

debounce✓ Tested
PowerShellFunctions & control

Define a function with a typed parameter

Accept a name and return a greeting.

function✓ Tested
TypeScriptTypes & functions

Describe an object with an interface

Require named fields on a reusable object shape.

interface✓ Tested
HTMLNative disclosure & dialogs

Display a calculated form result

HTML: An output element can name the input controls contributing to its value.

HTML✓ Tested
Linux CommandsArchive integrity & packaging

Exclude generated files from an archive

Linux Commands: Place exclude options before the input paths to control archive membership.

Linux Commands✓ Tested
HTMLAccessible structure

Expose a disclosure button’s expanded state

HTML: Keep aria-expanded synchronized with the controlled panel’s hidden state.

HTML✓ Tested
TypeScriptCollections & records

Filter and transform an array

Keep active objects and extract their names.

filter✓ 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