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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6cpSs4O35Es2BPR2x9S0m8lP759AkXwN6G+Z0FDZqoIwOx/G2v/4m/N38FhqJIu9Ke5E/aMT28F3nzzAx8rtSRIQLclyMBSuaGQWawQ5cYMqmaW6pNI++qu6OWlzM/NVyGgkQWwukicp36JKZi/OBECFi9IqzdLC6EUz5bFHHHx9gsYSgOcz2/99kv7Fgkb3/fRjPeWam2SEgnxBl4TA7RdDhk+MaAH0pYSPIqIcsTj6T7m/DDmM+ZWuQdc8RQDWrxbQ5GYmtKwFviVuWa+bmbVQ8SfQpwlWmZQSyxn0GtPmMpy9P8v38J+m4E+RHSd1gCoIlHEE1VhzrmSt6Tn9f5kIdpnLbre7Xa4JS/qH4kELAvri5RSocPLvM33/YI8oq8lXlyTeVBT/k4RtfvRK4onNZLiY5+nW7gwzKI4Cwo/TxbId/SVfc3HgsBsprJddC2/RwO10tg6XGWKINrOCdUU770gZB7MBcssHMd07H4AsbaXlTknOq8H4HvP9vcvRCqM+PlM9A0iX8/mcUkDILlwRpKm3tdC0x4G6+0OToQYvkgaZQPM/6s46I1pg/onR9BZEqGKbRuVYmS205crrcg818/V0lEkzQZdFxI0utfBJMWS/n+cafJD1c6nV1T4iLDqkiz7mUdLOGJw2H4ikF5LUdaoMrAjTxKqKcB72K4w== oliverspeir9@gmail.com | |
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mDMEZt+nIxYJKwYBBAHaRw8BAQdAg/NnFUA+0w9JlFtbDg9csmy2ZmXZwIWpLj1V | |
/dBrf1q0JW9saXZlciBzcGVpciA8b2xpdmVyc3BlaXI5QGdtYWlsLmNvbT6IkwQT | |
FgoAOxYhBAoczh/8vhfCaQIIwTln9ThkyCCkBQJm36cjAhsDBQsJCAcCAiICBhUK | |
CQgLAgQWAgMBAh4HAheAAAoJEDln9ThkyCCk+UoBAO |
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 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 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 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 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 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 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 | |
# |