This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function relax(callback, startIndex, dataLength, chunkSize, delay) { | |
chunkSize = chunkSize || 1000; | |
delay = delay || 1; | |
var endIndex = startIndex + Math.min((dataLength-startIndex), chunkSize); | |
if (startIndex === endIndex) { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatLocalDate() { | |
var now = new Date(), | |
tzo = -now.getTimezoneOffset(), | |
dif = tzo >= 0 ? '+' : '-', | |
pad = function(num) { | |
var norm = Math.abs(Math.floor(num)); | |
return (norm < 10 ? '0' : '') + norm; | |
}; | |
return now.getFullYear() | |
+ '-' + pad(now.getMonth()+1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const q = location.search.replace('?', ''); | |
const params = {}; | |
q.replace(/([^&=]+)=([^&]*)/g, ($0, $1, $2) => { | |
params[$1] = $2; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'hallo_ballo:bla'.replace(/([^a-z0-9][a-z0-9])/ig, function($0, $1) { | |
return $1[1].toUpperCase(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tileSize = 256; | |
var zoom = 15; | |
var srcFile = 'huge.geojson'; | |
var dstPath = 'tiles/'; | |
var minX = Number.MAX_VALUE; | |
var maxX = 0; | |
var minY = Number.MAX_VALUE; | |
var maxY = 0; |
OlderNewer