Skip to content

Instantly share code, notes, and snippets.

@timmwagener
Created June 6, 2022 18:57
Show Gist options
  • Save timmwagener/165bcafbf84c5ad338849718876d8da2 to your computer and use it in GitHub Desktop.
Save timmwagener/165bcafbf84c5ad338849718876d8da2 to your computer and use it in GitHub Desktop.
# constants
PYTHON_VERSION="310"
PYTHON="Python$PYTHON_VERSION"
# symlinked directories
# make symlink: mklink /d "c:\symlinks\venvs" "e:\venvs"
# remove symlink: rmdir "c:\symlinks\venvs"
# SeeAlso: https://superuser.com/a/306618
SYMLINKS_DIR="/c/symlinks"
TOOLS_DIR="$SYMLINKS_DIR/tools"
TEMP_DIR="$SYMLINKS_DIR/temp"
VENV_DIR="$SYMLINKS_DIR/venvs"
REPOS_DIR="$SYMLINKS_DIR/repos"
RUNNER_DIR="$SYMLINKS_DIR/runner"
# symlinked tools
PYTHON_DIR="$TOOLS_DIR/$PYTHON"
PYTHON_SCRIPTS_DIR="$PYTHON_DIR/Scripts"
VSCODE_INSIDERS_DIR="$TOOLS_DIR/Microsoft VS Code Insiders/bin"
# vagrant boxes (vagrant errors on symlinks)
export VAGRANT_HOME="/e/vagrant"
# console settings
export HISTCONTROL=ignoredups # Avoid successive duplicates in the bash command history.
# PATH
export PATH="$PYTHON_DIR:$PYTHON_SCRIPTS_DIR:$VSCODE_INSIDERS_DIR:$PATH"
# virtualenvwrapper
export WORKON_HOME=$VENV_DIR
source $PYTHON_SCRIPTS_DIR/virtualenvwrapper.sh
# aliases
alias symlinks="cd $SYMLINKS_DIR"
alias repos="cd $REPOS_DIR"
alias tools="cd $TOOLS_DIR"
alias temp="cd $TEMP_DIR"
alias runner="cd $RUNNER_DIR"
alias git_log_pretty_1="git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
alias git_log_pretty_2="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
# commands
pyclean() {
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment