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
| ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdZk+5RDecUaPcocRwglDZGwWv5H0iRR9qJtsenUD5j oliver@speir.dev | |
| -----BEGIN PGP PUBLIC KEY BLOCK----- | |
| mDMEZt+nIxYJKwYBBAHaRw8BAQdAg/NnFUA+0w9JlFtbDg9csmy2ZmXZwIWpLj1V | |
| /dBrf1q0JW9saXZlciBzcGVpciA8b2xpdmVyc3BlaXI5QGdtYWlsLmNvbT6IkwQT | |
| FgoAOxYhBAoczh/8vhfCaQIIwTln9ThkyCCkBQJm36cjAhsDBQsJCAcCAiICBhUK | |
| CQgLAgQWAgMBAh4HAheAAAoJEDln9ThkyCCk+UoBAOrw+/ymdIBZKuqqIIPTrPg8 | |
| tWDlZjWV4kTCnfjfatWaAP4s2VaYPAboqVaN/H/24uPt9nUpJybi5mrb2u22MeHP | |
| DLg4BGbfpyMSCisGAQQBl1UBBQEBB0B0H/Tc7ov7S5yJTyTAOYKKKXa3fzljCOwn |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| # Automatically install and use the correct Node version | |
| autoload -U add-zsh-hook | |
| load-nvmrc() { | |
| # Fail early if .nvmrc file is not present | |
| if [ ! -f .nvmrc ]; then | |
| return | |
| fi | |
| local required_version |
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
| killport() { | |
| if [[ -z "$1" ]]; then | |
| echo "Usage: killport <port>" | |
| return 1 | |
| fi | |
| local port=$1 | |
| local pids=$(lsof -ti tcp:"$port") | |
| if [[ -z "$pids" ]]; then | |
| echo "No processes found on port $port." | |
| return 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
| publishnotes() { | |
| rsync -av --exclude=".*" --delete "/path/to/obsidian/notes" "/path/to/repo/src/content/notes/" >/dev/null 2>&1 | |
| cd | |
| cd /path/to/repo | |
| # acp is function that adds commits and pushes https://gist.github.com/OliverSpeir/6842787f67680a1844c718e09eacb169 | |
| acp >/dev/null 2>&1 | |
| cd | |
| # find .md files, convert spaces to hyphens, convert to lowercase, remove extension | |
| find "/path/to/repo/src/content/notes/" -name "*.md" | sed 's/\/path\/to\/repo\/src\/content\/notes\///' | sed 's/.md$//' | awk '{print tolower($0)}' | tr ' ' '-' | while read line | |
| do |
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
| timestamp() { | |
| # Define colors and styles | |
| local BLUE="\e[1;36m" | |
| local GREEN="\e[1;32m" | |
| local RESET="\e[0m" | |
| local NEWLINE="\n" | |
| local RED="\e[1;31m" | |
| if [ $# -eq 1 ]; then | |
| # Split the date and time into two variables |
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
| ginit() { | |
| local repo_name="." | |
| local visibility="public" | |
| if [[ -n "$1" ]]; then | |
| if [[ "$1" == "private" || "$1" == "priv" ]]; then | |
| visibility="private" | |
| else | |
| repo_name="$1" | |
| 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
| acp() { | |
| message="$*" | |
| branch=$(git rev-parse --abbrev-ref HEAD) | |
| git add -A | |
| git commit -m "$message" --allow-empty-message | |
| git push origin $branch | |
| } | |
| # | |
| # ADD TO ~/.zshrc | |
| # |