Skip to content

Instantly share code, notes, and snippets.

@quassy
Created April 15, 2020 20:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save quassy/56777de95912ab6c407fa20245f16329 to your computer and use it in GitHub Desktop.
Save quassy/56777de95912ab6c407fa20245f16329 to your computer and use it in GitHub Desktop.
darwin config
export LC_CTYPE=en_US.UTF-8
export FIREBIRD_HOME=/Library/Frameworks/firebird.framework/Resources
export PATH=$PATH:$FIREBIRD_HOME/bin
export LOCAL_IP=`ipconfig getifaddr en0`
# alias
alias home='cd ~ && ll'
alias ..='cd ..'
alias ...='cd ../..'
alias ls='ls -GwF'
alias ll='ls -alh'
alias zshrc='nano ~/.zshrc && source ~/.zshrc'
alias gitconfig='nano ~/.gitconfig'
alias pythonpath='export PYTHONPATH="." && echo $PYTHONPATH'
alias kill-dns='docker ps && (docker container stop $(docker container ls -aq) || echo "nothing to stop") && echo "killing dns cache" && sudo killall -HUP mDNSResponder'
alias kill-docker='docker system prune -a -f'
# https://medium.com/@svinkle/start-a-local-live-reload-web-server-with-one-command-72f99bc6e855
alias serve_vu="sass --watch scss/style.scss:css/style.css &;browser-sync start -s -f . --no-notify --host $LOCAL_IP --port 9000"
alias serve="browser-sync start -s -f . --no-notify --host $LOCAL_IP --port 9000"
# functions
function title {
echo -ne "\033]0;"$*"\007"
}
function theme() {
echo -e "\033]50;SetProfile=$1\a"
}
function dc() {
if [[ $1 == "dup" ]]; then
docker-compose down
docker-compose up "${@:2}"
elif [[ $1 == "dub" ]]; then
docker-compose down
docker-compose up "${@:2}" --build --force-recreate
elif [[ $1 == "edit" ]]; then
test -f "docker-compose.yaml" && nano docker-compose.yaml || nano docker-compose.yml
else
docker-compose "$@"
fi
}
function py() {python3 "$@"}
function venv() {
which python
python -V
if (( # == 0 )); then
echo "venv?"
fi
if [[ $1 == "up" ]]; then
echo "upping..."
source venv/bin/activate
pythonpath
elif [[ $1 == "down" ]]; then
echo "downing..."
deactivate
fi
if [[ $1 == "new" ]]; then
trash venv
python -m venv venv
venv up
pip install -r requirements.txt
fi
which python
python -V
}
# ~./zshrc
eval "$(starship init zsh)"
export PATH="/usr/local/opt/ruby/bin:$PATH"
echo "zshrc loaded"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment