Skip to content

Instantly share code, notes, and snippets.

@billynyh
Last active October 11, 2015 13:58
Show Gist options
  • Save billynyh/3869877 to your computer and use it in GitHub Desktop.
Save billynyh/3869877 to your computer and use it in GitHub Desktop.
common command
# recursive cat
find . -name '*.php' | xargs wc -l
# format json
echo '{"json":"obj"}' | python -mjson.tool
# git diff
git difftool --tool=tkdiff --no-prompt
# grep
grep -r --exclude-dir=.git
# android lint
lint --disable NewApi,DrawAllocation,ContentDescription,UselessParent,UnusedIds,FieldGetter,UnknownIdInLayout,Overdraw .
# vim camel case to underscore
%s/\<\u\|\l\u/\=len(submatch(0)) == 1 ? tolower(submatch(0)) : submatch(0)[0].'_'.tolower(submatch(0)[1])/g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment