Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save harrilehtisaari/133272d3bdc09f9b64a30f53526c46de to your computer and use it in GitHub Desktop.
Save harrilehtisaari/133272d3bdc09f9b64a30f53526c46de to your computer and use it in GitHub Desktop.
### Custom
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias devel="cd ~/Sites/development"
alias killmem="killall memcached"
alias status="git status"
alias sattus="git status"
alias pull="git pull origin master"
alias editbash="subl ~/.bash_profile"
alias editdbsync="subl /usr/local/bin/backupdbs.sh"
alias syncsub="cp ~/Sites/development/sublime-snippets/*.sublime-snippet ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/"
# Go to themes folder in wp-project
themes(){
if [ -d public ]; then
cd public/wp-content/themes
ls -la
elif [ -d web ]; then
cd web/app/themes
ls -la
else
echo "There's no themes folder accessible from this path."
pwd
fi
}
createdb(){
mysqladmin -uroot create $@
}
dbhelp(){
if [ -f .env ]; then
export `cat .env`
echo "Database defined in env:"; echo $CLEARDB_DATABASE_URL
echo "To pull: heroku cleardb:pull localdbname -a apptopullfrom -s 'searchstring' -r 'replacestring'"
echo "To push: heroku cleardb:push localdbname -a apptopushto"
else
echo "No .env file in this folder"
fi
}
#launch search and replace dbtool
dbtool() {
devel
php -S localhost:5555 -t Search-Replace-DB/
}
#start a wp-project from project root
wpstart() {
killall memcached
redis-cli flushall
if [ -f .env ]; then
export `cat .env`
echo ".env file loaded"
else
echo ".env file not found"
fi
if [ -d public ]; then
php -S 0:$@ -t public/
elif [ -d web ]; then
php -S 0:$@ -t web/
else
echo "This doesn't seem to be a WP-project or the correct folder to run this from."
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment