FIND YOUR NEXT FEW LINES

Results for “all”

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

1115 snippets foundClear filters
ReactPerformance & rendering

Memoize a derived collection

Memoize a derived collection with a small React component and explicit browser behavior.

React✓ Tested
ReactPerformance & rendering

Memoize a sorted copy of state

Memoize a sorted copy of state with a small React component and explicit browser behavior.

React✓ Tested
ReactPerformance & rendering

Memoize an object passed to a provider

Memoize an object passed to a provider with a small React component and explicit browser behavior.

React✓ Tested
CArray transformations

Merge two sorted arrays

C: Advance the pointer belonging to the smaller next element and copy any remaining suffix.

C✓ Tested
C++Sequence algorithms

Merge two sorted sequences

C++: Both inputs must use the same ordering before merge is called.

C++✓ Tested
Docker / ComposeStorage & isolation

Mount a host directory read-only

Expose existing files without allowing the container to change them.

bind mount✓ Tested
Docker / ComposeCompose service options

Mount a local input directory with long syntax

Docker / Compose: Long mount syntax makes the bind type and read-only intent explicit.

Docker / Compose✓ Tested
ReactPerformance & rendering

Mount expensive content only when requested

Mount expensive content only when requested with a small React component and explicit browser behavior.

React✓ Tested
CStrings & byte buffers

Move overlapping bytes safely

C: memmove supports overlapping ranges, unlike memcpy.

C✓ Tested
HTMLImages & embedded documents

Name a self-contained embedded document

HTML: Give an iframe a descriptive title and provide its small document with srcdoc.

HTML✓ Tested
C++Getting Started

Name a value that stays fixed

C++: Use a constant declaration or the language’s constant naming convention for a fixed limit.

C++✓ Tested
CGetting Started

Name a value that stays fixed

C: Use a constant declaration or the language’s constant naming convention for a fixed limit.

C✓ Tested