FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
JavaScriptObjects & JSON

Serialize an object

Turn a JavaScript object into JSON text.

JavaScript✓ Tested
Bash ScriptsProcesses & environment

Set an environment value for one child command

Bash Scripts: A command-prefix assignment is visible to that command without overwriting the shell’s current variable.

Bash Scripts✓ Tested
Bash ScriptsText parsing & arithmetic

Set and clear a bit in a shell integer

Bash Scripts: Use shifts and bitwise operators for a small flag field.

Bash Scripts✓ Tested
Bash ScriptsArguments & decisions

Skip selected iterations in a loop

Bash Scripts: Continue starts the next iteration without running the remaining loop body.

Bash Scripts✓ Tested
JavaScriptArrays

Sort numbers numerically

Supply a numeric comparator instead of JavaScript string sorting.

JavaScript✓ Tested
JavaScriptUTC date operations

Sort timestamp strings by their parsed instants

JavaScript: Compare epoch values explicitly when date strings may contain different offsets.

JavaScript✓ Tested
CSSFlexbox alignment

Specify a flex item’s initial main size

CSS: Flex-basis establishes the starting main-axis size before growth or shrinkage.

CSS✓ Tested
Bash ScriptsText parsing & arithmetic

Split a record while retaining its remainder

Bash Scripts: The final read variable receives the remainder of a delimited record.

Bash Scripts✓ Tested
JavaScriptArray restructuring

Split an array into bounded batches

JavaScript: Advance by a positive batch size and allow a shorter final chunk.

JavaScript✓ Tested
JavaScriptStrings

Split and trim text

Split simple comma-separated JavaScript text and trim each part.

JavaScript✓ Tested
JavaScriptRegular expressions & URL encoding

Split text on several separator characters

JavaScript: A regex character class can recognize alternative simple delimiters.

JavaScript✓ Tested
Bash ScriptsProcesses & environment

Stop a child process created by the script

Bash Scripts: Send a signal only to the captured PID of the script’s own child and wait for it to exit.

Bash Scripts✓ Tested