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
| #!/bin/bash | |
| find . | grep -v node_modules | xargs grep -P '([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|localhost' 2>/dev/null |
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
| // INSTALL DEPENDENCIES | |
| // $> npm install osm-read | |
| // USAGE | |
| // $> node validate.js auckland.osm.pbf | |
| var osmread = require('osm-read'); | |
| var nodeIds = {}, |
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
| t71wuqpBQYxr0twg8LsTE+X5LgXbI/3mPOMtBGHgwbiqhTkBhHcY9ULvjS/wsQHDKmYm4m/+g/VSA8KuYzm0oGRI6G1NRDKaJMvHs30joPsPa7gg/jgGcOY977Yy6zyhvGBtjFanxQVPQLClVWLqLdE/pxFj+pVQ5YLNzTjHCGE3lMHqsMxXyoLQyVtht0UWbzS27eR6TESrYnvRLDwBOibQWjdo1gJ61asjKFpteS4= |
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
| { | |
| "query": { | |
| "filtered": { | |
| "query": { | |
| "match_all": {} | |
| }, | |
| "filter": { | |
| "bool" : { | |
| "must" : [ | |
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
| // Requires nodejs and npm | |
| // @see: https://github.com/isaacs/nave for easy installation | |
| // @install nodejs: [sudo] bash nave.sh usemain stable | |
| // Usage: | |
| // $> npm install quadtree geolib | |
| // $> node quadtree.js | |
| var quadtree = require('quadtree'); | |
| var geolib = require('geolib'); |
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
| // $> npm install osm-pbf-parser osm-read through2 | |
| // $> wget https://s3.amazonaws.com/metro-extracts.mapzen.com/abuja.osm.pbf | |
| var filepath = __dirname + '/abuja.osm.pbf'; | |
| var counts = { | |
| 'osm-pbf-parser': { | |
| node: 0, way: 0, relation: 0 | |
| }, | |
| 'osm-read': { |
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
| #!/bin/bash | |
| # Dependencies | |
| for dep in 'git' 'wget' 'curl'; do | |
| if [ ! `which $dep` ]; then | |
| echo "$dep required, please install it and try again"; | |
| exit 1; | |
| fi | |
| done |
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
| #!upstart | |
| description "pelias server" | |
| author "wiz@wiz.co.nz" | |
| start on startup | |
| stop on shutdown | |
| script | |
| export HOME="/var/www/pelias-webview" | |
| export NODE_ENV="production" |
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
| // send a reply that is capable of JSON, CORS and JSONP | |
| function cors( req, res, obj ){ | |
| res.header('Charset','utf8'); | |
| res.header('Access-Control-Allow-Origin', '*'); | |
| res.header('Access-Control-Allow-Methods', 'GET'); | |
| res.header('Access-Control-Allow-Headers', 'X-Requested-With,content-type'); | |
| res.header('Access-Control-Allow-Credentials', true); | |
| // jsonp | |
| if( req.query && req.query.callback ){ |
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
| /** Crawl documentation for curl syntax errors **/ | |
| // Requires nodejs and npm | |
| // @see: https://github.com/isaacs/nave for easy installation | |
| // @install nodejs: [sudo] bash nave.sh usemain stable | |
| // @ref: https://github.com/missinglink/huntsman | |
| // Usage: | |
| // $> npm install huntsman | |
| // $> node esdocs.js |