This file contains 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
import testGeoJSON from './index.js'; | |
const data = {"type":"Polygon","coordinates":[[[-75.37809622,39.75768577],[-75.37791147,39.75742662],[-75.37774395,39.75749719],[-75.37625697,39.75541122],[-75.37812782,39.75461995],[-75.37929017,39.75625055],[-75.37904088,39.75635558],[-75.3793678,39.7568142],[-75.37944602,39.75678124],[-75.37953576,39.75690713],[-75.37945754,39.75694008],[-75.37981952,39.75744787],[-75.38006881,39.75734284],[-75.38119068,39.75891661],[-75.37931582,39.75970219],[-75.37792869,39.75775635],[-75.37809622,39.75768577]],[[-75.37809701405872,39.75768594822176],[-75.37792948404102,39.75775652822922],[-75.37931605248104,39.759701580474385],[-75.38118988531158,39.758916430865874],[-75.38006857816282,39.757343450438995],[-75.3798192881624,39.75744848043917],[-75.37945674594357,39.75693990175167],[-75.37953496594635,39.7569069517505],[-75.37944578817623,39.75678185046365],[-75.37936756817307,39.75681481046498],[-75.37904008596885,39.7563554017763],[-75.37928937596836,39.7562503717765],[-75.3781275 |
This file contains 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
ISC License | |
Copyright (c) 2022 Volodymyr Agafonkin | |
Permission to use, copy, modify, and/or distribute this software for any | |
purpose with or without fee is hereby granted, provided that the above | |
copyright notice and this permission notice appear in all copies. | |
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | |
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
This file contains 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
alias ..="cd .." | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias .....="cd ../../../.." | |
# Shortcuts | |
alias db="cd ~/Dropbox" | |
alias dl="cd ~/Downloads" | |
alias dt="cd ~/Desktop" | |
alias p="cd ~/projects" |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Worker Test</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
#log { font: 14px monospace; } | |
</style> | |
</head> |
This file contains 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 radixSort = require('./index.js'); | |
const N = 10000000; | |
const arr = new Uint32Array(N); | |
for (let i = 0; i < N; i++) arr[i] = Math.floor(Math.random() * 4294967295); | |
console.log(`sorting ${N.toLocaleString()} uint32 numbers`); | |
// warmup | |
radixSort(arr.slice()); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Mapbox GL JS debug page</title> | |
<meta charset='utf-8'> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<link rel='stylesheet' href='/dist/mapbox-gl.css' /> | |
<style> | |
body { margin: 0; padding: 0; } | |
html, body, #map { height: 100%; } |
This file contains 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
export default class BSpline { | |
constructor(degree = 3, dimensions = 2) { | |
this.degree = degree; | |
this.dim = dimensions; | |
this.temp = new Float64Array(dimensions * (degree + 1)); | |
this.current = this.temp.subarray(dimensions * degree); | |
} |
This file contains 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
import {Worker, Agent} from '@mapbox/workerpool'; | |
// only used on the worker side | |
export class FibonacciWorker extends Worker { | |
calculate(num, callback) { | |
let a = 1; | |
let b = 0; | |
for (let i = num; num >= 0; num--) { | |
const tmp = a; | |
a += b; |
This file has been truncated, but you can view the full file.
This file contains 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
{ | |
"name": "Object", | |
"properties": { | |
"rawTileData": {}, | |
"buckets": [ | |
{ | |
"name": "FillBucket", | |
"properties": { | |
"zoom": 17, | |
"overscaling": 2, |
This file contains 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 numFeatures = 100; | |
const numPolygons = 5; | |
const numRings = 10; | |
const numPoints = 10000; | |
console.time('populate storage'); | |
const features = []; | |
for (let i = 0; i < numFeatures; i++) { |
NewerOlder