FIND YOUR NEXT FEW LINES

Results for “only”

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

621 snippets foundClear filters
C#Collections & data structures

Add a dictionary entry only if absent

C#: TryAdd reports a duplicate key without replacing its existing value.

C#✓ Tested
CStrings & byte buffers

Append text only when the destination has enough capacity

C: Check the combined lengths including the terminator before using strcat.

C✓ Tested
CSSResponsive conditions & sizing

Apply an enhancement only when a feature is supported

CSS: A supports rule preserves the baseline outside browsers that understand the selected declaration.

CSS✓ Tested
Bash ScriptsProcesses & environment

Change directory only for one operation

Bash Scripts: A subshell makes a temporary directory change without affecting later commands.

Bash Scripts✓ Tested
C#File operations & paths

Create a file only when it does not exist

C#: FileMode.CreateNew prevents accidental replacement of existing content.

C#✓ Tested
PowerShellFile operations & integrity

Delete only a named scratch file

PowerShell: Use LiteralPath and avoid recursive removal for a single known file.

PowerShell✓ Tested
GitTags & repository configuration

Delete only a selected local tag

Git: Deleting a local tag does not delete a corresponding remote tag.

Git✓ Tested
AngularTemplate-driven forms

Enable saving only after a field changes

Enable saving only after a field changes with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularSignals & state

Expose a read-only signal view

Expose a read-only signal view with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularServices & dependency injection

Expose service state through a read-only signal

Expose service state through a read-only signal with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
Docker / ComposeGetting Started

Give a read-only container temporary storage

Docker / Compose: Give a read-only container temporary storage using a locally available Ubuntu image.

Docker / Compose✓ Tested
Docker / ComposeCompose service options

Give a read-only service writable scratch space

Docker / Compose: A tmpfs mount provides temporary storage independent of the root filesystem.

Docker / Compose✓ Tested