FIND YOUR NEXT FEW LINES

Results for “script”

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

407 snippets foundClear filters
TypeScriptTypes & functions

Return the first item with a generic function

Preserve the element type while allowing empty arrays.

generics✓ Tested
TypeScriptUtilities & async

Return typed data from an async function

Await a Promise and handle failures explicitly.

async✓ Tested
TypeScriptSafe data handling

Safely read a caught error

Check the error type before accessing its message.

unknown✓ Tested
TypeScriptUtilities & async

Select fields with the Pick utility type

Expose a smaller view of a larger object type.

Pick✓ Tested
PowerShellStructured formats & encodings

Serialize nested objects with an explicit depth

PowerShell: Select a sufficient depth so nested data is retained instead of converted into a descriptive string.

PowerShell✓ Tested
Docker / ComposeLimits & process security

Set the open-file limit for a process

Docker / Compose: The nofile ulimit sets soft and hard file descriptor limits.

Docker / Compose✓ Tested
Bash ScriptsVariables & text

Split a line into named fields

Read a simple delimiter-separated line into variables.

read✓ Tested
HTMLNative disclosure & dialogs

Start a disclosure open while keeping it collapsible

HTML: The open attribute sets the initial details state without JavaScript.

HTML✓ Tested
PythonGetting Started

Store a value in a named variable

Python: Give a value a descriptive name and print it.

Python✓ Tested
C#Getting Started

Store a value in a named variable

C#: Give a value a descriptive name and print it.

C#✓ Tested
JavaGetting Started

Store a value in a named variable

Java: Give a value a descriptive name and print it.

Java✓ Tested
C++Getting Started

Store a value in a named variable

C++: Give a value a descriptive name and print it.

C++✓ Tested