Skip to content

Instantly share code, notes, and snippets.

View gmaclennan's full-sized avatar

Gregor MacLennan gmaclennan

View GitHub Profile
@gmaclennan
gmaclennan / INSTALL.md
Last active February 16, 2018 17:08
Setup of OpenDroneMap Intel NUC for drone image processing

Ubuntu 16.04 Desktop Setup

First things first:

sudo apt update
sudo apt upgrade

Networking Tools

@gmaclennan
gmaclennan / location.geojson
Created January 5, 2018 05:29
Andalucia p2p hack April 2018
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gmaclennan
gmaclennan / client.js
Last active July 3, 2017 19:17
Hyperlog http replicate test
const request = require('request')
const duplexify = require('duplexify')
const hyperlog = require('hyperlog')
const memdb = require('memdb')
const log = hyperlog(memdb())
const url = 'http://localhost:4001/'
log.add(null, 'hello', function (err, node) {
if (err) throw err
@gmaclennan
gmaclennan / README.md
Last active May 26, 2017 17:57
Map Pan & Zoom & Fit

This is similar to Map Pan & Zoom IV but with unprojected raw GeoJSON, which is scaled to fit the canvas.

@gmaclennan
gmaclennan / README.md
Created May 24, 2017 15:20
Using hyperx instead of JSX

Some notes on how to use hyperx as a replacement for JSX. Need to try this out.

const functions = require('firebase-functions')
const path = require('path')
const gcs = require('@google-cloud/storage')()
module.exports = functions.storage.object().onChange(event => {
const object = event.data
const bucket = gcs.bucket(object.bucket)
// Exit if this is triggered on a file that is not an image.
@gmaclennan
gmaclennan / index.patch
Last active February 22, 2017 18:50
osm-p2p-db deletion batch ops
index ec505de..ff29709 100644
--- a/index.js
+++ b/index.js
@@ -191,25 +191,13 @@ DB.prototype.del = function (key, opts, cb) {
// OsmVersion, Opts -> [OsmBatchOp]
DB.prototype._getDocumentDeletionBatchOps = function (key, opts, cb) {
var self = this
- self.kv.get(key, function (err, docs) {
+ self.kv.get(key, {fields: true}, function (err, docs) {
if (err) return cb(err)
/--- A1 <---\
A0 <---- ---- A3 (deleted)
\--- A2 <---/
@gmaclennan
gmaclennan / existing_way_deleted.json
Last active February 5, 2017 00:04
osm-p2p-db delete record example
{
"value": {
"refs": [
"A",
"C",
"A",
"D"
],
"d": "F"
},
@gmaclennan
gmaclennan / hyperkv.patch
Created February 4, 2017 23:40
Patch for hyperkv 2.0.0
diff --git a/index.js b/index.js
index 79f78e4..e9897c0 100644
--- a/index.js
+++ b/index.js
@@ -101,7 +101,8 @@ KV.prototype.del = function (key, opts, cb) {
}
if (!opts) opts = {}
if (!cb) cb = noop
- self._put(key, { d: key }, opts, function (err, node) {
+ var value = xtend(opts.fields || {}, { k: key, d: true, v: opts.value })