Skip to content

Instantly share code, notes, and snippets.

@KarolAltamirano
KarolAltamirano / sync-fork-git.sh
Created September 11, 2019 13:50
Sync git fork repo
# add remove
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
git remote -v
# checkout master and delete other branches
git checkout master
git branch | grep -v master | xargs git branch -D
# sync master
git fetch upstream
// Whitewater object
function Whitewater(canvas, inputPath, options) {
'use strict';
var context = null;
var imageIndex = 0;
var coordinates = {
x: 0,
y: 0
};
@KarolAltamirano
KarolAltamirano / zoomToMousePosition.js
Created June 14, 2016 21:24
D3 custom zoom to mouse position
// viewport dimensions
const WIDTH = 300;
const HEIGHT = 400;
// initial values
var tx = 0,
ty = 0,
scale = 1;
/**