Skip to content

Instantly share code, notes, and snippets.

Don McCurdy donmccurdy

Block or report user

Report or block donmccurdy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@donmccurdy
donmccurdy / index.html
Last active Jun 18, 2019 — forked from Pessimistress/index.html
deck.gl GoogleMapOverlay fullscreen bug
View index.html
<html>
<head>
<script src="https://unpkg.com/deck.gl@^7.0.0/dist.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDaoLdV31Y5ls8ABBpuAQt9t8RzMDfOMiM&libraries=visualization&v=3.34"></script>
<style type="text/css">
body {margin: 0; padding: 0; overflow: hidden;}
#container {width: 100vw; height: 75vh;}
#tooltip {position: absolute; z-index: 1; background: #000; color: #fff; font-family: sans-serif; font-size: 11px; padding: 4px; padding: 8px; pointer-events: none;}
</style>
View fromages_pruned.glb
This file has been truncated, but you can view the full file.
@donmccurdy
donmccurdy / algorithms.json
Last active Apr 2, 2019
Generate JSDoc from Earth Engine algorithm descriptors.
View algorithms.json
{
"data": {
"Filter.greaterThanOrEquals": {
"args": [
{
"default": null,
"description": "A selector for the left operand. Should not be specified if leftValue is specified.",
"name": "leftField",
"optional": true,
"type": "String"
@donmccurdy
donmccurdy / DRACOLoader.patch
Last active Jun 22, 2019
THREE.GLTFLoader with Draco support in Node.js.
View DRACOLoader.patch
diff --git a/node_modules/three/examples/js/loaders/DRACOLoader.js b/NodeDRACOLoader.js
index 57767d7..cc46f2c 100644
--- a/node_modules/three/examples/js/loaders/DRACOLoader.js
+++ b/NodeDRACOLoader.js
@@ -14,10 +14,12 @@
//
'use strict';
+const decoder = require('draco3dgltf').createDecoderModule();
+
@donmccurdy
donmccurdy / DASHLANE_FEEDBACK.md
Last active Mar 1, 2019
Convert Dashlane JSON export to 1Password CSV import.
View DASHLANE_FEEDBACK.md

I've been a Dashlane user since July 2016, and am finally moving to 1Password because of problems with the macOS app and browser extensions, several of which I've reported repeatedly since 2016. In order of severity:

(1) Do not prompt users to install the browser extensions indefinitely. I'm unwilling and unable to install the extensions on certain browsers at work, because of both work policy and personal security preference. For the past two years, the Dashlane app has prompted me aggressively – opening a prompt, opening a browser tab when I try to close that prompt, and then prompting AGAIN when I try to close that browser tab. Dashlane needs to provide a way to opt out of this, for users with legitimate reasons to not want a browser extension to have access to each website they visit, or who use multiple browsers for e.g. work purposes.

(2) The macOS app regularly locks up on my Macbook Pro, and may require a forced restart and several minutes to load and authenticate.

(3) CSV exports, when I tried to

View googlemaps_and_deckgl.js
const {Deck} = require('@deck.gl/core');
const {GeoJsonLayer} = require('@deck.gl/layers');
// Outlines of US States. Source: Natural Earth http://www.naturalearthdata.com/ via geojson.xyz
const US_MAP_GEOJSON =
'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_110m_admin_1_states_provinces_shp.geojson';
const TILE_SIZE = 256;
const INITIAL_VIEW_STATE = {
@donmccurdy
donmccurdy / csv-processing.js
Created Oct 31, 2018
example CSV transformation in Node.js
View csv-processing.js
const fs = require('fs')
const csv = require('csv');
fs.createReadStream('data.csv')
.pipe(csv.parse({columns: true}))
.pipe(csv.transform((input) => {
return Object.assign({}, input, {
foo: input['foo'].toUpperCase()
});
}))
@donmccurdy
donmccurdy / FOO2GLTF.js
Last active Jun 24, 2019
Example Node.js glTF conversion script, using three.js.
View FOO2GLTF.js
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const THREE = require('three');
const program = require('commander');
const Canvas = require('canvas');
const { Blob, FileReader } = require('vblob');
// Patch global scope to imitate browser environment.
@donmccurdy
donmccurdy / merge-morph-attributes.patch
Created Aug 20, 2018
Merge THREE.BufferGeometry morph attributes.
View merge-morph-attributes.patch
diff --git a/examples/js/utils/BufferGeometryUtils.js b/examples/js/utils/BufferGeometryUtils.js
index f1ce126f6..4c1edcea3 100644
--- a/examples/js/utils/BufferGeometryUtils.js
+++ b/examples/js/utils/BufferGeometryUtils.js
@@ -399,6 +399,7 @@ THREE.BufferGeometryUtils = {
// attributes and new attribute arrays
var attributeNames = Object.keys( this.attributes );
var attrArrays = {};
+ var morphAttrArrays = {};
var newIndices = [];
@donmccurdy
donmccurdy / gltf-deduplicate-textures.js
Created Aug 5, 2018
CLI script for de-duplicating images references in a glTF asset.
View gltf-deduplicate-textures.js
const Listr = require('listr');
const program = require('commander');
const path = require('path');
const fs = require('fs');
const tasks = new Listr([
{
title: 'reading file',
task: (ctx) => {
if (!ctx.program.output) {
You can’t perform that action at this time.