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
{ | |
"type": "MultiPolygon", | |
"coordinates": | |
[ | |
[ | |
[ [102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0] ] | |
], | |
[ | |
[ [100.0, 0.0], [102.0, 0.0], [102.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] | |
] |
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
Number.prototype.pad = function (length) { | |
var str = this.toString(); | |
while (str.length < length) { | |
str = '0' + str; | |
} | |
return str; | |
}; |
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
function(msg) { | |
if(/^baileys/.test(msg.message)) { | |
var match = msg.message.match(/^baileys\s+(.+)/); | |
var tap; | |
var taps = [ ]; | |
json = http.get("http://api.legitimatesounding.com/api/baileys"); | |
feed = JSON.parse(json); | |
var tap_list = "Bailey's Taps: "; |
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
function(msg) { | |
if(/^hawthorne/.test(msg.message)) { | |
var match = msg.message.match(/^hawthorne\s+(.+)/); | |
var tap; | |
var taps = [ ]; | |
json = http.get("http://api.legitimatesounding.com/api/hawthorne"); | |
feed = JSON.parse(json); | |
// delete the first 20 |
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
function(msg) { | |
if(/^hawthorne/.test(msg.message)) { | |
var match = msg.message.match(/^hawthorne\s+(.+)/); | |
var tap; | |
var taps = [ ]; | |
json = http.get("http://api.legitimatesounding.com/api/hawthorne"); | |
feed = JSON.parse(json); | |
// keep only the first 20 |
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
for (var i = 0; i < 1000; i++) { | |
setTimeout(function () { | |
console.log(i); | |
}, 1000); | |
} |
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 Terraformer = require('../Terraformer/'), | |
GeoStore = require('../terraformer-geostore/node/terraformer-geostore.js').GeoStore, | |
RTree = require('../terraformer-geostore-rtree/').RTree, | |
LevelStore = require('../terraformer-geostore-leveldb/').LevelStore; | |
fs = require('fs'); | |
var JSONStream = require('JSONStream'); | |
var index = new RTree(); | |
var store = new GeoStore({ |
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
est=# CREATE TABLE test (id serial, condition_geo geography); | |
CREATE TABLE | |
test=# INSERT INTO test (condition_geo) VALUES (ST_Buffer(ST_GeogFromWKB(ST_MakePoint(20.0,30.0)),10.0)); | |
INSERT 0 1 | |
test=# SELECT id FROM test WHERE ST_Intersects("condition_geo", ST_Buffer(ST_GeogFromText('POINT(20.0 30.0)'), 20.0)) IS TRUE; | |
id | |
---- | |
1 | |
(1 row) |
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
CREATE OR REPLACE FUNCTION _st_distance(geography, geography, double precision, boolean) | |
RETURNS double precision AS | |
'$libdir/postgis-2.2', 'geography_distance_uncached' | |
LANGUAGE c IMMUTABLE STRICT | |
COST 100; |
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
function foo() { | |
return "foo"; | |
} | |
foo.bar = function () { | |
return "bar"; | |
}; | |
module.exports = exports = foo; |