Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unset GREP_OPTIONS
- # find content in javascript files inside a folder
- # eg: findjs color src
- function findjs {
- find "${2:-.}" -name '*.js' -not -path '*node_modules*' -not -path '*dist*' -exec grep "$1" --color=auto {} \; -print
- }
- # find content in javascript files inside a folder and replace it with something else
- # eg: findjsr red blue src
- function findjsr {
- find "${3:-.}" -name '*.js' -not -path '*node_modules*' -not -path '*dist*' -exec sed -i "" "s/$1/$2/g" {} \; -print
- }
- # find content in view files inside a folder
- function findview {
- find "${2:-.}" -name '*.view' -not -path '*node_modules*' -not -path '*dist*' -exec grep "$1" --color=auto {} \; -print
- }
- # find content in view files inside a folder and replace it with something else
- function findviewr {
- find "${3:-.}" -name '*.view' -not -path '*node_modules*' -not -path '*dist*' -exec sed -i "" "s/$1/$2/g" {} \; -print
- }
- # list all views and when you select one it opens it with the editor
- # it needs fzy, install it with brew install fzy
- function editview {
- find "${1:-.}" -name '*.view*' -not -path '*node_modules*' -not -path '*dist*' -not -path '*.view.js' | fzy | xargs -o $EDITOR
- }
- function cleangitbranches {
- git remote prune origin
- git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -D
- }
- # list processes running off the current directory
- function procpwd {
- ps aux | grep `pwd`
- }
- # kill processes running off the current directory
- function killpwd {
- kill $(ps aux | grep `pwd` | awk '{print $2}')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement