Skip to content

Instantly share code, notes, and snippets.

var vows = require('vows');
var assert = require('assert');
require('../lib/date-utils.js').language('es');
vows.describe('Date Validate').addBatch({
'spanish dates are correct': {
topic: function ( ) {
var instance = new Date('January 1, 2016 16:00:00');
unsigned char clear_day[] = {
0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80,
0x00, 0x01, 0x80, 0x81, 0x80, 0x01, 0xC0, 0x03, 0x80, 0x00, 0xC1, 0x83,
0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x1E, 0x78, 0x00, 0x00, 0x38, 0x1C,
0x00, 0x00, 0x30, 0x0C, 0x00, 0x00, 0x20, 0x0E, 0x00, 0x0E, 0x70, 0x06,
0x70, 0x0E, 0x60, 0x06, 0xF0, 0x00, 0x70, 0x0C, 0x00, 0x00, 0x30, 0x0C,
0x00, 0x00, 0x38, 0x1C, 0x00, 0x00, 0x1E, 0x78, 0x00, 0x00, 0x0F, 0xF0,
0x00, 0x00, 0xC3, 0x83, 0x00, 0x01, 0xC0, 0x03, 0x80, 0x01, 0x80, 0x01,
#ifndef __QUERY_H__
#define __QUERY_H__
#include "emdb.h"
typedef enum WhereType {
and = 0,
or = 1,
equals = 2,
gt = 3,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"type": "Polygon",
"coordinates": [ [ [ -122, 45 ], [ -123, 45 ], [ -123, 46 ], [ -122, 46 ], [ -122, 45 ] ] ]
}
#!/usr/bin/env node
var wkt = require('terraformer-wkt-parser'),
arcgis = require('terraformer-arcgis-parser'),
fs = require('fs');
var argv = require('optimist')
.usage('Usage: $0 --in-format [format] --out-format [format] infile [outfile]')
.demand(['in-format','out-format'])
.check(function (argv) {
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using npm@2.6.0
3 info using node@v1.4.1
4 verbose node symlink /usr/local/bin/node
5 verbose install where, deps [ '/Users/jerry/work/koop',
5 verbose install [ 'async',
5 verbose install 'aws-sdk',
5 verbose install 'body-parser',
5 verbose install 'config',
http.js:851
throw new TypeError('first argument must be a string or Buffer');
^
TypeError: first argument must be a string or Buffer
at ServerResponse.OutgoingMessage.write (http.js:851:11)
at write (/Users/jerry/work/http-db/node_modules/levelup/node_modules/readable-stream/lib/_stream_readable.js:605:24)
at flow (/Users/jerry/work/http-db/node_modules/levelup/node_modules/readable-stream/lib/_stream_readable.js:614:7)
at ReadStream.pipeOnReadable (/Users/jerry/work/http-db/node_modules/levelup/node_modules/readable-stream/lib/_stream_readable.js:646:5)
at ReadStream.emit (events.js:92:17)
at emitReadable_ (/Users/jerry/work/http-db/node_modules/levelup/node_modules/readable-stream/lib/_stream_readable.js:430:10)
server:
port: 1337
db:
sqlite:
filename: ':memory:'
function build_user(username, email, password) {
var user = {};
user.name = username;
user.email = email;
user.salt = crypto.createHash('sha512').update(password).digest('hex');
user.date = new Date();
user.password_hash = hash.generate(password, { saltLength: 8, algorithm: 'sha512' });
return user;