Skip to content

Instantly share code, notes, and snippets.

@rmuratov
Last active September 9, 2017 22:57
Show Gist options
  • Save rmuratov/90dd98cb8039b958d859e6400d55bc21 to your computer and use it in GitHub Desktop.
Save rmuratov/90dd98cb8039b958d859e6400d55bc21 to your computer and use it in GitHub Desktop.
Useful snippets, commands etc.

In Atom Search in any .coffee file in any server folder.

/+(server)/**/*.coffee/

Recursively look for files with a specific extension.

find . -type f -name "*.i18n.json"

Show output from 3rd line.

mongo mydb stat.js | tail -n +3

AWK

mongo mydb scripts/stat.js | awk '{print $2" "$4}'

Optimize png

pngquant --ext .png -f 256 *.png
optipng *.png

Show user defined templates.

grep -rhE 'template name=\"\w+\"' client | awk -F"\"" '{print $2}'

# or
ag --html -o --nofilename --nobreak --nocolor "<\s*template\s+name\s*=\s*(\"|')\w+(\"|')\s*>" | awk '{ gsub ("\047", "\"", $0); print}' | awk -F"\"" '{print $2}'

#used
ag -o --nofilename --nobreak --nocolor "{{\s*>\s*\w+" | awk '{ gsub (" ", "", $0); print}' | sort | uniq | awk -F">" '{print $2}'

ffmpeg

 ffmpeg -i input.avi -c:v libx264 -c:a aac -strict experimental out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment