Skip to content

Instantly share code, notes, and snippets.

@sixlive
Last active August 24, 2017 14:12
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 sixlive/8226a863bf9e0fde6db528892960dc5e to your computer and use it in GitHub Desktop.
Save sixlive/8226a863bf9e0fde6db528892960dc5e to your computer and use it in GitHub Desktop.
Handy Shell Aliases and Functions
published: true

Here are some mf my most used shell aliases and functions. These are all zsh oriented so your mileage with bash may vary.

Aliases

alias aa="php artisan"
alias v="vagrant"
alias sn="subl -n"
alias c="composer"
alias ::="vendor/bin/phpunit"
alias ::-="vendor/bin/phpunit --filter"
alias g="git"
alias dockerm="docker-machine"
alias dockerc="docker-compose"
alias nah="git reset --hard && git clean -fd"
alias cls="clear"
alias shrug="echo '¯\_(ツ)_/¯' | pbcopy"
alias gitleader="git shortlog -sn"
alias dockit="docker run -it --rm -v `pwd`:/workspace debian/jessie bash"

Functions

function gcd {
    REPO=$1
    CLONEPATH=$2

    if [ -z $CLONEPATH ]; then
        CLONEPATH=${$(basename $1)/.git/}
    fi

    git clone $REPO $CLONEPATH
    cd $CLONEPATH
}

function flushdns {
    sudo killall -HUP mDNSResponder
}

function getip {
    curl -sL icanhazip.com
}

function pyserve {
    python -m SimpleHTTPServer $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment