Skip to content

Instantly share code, notes, and snippets.

View said-and-done's full-sized avatar

Said Nuh said-and-done

  • @tv2 Editorial Dev Team
  • Copenhagen, Denmark
View GitHub Profile
@said-and-done
said-and-done / douglasPeucker.js
Created May 6, 2021 08:00 — forked from adammiller/douglasPeucker.js
Javascript implementation of the Douglas Peucker path simplification algorithm
var simplifyPath = function( points, tolerance ) {
// helper classes
var Vector = function( x, y ) {
this.x = x;
this.y = y;
};
var Line = function( p1, p2 ) {
this.p1 = p1;
@said-and-done
said-and-done / map.js
Last active October 12, 2021 14:32
Linear map input domain to output range
function linearmap(inMin, inMax, outMin, outMax) {
return function (x) {
return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
};
}
@said-and-done
said-and-done / statemachine.sh
Created August 11, 2022 13:14
AWS: stop all currently running State Machine executions
aws stepfunctions list-executions \
--state-machine-arn arn:aws:states:...:covidAutoUpdater \
--status-filter RUNNING \
--query "executions[*].{executionArn:executionArn}" \
--output text | \
xargs -I {} aws stepfunctions stop-execution \
--execution-arn {}
@said-and-done
said-and-done / conv.sh
Created January 24, 2025 08:42
Convert a sorted PNG sequence to GIF
convert -delay 50 -loop 0 $(ls frame*.png | sort --version-sort) seq_frames.gif