Results for “Set-Content”
Small, practical examples. Search by task or narrow things down below.
Remove only a named untracked scratch file
Git: Use a narrow pathspec after reviewing the dry run; clean cannot recover untracked content.
Git✓ Tested
Restore the index state recorded in a stash
Git: Apply with index restores which changes were staged as well as their file contents.
Git✓ Tested
Add inner spacing to a content-sized box
CSS: In content-box sizing, padding adds to the declared content width.
CSS✓ Tested
Align an image within its content box
CSS: Object-position places the rendered object when fitting leaves spare space or crops an edge.
CSS✓ Tested
Allow long content to scroll
CSS: Learn how to allow long content to scroll in a complete browser example.
CSS✓ Tested
Append a line while keeping earlier content
PowerShell: Add-Content appends using an explicitly selected encoding.
PowerShell✓ Tested
Assign a default to an empty or unset variable
Bash Scripts: The colon-equals expansion both supplies and assigns a fallback value.
Bash Scripts✓ Tested
Average a fixed set of readings
Accumulate sample values without overflowing a 16-bit total.
array✓ Tested
Bind textContent without interpreting markup
Bind textContent without interpreting markup with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Calculate a SHA-256 content digest
Java: Hash UTF-8 bytes and format the result as lowercase hexadecimal.
Java✓ Tested
Center content with flexbox
Center a child along both axes inside a CSS flex container.
CSS✓ Tested
Check whether a variable exists under nounset
Bash Scripts: The plus expansion distinguishes an unset variable without reading its missing value.
Bash Scripts✓ Tested