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
| // $> 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
| // 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
| { | |
| "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
| 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
| // 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
| #!/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
| var GA = require('googleanalytics'), | |
| Table = require('cli-table'), | |
| util = require('util'); | |
| // API client. | |
| // You may need to enable API access to analytics for your account | |
| // here: https://code.google.com/apis/console | |
| var ga = new GA.GA({ | |
| "user": "myaccount@gmail.com", |
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 | |
| echo '--- 1 ---' | |
| ls -1 | cowsay | |
| function pause { | |
| read -p "$*" | |
| } | |
| function multi { |
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 | |
| function stdout { | |
| echo -e "\e[32m$@\e[0m"; | |
| } | |
| function stderr { | |
| echo -e "\e[31m$@\e[0m" 1>&2; | |
| } |