Skip to content

Instantly share code, notes, and snippets.

View diegoperini's full-sized avatar
🎹
Focusing

Diego Perini diegoperini

🎹
Focusing
View GitHub Profile
@diegoperini
diegoperini / count-lines.sh
Created November 17, 2015 00:07
count-lines
#!/bin/sh
#
# Simple shell script to count number of lines in every
# file with given file extension in current directory.
#
# Usage:
# ./count-lines.sh 'js'
# ./count-lines.sh 'cpp'
find . -name '*.'$1 | xargs wc -l
@diegoperini
diegoperini / countries.csv
Created January 29, 2015 19:04
155 Countries with phone codes, ready for import as csv
1 Albania +355 Europe
2 Algeria +213 Africa
3 Angola +244 Africa
4 Anguilla +1264 North America
5 Antigua and Barbuda +1268 North America
6 Argentina +54 South America
7 Armenia +374 Europe
8 Australia +61 Oceanica
9 Austria +61 Europe
10 Azerbaijan +994 Europe
@diegoperini
diegoperini / svg2png.sh
Last active August 29, 2015 14:07
Shell script to batch render svg files to png for mobile use
mogrify -alpha On -background none -density 2000 -resize $1 -format png *.svg
# Usage: sh svg2png.sh <dimensions>
#
# <dimensions> can be any geometry value described here (copied from ImageMagick site):
#
# scale% Height and width both scaled by specified percentage.
# scale-x%xscale-y% Height and width individually scaled by specified percentages. (Only one % symbol needed.)
# width Width given, height automagically selected to preserve aspect ratio.
# xheight Height given, width automagically selected to preserve aspect ratio.