FIND YOUR NEXT FEW LINES

Results for “pre”

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

429 snippets foundClear filters
Linux CommandsGetting Started

Prevent expansion with single quotes

Linux Commands: Prevent expansion with single quotes using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
Docker / ComposeLimits & process security

Prevent gaining privileges through exec

Docker / Compose: The no-new-privileges flag is visible in process status.

Docker / Compose✓ Tested
jQueryEvent control

Prevent navigation from a handled link

jQuery: preventDefault cancels the browser action without cancelling event bubbling.

jQuery✓ Tested
Arduino / CSensor calculations

Prevent output chatter with separate thresholds

Arduino / C: Use different on and off thresholds to retain state between them.

Arduino / C✓ Tested
JavaScriptObject behavior & collections

Prevent runtime changes to top-level properties

JavaScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Prevent runtime changes to top-level properties

TypeScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

TypeScript✓ Tested
GitRestoring & revising local work

Preview removal of an untracked scratch file

Git: The dry-run flag shows what clean would remove without deleting it.

Git✓ Tested
Arduino / CSerial communication

Print a floating-point value with fixed precision

Choose the number of decimal places in serial output.

float✓ Tested
Linux CommandsStreams & byte tools

Read a byte prefix

Linux Commands: Use GNU head -c for a fixed number of bytes, independent of line boundaries.

Linux Commands✓ Tested
GoTesting & reusable helpers

Read a fixed-size stream prefix

Read a fixed-size stream prefix using a complete Go program with explicit sample inputs.

Go✓ Tested
Arduino / CDigital signals & interrupts

Read an unpressed button with an internal pull-up

Arduino / C: An open input configured with INPUT_PULLUP reads high.

Arduino / C✓ Tested
PythonFile operations & archives

Read compressed text directly

Python: Open gzip data in text mode with an explicit encoding.

Python✓ Tested