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 | |
| # cb — clipboard copy / paste using ONLY OSC 52 escape sequences | |
| # Works in any terminal that supports OSC 52 (iTerm2, kitty, | |
| # wezterm, recent xterm, etc.). No tmux handling, no xclip, | |
| # no pbcopy. | |
| set -euo pipefail | |
| TIMEOUT=2 # seconds to wait for terminal’s reply when pasting | |
| ############################################################################### |
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 -euo pipefail | |
| EXCLUDE_PATTERNS=() | |
| SEARCH_ROOT="${SEARCH_ROOT:-$HOME}" | |
| SEARCH_DEPTH="${SEARCH_DEPTH:-3}" | |
| NO_PROMPT="${NO_PROMPT:-false}" | |
| SRC_PATH="" | |
| DST_PATH="" |
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 -euo pipefail | |
| show_usage() { | |
| echo "Usage: $0 [--max-depth N] <ext> <ext> ..." | |
| } | |
| # parse options | |
| opts=$(getopt -o h --long help,max-depth: -- "$@") | |
| if [ $? != 0 ]; then |
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 -euo pipefail | |
| SOURCE="$(dirname "${BASH_SOURCE[0]}")" | |
| declare -a R_PATHS=( | |
| "$1:$2" | |
| ) | |
| declare -a L_PATHS=( |
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 -e | |
| if [ -z "${1}" ]; then | |
| echo "Usage: $(basename "${0}") <path>" | |
| exit 1 | |
| fi | |
| TO_REMOVE=$(realpath "${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 -euo pipefail | |
| EXCLUDE_PATTERNS=() | |
| SEARCH_ROOT="/" | |
| NO_PROMPT=false | |
| SRC_PATH="" | |
| DST_PATH="" | |
| usage() { |
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 python3 | |
| """ | |
| Convert the contents of the clipboard from markdown to html that can be pasted into editors expecting rich text. | |
| # Read input from clipboard (default) | |
| ➜ echo "**TEST**" | cb | |
| ➜ mdclip | |
| # Read input from command line |
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 python3 | |
| """ | |
| Memorize key directories and cd to them. | |
| examples: | |
| cd $(harpoon) | |
| cd $(harpoon key) | |
| harpoon add <key> <path> | |
| harpoon register <shell> |
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 | |
| SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | |
| CACHE_FILE="${SCRIPT_DIR}/latest-clion-version.txt" | |
| CACHE_TTL=$((60 * 60 * 24 * 7)) | |
| if [[ "$#" -gt 0 ]]; then | |
| if [[ "$1" = "-f" ]] || [[ "$1" = "--force" ]]; then | |
| FORCE=1 | |
| else |
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
| # change the prefix from 'C-b' to 'C-a' | |
| # (remap capslock to CTRL for easy access) | |
| unbind C-b | |
| set -g prefix C-a | |
| bind C-a send-prefix | |
| # set default shell | |
| set-option -g default-shell /usr/bin/zsh | |
| # start with window 1 (instead of 0) |
NewerOlder