Skip to content

Instantly share code, notes, and snippets.

@dpshelio
Created October 24, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpshelio/f40e462bfc4533d0c8c8b0a2cccf8aae to your computer and use it in GitHub Desktop.
Save dpshelio/f40e462bfc4533d0c8c8b0a2cccf8aae to your computer and use it in GitHub Desktop.
bits I have in my bash/zshrc files
function conda_up () {
# This function (conda_up) will activate anaconda in your path - to deactivate run conda_down
CONDA_PATH=/opt/anaconda/bin
if [[ ":$PATH:" != *":$CONDA_PATH:"* ]]; then
PATH=$CONDA_PATH:$PATH;
fi
}
function conda_down () {
# Remove conda from the path
# from: http://stackoverflow.com/a/370192/1087595
export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/anaconda/ {next} {print}'`
}
function sac () {
# This function is to activate different environments in your conda instalation.
# Look at https://conda.io/docs/using/envs.html to learn more about conda environments
# You can do `conda env list` to see all the conda environments.
conda_up
source activate $1
}
alias sd='source deactivate' # alias to deactivate the environemnt and go back to the default conda environment (root)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment