This file contains hidden or 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 -Eeuo pipefail | |
# Install Docker CLI and Docker Compose, etc. | |
brew install docker docker-compose docker-credential-helper | |
# Configure Docker CLI. | |
mkdir -p "$HOME/.docker/cli-plugins" | |
ln -sfn '/opt/homebrew/opt/docker-compose/bin/docker-compose' "$HOME/.docker/cli-plugins/docker-compose" | |
echo '{ |
This file contains hidden or 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 -Eeuo pipefail | |
if [[ $# -lt 2 ]]; then | |
echo "Usage: $(basename "$0") <preset or jq condition> <files or directories...>" | |
echo 'Presets: subrip_only, anime' | |
exit 1 | |
fi | |
JQ_COND="$1" |
This file contains hidden or 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 -Eeuo pipefail | |
echo_and_run() { | |
echo "> $*" | |
"$@" | |
} | |
setup_sudo() { | |
# Ask for the administrator password upfront |
This file contains hidden or 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 -Eeuo pipefail | |
if [[ -z "${JAVA_HOME:-}" ]]; then | |
JAVA='java' | |
else | |
JAVA="$JAVA_HOME/bin/java" | |
fi | |
SJK_VERSION='0.20' | |
SJK_PATH="$HOME/.local/opt/sjk/sjk-plus-$SJK_VERSION.jar" |
This file contains hidden or 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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
This file contains hidden or 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
devices: ({ | |
name: "MX Anywhere 3"; | |
hiresscroll: { | |
hires: true; | |
invert: false; | |
target: false; | |
up: { | |
mode: "Axis"; | |
axis: "REL_WHEEL_HI_RES"; |
This file contains hidden or 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
#!/bin/bash -e | |
if [[ $# -gt 1 ]]; then | |
while [[ $# -gt 0 ]]; do | |
"$0" "$1" | |
shift | |
done | |
exit 0 | |
fi |
This file contains hidden or 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
#!/bin/bash -e | |
# Stash the staged files if any. | |
NEEDS_UNSTASH=0 | |
if ! git diff --staged --exit-code >/dev/null; then | |
echo -ne '\033[1;32m' | |
echo -n 'Stashing the staged files' | |
echo -e '\033[0m' | |
git stash | |
NEEDS_UNSTASH=1 |
This file contains hidden or 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
#!/bin/bash | |
# Git-aware bash command prompt | |
# | |
# Put this script at $HOME/.bash_prompt and add the following to your .bashrc: | |
# | |
# if [[ -f "$HOME/.bash_prompt" ]]; then | |
# if [[ -z "$PROMPT_COMMAND" ]]; then | |
# PROMPT_COMMAND="$HOME/.bash_prompt" | |
# else | |
# PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ;} $HOME/.bash_prompt" |
This file contains hidden or 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
#!/bin/bash -e | |
HEAD_COMMIT_ID=$(git rev-parse HEAD) | |
if [[ -n "$HEAD_COMMIT_ID" ]]; then | |
git commit --amend --reuse-message="$HEAD_COMMIT_ID" | |
git push --force | |
fi |
NewerOlder