FIND YOUR NEXT FEW LINES

Results for “code”

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

3000 snippets foundClear filters
GitRemotes & additional checkouts

Clone a local bare repository

Git: A local remote provides the same clone workflow without any network dependency.

Git✓ Tested
GoMaps & sets

Clone a map before editing it

Clone a map before editing it using a complete Go program with explicit sample inputs.

Go✓ Tested
RustGetting Started

Clone an owned value explicitly

Clone an owned value explicitly in a complete Rust program using the standard library.

Rust✓ Tested
HTMLNative disclosure & dialogs

Clone inert template content into the document

HTML: Template children stay out of the rendered document until their fragment is inserted.

HTML✓ Tested
jQueryInsertion & wrapping

Clone markup without sharing its identity

jQuery: clone creates a separate node; change duplicated IDs before inserting.

jQuery✓ Tested
jQueryAnimation completion

Collapse a panel after an animation

jQuery: slideUp hides the panel when the transition completes.

jQuery✓ Tested
Linux CommandsTransforming text

Collapse repeated spaces

Linux Commands: Use tr -s when repeated occurrences of a character should become one.

Linux Commands✓ Tested
Arduino / CSerial communication

Collect a serial line in a fixed buffer

Read a short command without dynamic String allocation.

serial line✓ Tested
RustTesting & reusable patterns

Collect borrowed values into owned strings

Collect borrowed values into owned strings in a complete Rust program using the standard library.

Rust✓ Tested
PythonFunctions & error handling

Collect independent asynchronous results

Python: Use asyncio.gather to await multiple coroutines while preserving input order.

Python✓ Tested
jQueryTraversal & selection

Collect matching ancestors

jQuery: parents can return several ancestors, ordered from the nearest outward.

jQuery✓ Tested
AngularServices & dependency injection

Collect multiple values through a multi provider

Collect multiple values through a multi provider with a standalone Angular component and explicit browser behavior.

Angular✓ Tested