Just a test and a note to self.
wget http://www2.census.gov/geo/tiger/GENZ2015/kml/cb_2015_us_county_500k.zip
unzip cb_2015_us_county_500k.zip
{Binary} = require 'mongodb' | |
# Put together following https://github.com/mongodb/mongo-csharp-driver/blob/master/uuidhelpers.js | |
module.exports.toJUUID = toJUUID = (binId) -> | |
return "" unless binId?.buffer? | |
hex = binId.buffer.toString 'hex' | |
msb = hex.substr(0, 16) | |
lsb = hex.substr(16, 16) | |
msb = msb.substr(14, 2) + msb.substr(12, 2) + msb.substr(10, 2) + msb.substr(8, 2) + msb.substr(6, 2) + msb.substr(4, 2) + msb.substr(2, 2) + msb.substr(0, 2) | |
lsb = lsb.substr(14, 2) + lsb.substr(12, 2) + lsb.substr(10, 2) + lsb.substr(8, 2) + lsb.substr(6, 2) + lsb.substr(4, 2) + lsb.substr(2, 2) + lsb.substr(0, 2) |
var chai = require('chai'), | |
should = chai.should(), | |
expect = chai.expect(), | |
assert = chai.assert, | |
supertest = require('supertest-as-promised'), | |
api = supertest('http://localhost:3000'); | |
describe('Pictures', function () { | |
it('should add a picture', function (done) { | |
api.post('/api/v1/pictures') |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src='http://localhost:3000/socket.io/socket.io.js'></script> | |
<script> | |
var socket = io.connect('http://localhost:3000/nsa'); | |
socket.emit('request', { | |
msg : 'appA user is requesting something' | |
}); | |
socket.on('incoming-request', function(data) { |
global | |
daemon | |
maxconn 4096 | |
user haproxy | |
group haproxy | |
defaults | |
log global | |
frontend http-in |
var express = require('express'), | |
bodyParser = require('body-parser'), | |
passport = require('passport'), | |
LocalStrategy = require('passport-local').Strategy; | |
var app = express(); | |
passport.use(new LocalStrategy(function (username, password, cb) { | |
cb(null, false, {message: 'This can never succeed'}); | |
})); |