Skip to content

Instantly share code, notes, and snippets.

View actuallymentor's full-sized avatar

Mentor Palokaj actuallymentor

View GitHub Profile
@actuallymentor
actuallymentor / git_add_commit_push.sh
Created December 15, 2015 06:01
Creating a bash function that takes parameters, and using it .bashrc_profile style
#This function when added to ~/.bashrc_profile will allow you to use
#the command 'push "Commit message"' to lazily push your repo to your git server
push() {
#Add commit and push
git add *
git commit -a -m "$1"
git push
}
@actuallymentor
actuallymentor / optimize.sh
Created October 18, 2015 12:07
Optimize images in a WordPress installation using Bash
# You need a recent version of jpegoptim and pngquant for this
yes | apt-get install jpegoptim
yes | apt-get install pngquant;
# Navigate to your wp-content/uploads
#optimize JPEG
optimizelossy() { jpegoptim -v *.jpg --max=80; for i in *; do if test -d $i; then cd $i; echo $i; optimizelossy; cd .. ; fi; done; echo; }
optimizelossy