Created
June 18, 2013 16:28
-
-
Save yurivictor/5806918 to your computer and use it in GitHub Desktop.
Additional bash functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search WordPress | |
# usage wpgrep 'function the_content' | |
jsgrep() { # search development scripts | |
find . \( -name "*.dev.js" -print \) | xargs grep -n "$1" | |
} | |
cssgrep() { # search development css files | |
find . \( -name "*.dev.css" -print \) | xargs grep -n "$1" | |
} | |
phpgrep() { # search php files | |
find . \( -name "*.php" -print \) | xargs grep -n "$1" | |
} | |
wpgrep() { # search php files and development scripts/styles | |
find . \( -name "*.php" -print -or -name "*.dev.js" -or -name "*.dev.css" -print \) | xargs grep -n "$1" | |
} | |
# Script compression | |
# min js nav-menu | |
# min css nav-menu | |
min() { | |
java -jar ~/downloads/scripts/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar -v --type $1 -o wp-admin/$1/$2.$1 wp-admin/$1/$2.dev.$1 | |
} | |
# Open files fast | |
# usage o wp-config.php | |
o(){ | |
open $1 -a subl | |
} | |
# Open WordPress files fast | |
# Usage | |
# wpi post # wp-includes/post.php | |
# wpai schema # wp-admin/includes/schema.php | |
# wptt style # wp-content/themes/twentyten/style.css | |
# wptt functions # wp-content/themes/twentyten/functions.php | |
# wpjs nav-menu # wp-admin/css/nav-menu.dev.js | |
wpinc(){ | |
o wp-includes/$1.php | |
} | |
wpa(){ | |
o wp-admin/$1.php | |
} | |
wpai(){ | |
o wp-admin/includes/$1.php | |
} | |
wpcss(){ | |
o wp-admin/css/$1.dev.css | |
} | |
wpjs(){ | |
o wp-admin/js/$1.dev.js | |
} | |
wptt(){ | |
o wp-content/themes/twentyten/$1.* | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment