FIND YOUR NEXT FEW LINES

Results for “by”

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

417 snippets foundClear filters
ReactComponents & props

Reset child state by changing its key

Reset child state by changing its key with a small React component and explicit browser behavior.

React✓ Tested
GitMerging & replaying changes

Resolve a merge by writing the intended final file

Git: After a conflict, edit the result, stage it, and finish the merge commit.

Git✓ Tested
CArray transformations

Rotate a nonempty array left by one element

C: Save the first item before shifting the remaining elements.

C✓ Tested
Docker / ComposeImage management

Run an image by its local immutable ID

Docker / Compose: Resolve the local image ID before invoking it.

Docker / Compose✓ Tested
jQueryGetting Started

Select an element by its ID

jQuery: Learn how to select an element by its ID in a complete browser example.

jQuery✓ Tested
jQueryTraversal & selection

Select an element by zero-based position

jQuery: eq returns a jQuery collection containing the selected index.

jQuery✓ Tested
PowerShellArray operations

Select elements by an index range

PowerShell: An index range selects the requested array positions in order.

PowerShell✓ Tested
Linux CommandsStreams & byte tools

Set a file to a specific byte length

Linux Commands: Use truncate to shorten a known scratch file without replacing its inode.

Linux Commands✓ Tested
PythonCollections

Sort dictionaries by a value

Sort a list of dictionaries by a numeric field, leaving the original list unchanged.

sort✓ Tested
Linux CommandsSorting & joining records

Sort lines by numeric value

Linux Commands: Use sort -n so 10 sorts after 2 instead of before it.

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Sort records by a delimited field

Linux Commands: Select the exact sort key to avoid including later columns.

Linux Commands✓ Tested
GoTesting & reusable helpers

Sort records by a selected field

Sort records by a selected field using a complete Go program with explicit sample inputs.

Go✓ Tested