Results for “Sort-Object”
Small, practical examples. Search by task or narrow things down below.
Sum a collection
Calculate a total with Measure-Object.
Measure-Object✓ Tested
Use a fallback for a missing hashtable entry
PowerShell: Test the key explicitly so legitimate false or zero values are preserved.
PowerShell✓ Tested
Attach configuration when registering a handler
jQuery: event.data carries the registration-time data object.
jQuery✓ Tested
Check JSONB containment
Test whether an object contains a key-value pair.
jsonb✓ Tested
Check out another branch in a second working tree
Git: A linked worktree shares repository objects while maintaining a separate checked-out branch.
Git✓ Tested
Collect ordered values into an array
Build a sorted array from query rows.
array_agg✓ Tested
Copy nested mutable data independently
Python: Use deepcopy when changes to nested lists must not affect the original object.
Python✓ Tested
Count days between calendar dates
Python: Subtract date objects to get an exact calendar-day difference.
Python✓ Tested
Create a lightweight tag at the current commit
Git: A lightweight tag is a direct reference without an annotation object.
Git✓ Tested
Create a recovery branch for a recently moved commit
Git: The reflog can identify a previous local HEAD position while its entry and objects remain available.
Git✓ Tested
Define a function with a typed parameter
Accept a name and return a greeting.
function✓ Tested
Discard incidental output from a setup command
PowerShell: Out-Null prevents setup objects from becoming part of a function or script’s useful result.
PowerShell✓ Tested