Results for “objects”
Small, practical examples. Search by task or narrow things down below.
Serialize nested objects with an explicit depth
PowerShell: Select a sufficient depth so nested data is retained instead of converted into a descriptive string.
PowerShell✓ Tested
Select object properties
Create a smaller object with only the fields you need.
Select-Object✓ 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
Count days between calendar dates
Python: Subtract date objects to get an exact calendar-day difference.
Python✓ Tested
Count items by group
Group repeated values and report each count.
Group-Object✓ 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
Extract all integer tokens from text
C#: Enumerate Match objects returned by Regex.Matches with an explicit timeout.
C#✓ Tested
Filter and transform an array
Keep active objects and extract their names.
filter✓ Tested
Filter items in a pipeline
Keep numbers that meet a condition.
Where-Object✓ Tested
Iterate over object entries
Read JavaScript property names and values using Object.entries.
JavaScript✓ Tested