This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
COLOR_ERROR='\033[0;31m' | |
COLOR_RESET='\e[0m' | |
prog_name="$(basename "$0")" | |
function usage() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
MIN_INTERVAL="${AUTOGITFETCH_MIN_INTERVAL:-300}" # seconds | |
TIMESTAMP_STORE_ROOT="${HOME}/.cache/autogitfetch/" | |
RESET='\e[0m' | |
GREY='\e[0;90m' | |
OUTPUT_TEXT_COLOR="$GREY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Make this file executable: `chmod +x git-rt`. | |
# Then move it to a PATH directory to be able to run it as a Git subcommand (`git rt`). | |
set -eu | |
function status_val() { | |
local property="${@:$#}" # last parameter | |
local status_opts="${@:1:$#-1}" # all parameters except the last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
usage() { echo "Usage: hr [-h] [-c <CHAR (defaults to '=')>] [<LINES (defaults to 1)>]" 1>&2; exit 1; } | |
CHAR='=' | |
while getopts "h c:" ARG; do | |
case $ARG in | |
c) | |
CHAR="$OPTARG" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
sed -r 's/^[[:blank:]]+//' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ $* == *-h* ]]; then | |
cat <<USAGE | |
Switch between full and low brightness using xbacklight. | |
sween [low-brightness] | |
low-brightness defaults to 5, and is a percentage. | |
USAGE | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Output lines of stdin from $1 to $2. | |
# $1 and $2 can be line numbers or patterns. Examples: | |
# slice 10 20 # keep lines 10 to 20 | |
# slice /foo/ /bar/ # keep lines from the one matching foo to the one matching bar. | |
# slice 31703 '/<\/Product>/' # keep lines from number 31703 to the first one matching </Product> | |
sed "$1,$2!d" - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
video_file_path="$1" | |
from="$2" | |
to="$3" | |
set -error | |
tmpdir_path="${TMPDIR:-/tmp}/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Installation: | |
# - Download this file. | |
# - Name it `missinglines`. | |
# - Make it executable (`chmod +x missinglines`). | |
# - Move it to your PATH. | |
set -o errexit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# INSTALLATION: | |
# Drop this file in your PATH, name it `ghopen` and give it executable permission. | |
# | |
# You can set up the `GHOPEN_BROWSER` env var to define which browser to open. | |
# Example values: 'google-chrome' (default), 'firefox'… | |
# ----- | |
# USAGE: | |
# Just run `ghopen` inside a Git repository having a GitHub remote. |
NewerOlder