Skip to content

Instantly share code, notes, and snippets.

View FradSer's full-sized avatar
🎯
Focusing

Frad LEE FradSer

🎯
Focusing
View GitHub Profile
# Compress image with TinyJPG
function compress() {
if [ -n "${TinyJPG_API}" ]; then
for image in $*; do
local url=$(curl -i --user api:$TinyJPG_API --data-binary @"$image" https://api.tinify.com/shrink | grep Location: | awk '{split($0,a,": ");print a[2]}' | tr -d '\r');
wget $url -O "$image";
done
else
echo "TinyJPG_API is not defined! Please defined TinyJPG_API in ~/.path"
fi
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# Shortcuts
alias db="cd ~/Dropbox"
@FradSer
FradSer / Update Sketch Plugins
Last active August 26, 2015 05:31
Update Sketch Plugins
alias updatesketch='find $HOME/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application\ Support/com.bohemiancoding.sketch3/Plugins/ -name ".git" -exec git --git-dir={} pull ";"'