Skip to content

Instantly share code, notes, and snippets.

@JesseRWeigel
JesseRWeigel / commands.txt
Created April 28, 2017 19:22
ImageMagick Compression Commands
// Must install ImageMagick first
http://www.imagemagick.org/script/index.php
//This compresses a jpg with no visible loss of quality. Add in your own file names for target.jpg and result.jpg
convert -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% target.jpg result.jpg
// This does the same as above but to an entire folder (will overwrite original files):
mogrify -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% *.jpg
//This does the same thing but to all subfolders as well (Be careful with this one it will overwrite all original files)
@icemilo
icemilo / calculateBusinessDays.js
Last active October 1, 2021 09:27
Calculates business days between two dates using moment.js
var moment = require('moment');
function calculateBusinessDays(firstDate, secondDate){
//Initiallize variables
var day1 = moment(firstDate);
var day2 = moment(secondDate);
var adjust = 0;
if((day1.dayOfYear() === day2.dayOfYear()) && (day1.year() === day2.year())){
return 0;