Skip to content

Instantly share code, notes, and snippets.

@dyspop
Last active February 13, 2018 03:11
Show Gist options
  • Select an option

  • Save dyspop/f8b468a3e210eb9d2b702e6c7e930bb2 to your computer and use it in GitHub Desktop.

Select an option

Save dyspop/f8b468a3e210eb9d2b702e6c7e930bb2 to your computer and use it in GitHub Desktop.

Revisions

  1. dyspop revised this gist Feb 13, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    #!/bin/bash


    alias ll='ls -hartlG'

    parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
    }
  2. dyspop revised this gist Feb 1, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bash_profile
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ function cd {

    # check for and activate after changing directory
    if [ -f */bin/activate ] ; then
    source ENV/bin/activate
    source */bin/activate
    fi

    }
  3. dyspop revised this gist Jan 31, 2018. 1 changed file with 26 additions and 1 deletion.
    27 changes: 26 additions & 1 deletion .bash_profile
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,30 @@
    #!/bin/bash

    parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
    }

    export PS1="πŸ€– \h\nπŸ‘€ \u\nπŸ“ \w\n🌳 \$(parse_git_branch)\n🀘 "
    export PS1="πŸ€– \h\nπŸ‘€ \u\nπŸ“ \w\n🌳 \$(parse_git_branch)\n🀘 "

    function cd {

    # check for and deactivate the bin/activate before we exit
    if [ -f */bin/activate ] ; then

    # but only deactivate if we are not in a subdirectory of the virtual env
    # we do this by checking to see if we're in a filesystem directory
    if ! [ "$(df -P . | awk 'NR==2 {print $6}')" = ${@} ] ; then
    deactivate
    fi

    fi

    # change directory to the path given
    builtin cd "$@"

    # check for and activate after changing directory
    if [ -f */bin/activate ] ; then
    source ENV/bin/activate
    fi

    }
  4. dyspop created this gist Apr 10, 2017.
    5 changes: 5 additions & 0 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
    }

    export PS1="πŸ€– \h\nπŸ‘€ \u\nπŸ“ \w\n🌳 \$(parse_git_branch)\n🀘 "