Skip to content

Instantly share code, notes, and snippets.

@derMart
derMart / gist:cc0690d01d6e34eed9df44ef6fc21e81
Created October 19, 2018 11:41
Thin Plate Spline Problem
Following Control Points JSON array:
[{"x1":260.21111988766125,"y1":310.4417412673348,"x2":298.33182733573295,"y2":291.0939741615935},{"x1":235.67262594347676,"y1":295.70781112866644,"x2":278.784541199405,"y2":281.6143898884996},{"x1":325.105415130756,"y1":281.73224504125875,"x2":348.87073227718565,"y2":265.7221456659335},{"x1":293.19995611724335,"y1":296.0328242935015,"x2":323.8909821749851,"y2":276.9965776970716},{"x1":272.9408021765662,"y1":280.81137440759977,"x2":307.42368964204695,"y2":266.1229369126426},{"x1":270.7740477444044,"y1":245.11409513781314,"x2":301.8474635988654,"y2":238.24180669837813},{"x1":311.3465244865483,"y1":273.4444093382673,"x2":338.06461610540646,"y2":258.79216005827334},{"x1":293.25412497804064,"y1":273.7694225030943,"x2":322.99138008326383,"y2":259.6503760975967},{"x1":318.3884763910774,"y1":320.67965595929815,"x2":342.86104178785206,"y2":295.84356825797295},{"x1":345.6895822362422,"y1":328.1549587502408,"x2":364.81743183176945,"y2":301.66375419050695},{"x1":307.9338862559275,"y1"
@derMart
derMart / gist:87e75fbd1fdca73d6d3cebf561ca3fc6
Last active December 15, 2016 13:34
knex.js migration with automatic foreign key constraints being deferrable
var forOwn = require('lodash/forOwn');
exports.up = function (knex) {
var builder = knex.schema;
// do some schema changes using builder
return builder.then(() => {
return knex('pg_constraint').select('*').where('contype', '=', 'f');
})
@derMart
derMart / gist:3082529
Created July 10, 2012 10:27
Openlayers Opera Pan Map Flicker Bug
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Opera Flicker Bug</title>
<script src="http://openlayers.org/dev/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;