2022-10-05 03:42:00 +00:00
|
|
|
#!/bin/bash
|
2022-10-04 19:51:20 +00:00
|
|
|
export EDITOR=nvim
|
|
|
|
export VISUAL=nvim
|
|
|
|
|
|
|
|
# Aliases
|
|
|
|
alias ag='\ag --pager="less -r"'
|
|
|
|
alias c='\cat'
|
|
|
|
alias cat='bat'
|
|
|
|
alias cg='cd "$(git rev-parse --show-toplevel)"'
|
2022-10-04 20:02:05 +00:00
|
|
|
alias dots='cd ~/code/dotfiles/'
|
2022-10-04 19:51:20 +00:00
|
|
|
alias fuckingip="curl https://wtfismyip.com/json"
|
|
|
|
alias g='git'
|
|
|
|
alias gp='git push -u'
|
|
|
|
alias httpie="http"
|
|
|
|
alias ls="exa -lhFgxUm --git --time-style long-iso --group-directories-first"
|
2022-10-04 20:02:05 +00:00
|
|
|
alias pg='pushd "$(git rev-parse --show-toplevel)"'
|
2022-10-04 19:51:20 +00:00
|
|
|
alias ppjson="python -m json.tool"
|
|
|
|
alias shrug="echo -n '¯\_(ツ)_/¯' | pbcopy"
|
|
|
|
alias vimini="vim ~/.config/nvim/init.vim"
|
|
|
|
|
|
|
|
# Functions
|
|
|
|
function httpdiff () {
|
|
|
|
diff --color -r -c <(curl -s "$1" 2>&1) <(curl -s "$2" 2>&1)
|
|
|
|
}
|
|
|
|
function cpbr () {
|
|
|
|
if branch=$(git symbolic-ref --short -q HEAD)
|
|
|
|
then
|
|
|
|
printf "$branch" | pbcopy
|
|
|
|
osascript -e "display notification \"$branch copied to clipboard\" with title \"cpbr\""
|
|
|
|
else
|
|
|
|
echo "no branch, can't copy"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
function hidden() { ls -a "$@" | grep '^\.'; }
|
|
|
|
function h () {
|
|
|
|
if [ -z "$*" ]
|
|
|
|
then
|
|
|
|
history
|
|
|
|
else
|
|
|
|
history | egrep "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function settitle () {
|
|
|
|
echo -ne "\033]0;"$*"\007"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function pullall (){
|
|
|
|
for d in ./*/ ; do (cd "$d" && pwd && git pull); done
|
|
|
|
}
|
|
|
|
|
|
|
|
function gh_mainall (){
|
|
|
|
for d in ./*/ ; do (cd "$d" && pwd && git checkout main && git pull); done
|
|
|
|
}
|
|
|
|
|
|
|
|
function allbranches (){
|
|
|
|
for d in ./*/ ; do (cd "$d" && pwd && git remote -v origin && git pull); done
|
|
|
|
}
|
|
|
|
|
|
|
|
function new_dock_space (){
|
|
|
|
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
|
|
|
|
}
|
|
|
|
|
|
|
|
# Jupyter lab!
|
|
|
|
function lab () {
|
|
|
|
source ~/JUPYTER/bin/activate
|
|
|
|
cd ~/scratch
|
|
|
|
powerpip
|
|
|
|
pip install -r jupyter_requirements.txt
|
|
|
|
jupyter lab
|
|
|
|
deactivate
|
|
|
|
}
|
|
|
|
|
2022-10-04 19:51:58 +00:00
|
|
|
# source ~/code/dotfiles/jobs/tidelift.sh
|
|
|
|
source ~/code/dotfiles/jobs/everquote.sh
|