Skip to content

Instantly share code, notes, and snippets.

@timwright12
Created October 21, 2020 14:12
Show Gist options
  • Save timwright12/9bdcc3dcbde07ab1140d50f369c6bd96 to your computer and use it in GitHub Desktop.
Save timwright12/9bdcc3dcbde07ab1140d50f369c6bd96 to your computer and use it in GitHub Desktop.
bash
# Terminal Alias
PS1='\n\W\n[\h][\u] -> '
# Command alias
alias edithosts='sudo vi /private/etc/hosts'
alias editbash='atom-beta ~/.bash_profile'
alias phpserver='php -S localhost:8000'
alias pythonserver='python -m SimpleHTTPServer 8888'
alias npm-remove-packages='rm -rf node_modules/ && rm -rf package-lock.json'
alias npm-reset-packages='rm -rf node_modules/ && rm -rf package-lock.json && npm install'
# WP Local Docker
alias dcwp='docker-compose exec --user www-data phpfpm wp'
alias dcbash='docker-compose exec --user root phpfpm bash'
alias dockerup='docker-compose up -d'
alias dockerdown='docker-compose down'
alias dockerstop='docker stop $(docker ps -a -q)'
alias dockerdelete='docker rm $(docker ps -a -q)'
alias dockerkill='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
# Composer
alias composer-install='composer install --ignore-platform-reqs'
alias composer-update='composer update --ignore-platform-reqs'
alias composer-dump='composer dump-autoload --ignore-platform-reqs'
# Usage: git-show-conflicts
git-show-conflicts() {
git diff --name-only --diff-filter=U
}
# USAGE: git-archive feature/branch-name
git-archive() {
git checkout $1
git tag archive/$1
git push origin archive/$1
git checkout master
git branch -D $1
git push origin :$1
}
# USAGE: git-upstream-set {{repo url}}
git-upstream-set() {
git remote add upstream $1
git fetch upstream
}
# USAGE: git-pull-fork 54 feature/whatever
git-pull-fork() {
git fetch origin pull/$1/head:$2
}
# Asset Downloading
alias placeholder='cd ~/Desktop && curl -O http://placehold.it/1200x600 && mv 1200x600 pl-1200x600.png && rm -f 1200x600'
alias placeholder_square='cd ~/Desktop && curl -O http://placehold.it/500x500 && mv 500x500 pl-500x500.png && rm -f 500x500'
alias placeholder_thumb='cd ~/Desktop && curl -O http://placehold.it/100x100 && mv 100x100 pl-100x100.png && rm -f 100x100'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment