Skip to content

Instantly share code, notes, and snippets.

View collimarco's full-sized avatar

Marco Colli collimarco

View GitHub Profile
@collimarco
collimarco / compress.sh
Created September 22, 2020 21:27
Compress all the images in a folder with ImageMagick and save them to new folder
mogrify -sampling-factor 4:2:0 -strip -gaussian-blur 0.05 -resize 800x800 -quality 80 -interlace JPEG -colorspace sRGB -path ../new-thumbs *.jpg
@collimarco
collimarco / clt.js
Last active August 29, 2015 14:05
V8 Javascript that demonstrates the Central Limit Theorem
// A large number to be used as infinite
var inf = 10000;
// The number of segments in which a continuous random variable is divided
// to get an aproximation in the discrete
var nSegments = 10;
// U ~ Uniform(0, 1)
function u() {
return Math.random();
@collimarco
collimarco / Mobile Res Generator
Last active March 9, 2016 16:21
Mobile Res Generator
These shell scripts automatically generate PNG icons and splash screens (launch images) at different sizes and resolutions given a default icon and splash screen in Inkscape SVG format.
PREREQUISITES
Make sure that you have Inkscape installed. Running the following command you should see the path to the executable:
> which inkscape
/usr/bin/inkscape
CONFIGURATION
You can specify the input icon and splash screen (and some other options) in the configuration at the top of each shell script.