Skip to content

Instantly share code, notes, and snippets.

@adamaoc
Last active July 10, 2019 02:01
Show Gist options
  • Select an option

  • Save adamaoc/0920f40decae0e8efa82 to your computer and use it in GitHub Desktop.

Select an option

Save adamaoc/0920f40decae0e8efa82 to your computer and use it in GitHub Desktop.

Revisions

  1. adamaoc revised this gist Jul 10, 2019. 1 changed file with 1 addition and 79 deletions.
    80 changes: 1 addition & 79 deletions bash_profile
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ complete -W "NSGlobalDomain" defaults
    # Alias'

    #quickly open your bash_profile for editing
    alias mybash="subl ~/.bash_profile"
    alias mybash="code ~/.bash_profile"

    # Hide/show all desktop icons (useful when presenting)
    alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
    @@ -40,78 +40,6 @@ alias logit='git log --graph --full-history --all --color --pretty=format:"%x1b[
    # Show only Hidden Files
    alias hidden='ls -d .*'

    # moving around in the - ClickMotive - folder structure
    #alias clickmotive="cd ~/Work/ClickMotive/"
    alias cmweb="cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/"
    alias editcmweb="subl ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/ ."
    # Opens the Click Motive Sublime Project file for Responvie designs
    alias cmproject="subl ~/Work/responsive-designs.sublime-project"

    # moving into other projects
    #alias works="cd ~/Work/work/"
    function works() {
    cd ~/Work/work/
    ls
    }

    function clickmotive() {
    cd ~/Work/ClickMotive/
    git status
    }

    function cmcss() {
    subl ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/"$1"/
    }
    function cmbuildcss() {
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/"$1"/Palettes_MVC/"$2"/
    compass compile
    }

    function cmbuildall() {
    #Ford Unity
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/FordUnity/Palettes_MVC/OvalBlueDark/
    compass compile

    #Ford Magnetic
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/FordMagnetic/Palettes_MVC/OvalBlueDark/
    compass compile

    #Ford Premier
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/FordPremier/Palettes_MVC/OvalBlueDark/
    compass compile

    #Acura Advanced
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/AcuraAdvanced/Palettes_MVC/FathomBlueLight/
    compass compile
    }
    function buildAcura() {
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/AcuraAdvanced/Palettes_MVC/FathomBlueLight/
    compass compile

    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/AcuraAdvanced/Palettes_MVC/FathomBlueLight/
    compass compile
    }
    function cmbuildlincoln() {
    #Lincoln Premier
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/PlatinumGrayDark/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/PlatinumGrayLight/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/QuartzGrayDark/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/QuartzGrayLight/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/SmokeGrayDark/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/SmokeGrayLight/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/SteelGrayDark/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/SteelGrayLight/
    compass compile
    }
    # Functions

    # Create a new directory and enter it
    function md() {
    mkdir -p "$@" && cd "$@"
    @@ -131,10 +59,6 @@ function server() {
    python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
    }





    # Bash Coloring

    # @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
    @@ -175,7 +99,6 @@ else
    RESET="\033[m"
    fi


    function git_info() {
    # check if we're in a git repo
    git rev-parse --is-inside-work-tree &>/dev/null || return
    @@ -208,4 +131,3 @@ function usernamehost() {

    PS1="\[\e]2;$PWD\[\a\]\[\e]1;\]$(basename "$(dirname "$PWD")")/\W\[\a\]${BOLD}\$(usernamehost)\[$GREEN\]\w\$(git_info)\[$WHITE\]\n\$ \[$RESET\]"


  2. adamaoc created this gist Dec 15, 2014.
    211 changes: 211 additions & 0 deletions bash_profile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,211 @@

    # Set to ignore case
    bind "set completion-ignore-case on"

    # Larger bash history (allow 32³ entries; default is 500)
    export HISTSIZE=32768
    export HISTFILESIZE=$HISTSIZE
    export HISTCONTROL=ignoredups

    # Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
    [ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh

    # Add tab completion for `defaults read|write NSGlobalDomain`
    # You could just use `-g` instead, but I like being explicit
    complete -W "NSGlobalDomain" defaults


    # Alias'

    #quickly open your bash_profile for editing
    alias mybash="subl ~/.bash_profile"

    # Hide/show all desktop icons (useful when presenting)
    alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
    alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"

    # Stuff I never really use but cannot delete either because of http://xkcd.com/530/
    alias stfu="osascript -e 'set volume output muted true'"
    alias pumpitup="osascript -e 'set volume 10'"

    # shortcut to show all files including hidden files
    alias la="ls -al"

    # List top ten largest files/directories in current directory
    alias ducks='du -cks *|sort -rn|head -11'

    # Show Git Log in Terminal
    alias logit='git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"'

    # Show only Hidden Files
    alias hidden='ls -d .*'

    # moving around in the - ClickMotive - folder structure
    #alias clickmotive="cd ~/Work/ClickMotive/"
    alias cmweb="cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/"
    alias editcmweb="subl ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/ ."
    # Opens the Click Motive Sublime Project file for Responvie designs
    alias cmproject="subl ~/Work/responsive-designs.sublime-project"

    # moving into other projects
    #alias works="cd ~/Work/work/"
    function works() {
    cd ~/Work/work/
    ls
    }

    function clickmotive() {
    cd ~/Work/ClickMotive/
    git status
    }

    function cmcss() {
    subl ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/"$1"/
    }
    function cmbuildcss() {
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/"$1"/Palettes_MVC/"$2"/
    compass compile
    }

    function cmbuildall() {
    #Ford Unity
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/FordUnity/Palettes_MVC/OvalBlueDark/
    compass compile

    #Ford Magnetic
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/FordMagnetic/Palettes_MVC/OvalBlueDark/
    compass compile

    #Ford Premier
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/FordPremier/Palettes_MVC/OvalBlueDark/
    compass compile

    #Acura Advanced
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/AcuraAdvanced/Palettes_MVC/FathomBlueLight/
    compass compile
    }
    function buildAcura() {
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/AcuraAdvanced/Palettes_MVC/FathomBlueLight/
    compass compile

    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/AcuraAdvanced/Palettes_MVC/FathomBlueLight/
    compass compile
    }
    function cmbuildlincoln() {
    #Lincoln Premier
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/PlatinumGrayDark/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/PlatinumGrayLight/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/QuartzGrayDark/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/QuartzGrayLight/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/SmokeGrayDark/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/SmokeGrayLight/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/SteelGrayDark/
    compass compile
    cd ~/Work/ClickMotive/Fusion/Source/ClickMotive.Fusion.Website/Content/css/Designs/LincolnPremier/Palettes_MVC/SteelGrayLight/
    compass compile
    }
    # Functions

    # Create a new directory and enter it
    function md() {
    mkdir -p "$@" && cd "$@"
    }

    # find shorthand
    function f() {
    find . -name "$1"
    }

    # Start an HTTP server from a directory, optionally specifying the port
    function server() {
    local port="${1:-8000}"
    open "http://localhost:${port}/"
    # Set the default Content-Type to `text/plain` instead of `application/octet-stream`
    # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files)
    python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
    }





    # Bash Coloring

    # @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
    # Shamelessly copied from https://github.com/gf3/dotfiles

    default_username='adam.moore'

    if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
    export TERM=gnome-256color
    elif infocmp xterm-256color >/dev/null 2>&1; then
    export TERM=xterm-256color
    fi

    if tput setaf 1 &> /dev/null; then
    tput sgr0
    if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
    MAGENTA=$(tput setaf 9)
    ORANGE=$(tput setaf 172)
    GREEN=$(tput setaf 190)
    PURPLE=$(tput setaf 141)
    WHITE=$(tput setaf 256)
    else
    MAGENTA=$(tput setaf 5)
    ORANGE=$(tput setaf 4)
    GREEN=$(tput setaf 2)
    PURPLE=$(tput setaf 1)
    WHITE=$(tput setaf 7)
    fi
    BOLD=$(tput bold)
    RESET=$(tput sgr0)
    else
    MAGENTA="\033[1;31m"
    ORANGE="\033[1;33m"
    GREEN="\033[1;32m"
    PURPLE="\033[1;35m"
    WHITE="\033[1;37m"
    BOLD=""
    RESET="\033[m"
    fi


    function git_info() {
    # check if we're in a git repo
    git rev-parse --is-inside-work-tree &>/dev/null || return

    # quickest check for what branch we're on
    branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')

    # check if it's dirty (via github.com/sindresorhus/pure)
    dirty=$(git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ]&& echo -e "*")

    echo $WHITE" on "$PURPLE$branch$dirty
    }

    # Only show username/host if not default
    function usernamehost() {
    if [ $USER != "$default_username" ]; then echo "${MAGENTA}$USER ${WHITE}at ${ORANGE}$HOSTNAME ${WHITE}in "; fi
    }


    # iTerm Tab and Title Customization and prompt customization
    # http://sage.ucsc.edu/xtal/iterm_tab_customization.html

    # Put the string " [bash] hostname::/full/directory/path"
    # in the title bar using the command sequence
    # \[\e]2;[bash] \h::\]$PWD\[\a\]

    # Put the penultimate and current directory
    # in the iterm tab
    # \[\e]1;\]$(basename $(dirname $PWD))/\W\[\a\]

    PS1="\[\e]2;$PWD\[\a\]\[\e]1;\]$(basename "$(dirname "$PWD")")/\W\[\a\]${BOLD}\$(usernamehost)\[$GREEN\]\w\$(git_info)\[$WHITE\]\n\$ \[$RESET\]"