-

Print the absolute value of an integer argument, stripping a leading minus so downstream scripts always see a non-negative number.
-

Return success if a Bash nameref array contains a given value, or failure if the value is missing, without expanding the array yourself.
-

Prompt until the user types y/yes or n/no, then echo 1 or 0 so the answer can be captured instead of using the exit status.
-

Allocate a copy with the first character uppercased and the rest lowercased, or NULL if allocation fails.
-

Allocate a copy that uppercases the first letter after each space and lowercases the rest, or NULL if allocation fails.
-

Run an argv list as a subprocess and return the exit status together with captured stdout and stderr as strings.
-

Print a line padded with spaces so the text sits in the middle of the current terminal width, using tput for the column count.
-

Return success if the named variable holds a command that command -v can find on PATH.
-

Return success if the named array exists and contains at least one element, using a nameref so callers pass the array name.
-

Return success if the named path exists and its mode bits match the expected octal permissions, using GNU or BSD stat.
-

Search an expanded PATH for each command name and return its full path, or raise when any name is missing.
-

Walk a COMMANDS list and exit with an error as soon as any required program name is missing from PATH.
-

Remove exited and dead containers, containers stuck on untagged images, dangling images, and dangling volumes, or list them with -n.
-

Allocate a decimal string for an integer with commas every three digits, keeping a leading minus when the value is negative.
-

List tags that exist only locally or only on a remote after confirming the current directory is a git work tree.
-

Compare two dotted numeric version strings and return a negative number, zero, or a positive number for less, equal, or greater.
-

Compare two numeric version strings and return 0 if they are equal, 1 if the first is greater, or 2 if it is less.
-

Fold a slice into a HashMap that maps each value to how many times it occurs, incrementing the entry on each pass.
-

List each table in an Oracle schema with how many indexes it has, using ALL_INDEXES grouped and ordered by table name.
-

Return how many days a month has, using 29 for February in a Gregorian leap year and 0 when the month is out of range.
-

Report whether stdout is attached to a terminal, a pipe, or a redirection so scripts can choose human or machine output.
-

Register an error handler that emails the number, file, line, and message to a chosen address, then stops on anything more severe than a notice.
-

Return a pointer to the byte after the terminating NUL of a C string, the one-past-end position.
-

Print every IPv4 address in a CIDR or dotted-mask network, including the network and broadcast addresses.
-

Pull the first run of digits and dots out of a string so a human version line becomes a comparable numeric version.
-

Group by a column and return each value that appears more than once, together with how many times it is duplicated.
-

Print the top-level directory of a git work tree for the current or given path, or an error if that path is not a repository.
-

Walk a slice and return the first value that is already in a HashSet, using insert's false-on-duplicate result inside find.
-

Track worker PIDs and thread IDs in a Parallel::ForkManager pool, then kill children that exceed PATIENCE so hung jobs are cleaned up.
-

Run Parallel::ForkManager jobs and kill any child whose runtime exceeds PATIENCE seconds so hung workers cannot stall the pool.
-

Fork a fixed-size Parallel::ForkManager worker pool, start each job in a child process, and wait until every worker has finished.
-

Print the default branch name that origin reports as HEAD, trimmed of surrounding whitespace.
-

List version-sorted remote tags that match a dotted triple and print the highest name, skipping peeled annotated-tag objects.
-

Walk common proxy headers and REMOTE_ADDR, then return the first public IP that is not private or reserved, or Unknown if none validate.
-

Parse a GitHub repository URL and return its default branch name from the GitHub API.
-

Return true when a year is a Gregorian leap year: divisible by 4, but not by 100 unless also divisible by 400.
-

Join nameref array values with a separator, and optionally use a different separator before the last item for natural-language lists.
-

Return the smaller or larger of two comparable values so callers can keep a running minimum or maximum without writing the comparison themselves.
-

Search PATH for an executable name and return its expanded filesystem path, or a not-installed marker when nothing matches.
-

Wrap a Node.js request handler so each response logs method, URL, status, and elapsed milliseconds when the response finishes.
-

Look up a value by array key, with an optional case-insensitive search that still returns the original stored value.
-

Allocate a lowercase copy of a C string with tolower and return it, or NULL if allocation fails.
-

Start a Node.js HTTP server with no framework: exact-path routes for / and /health, and a 404 for everything else.
-

Return the SQL Server plans that have used the most CPU, with execution count, total and average worker time, query text, and the XML plan for review.
-

Return /N for a dotted IPv4 netmask, and reject masks whose 1-bits are not a contiguous prefix.
-

Walk a string to the first occurrence of a character, then to the last character of that run, or to the terminator if it is missing.
-

Return st, nd, rd, or th for an integer, treating 11, 12, and 13 as th.
-

Return the English ordinal form of an integer, including the special cases 11th, 12th, and 13th as well as 1st, 2nd, and 3rd.
-

Return an integer with its English ordinal suffix, treating 11, 12, 13 and other teens as th, and 1, 2, 3 as st, nd, rd.
-

Cut a list to a target length, or extend it with a fill value when it is shorter.
-

Parse help, version, aflag, and b from short or long flags, and return the values keyed by the long name.
-

Read query parameters from an incoming request with WHATWG URL and searchParams, using a fallback when the key is missing.
-

Split a list into p slices of roughly equal size, spreading any remainder across the first groups so lengths differ by at most one.
-

Block until the user presses Enter, then continue; treat end-of-file as a clean exit so piped input does not hang.
-

Post a text message to a Slack incoming webhook, optionally setting the channel and username on the JSON payload.
-

Walk Bash caller frames from the current function back toward main and print each frame as a compact stack trace.
-

Prompt for a password with read -s so the characters never appear on the terminal, then restore the cursor to a new line.
-

Record the current script's path, name, sourced-or-executed status, and arguments in variables for later logging or usage text.
-

Point a new tag at the old one, delete the old name locally and on origin, then push tags so the renamed tag is published.
-

Allocate a copy of a string with each case-insensitive match of from replaced by to, or only the first match when single is set.
-

Substitute each key from a nameref associative array with its value inside a file, using in-place sed for the replacements.
-

Fail unless getopt --test exits 4, which only util-linux GNU getopt does, and point macOS users at brew gnu-getopt instead of BSD getopt.
-

Re-run a block with exponential backoff until it succeeds or hits a retry limit, sleeping longer after each failed attempt.
-

Re-call a function with exponential backoff until it succeeds or reaches a retry limit, sleeping longer after each failed attempt.
-

Format an integer number of seconds as a zero-padded HH:MM:SS clock string, including hours beyond 24 when the duration is long.
-

A jQuery plugin that starts a session timer, shows a stay-signed-in modal after inactivity, and redirects to a logout URL if the user does not respond.
-

When VERBOSE is false, send stdout and stderr to /dev/null, while still allowing a forced-output helper to print essential lines.
-

Turn process.argv flags of the form --key=value into an object, treating a bare --key as true.
-

Take an exclusive flock on a /tmp lock file so a cron job or script exits instead of overlapping a previous run, with a noclobber fallback when flock is missing.
-

Sort mappings by column names. A leading minus on a name sorts that column descending.
-

Overwrite trailing CR, LF, and a chosen character with NULs so the string no longer ends on those bytes.
-

Advance a pointer past every leading occurrence of a character and return the first position that is not that character.
-

Ask a question on stdin with node:readline, wait for the answer as a promise, then close the interface.
-

Return success if the current or given directory sits inside a git work tree, without printing the repository root.
-

Log unhandled promise rejections and uncaught exceptions so a process does not fail silently, then exit after an uncaught exception.
-

Allocate an uppercase copy of a C string with toupper and return it, or NULL if allocation fails.
-

Return the weekday as a 0-Sunday index or as a short or long English name for a day, month, and year.
No matching snippets
Try changing the search text or selecting different filters.