Skip to content

Instantly share code, notes, and snippets.

View mbroadst's full-sized avatar

Matt Broadstone mbroadst

View GitHub Profile
@mbroadst
mbroadst / ajv-validator.js
Last active August 15, 2020 15:04 — forked from jdanyow/app.html
Aurelia Validation using AJV
import {ValidationError} from 'aurelia-validation';
export class AjvValidator {
cache = new Map;
ajv = new Ajv({ v5: true, allErrors: true, format: 'full' });
validateObject(object) {
this.parseSchema(object);
let schemaId = this._schemaId(object);
if (!this.cache.has(schemaId)) {
'use strict';
function createCommandOptions(manager, localOptions) {
const options = Object.assign(
{
host: 'defaultHost',
port: 27017,
connectionTimeoutMS: 5000,
socketTimeoutMS: 0,
pool: 1,
const mongodb = require('mongodb');
const MongoClient = mongodb.MongoClient;
const expect = require('chai').expect;
const MongoNetworkError = mongodb.MongoNetworkError;
const testContext = {};
describe('Beta Examples (transactions)', function() {
before(function() {
testContext.url = 'mongodb://localhost:27017/test?replicaSet=rs0';
return MongoClient.connect(testContext.url)
const mongodb = require('mongodb');
const MongoClient = mongodb.MongoClient;
const expect = require('chai').expect;
const MongoNetworkError = mongodb.MongoNetworkError;
const testContext = {};
describe('Beta Examples (transactions)', function() {
before(function() {
testContext.url = 'mongodb://localhost:27017/test?replicaSet=rs0';
return MongoClient.connect(testContext.url)
module testlib [system] {
header "test-library-shim.h"
link "testlib"
export *
}
static NAN_METHOD(Test) {
// do some work
DoReturn(info);
}
void DoReturn(const Nan::FunctionCallbackInfo<v8::Value> &info) {
info.GetReturnValue().Set(5555);
}
From b8965640622e2b649503b67faf88b9acba23bba6 Mon Sep 17 00:00:00 2001
From: Matt Broadstone <mbroadst@gmail.com>
Date: Mon, 11 Apr 2016 09:43:16 -0400
Subject: [PATCH 4/4] remove no-registry flag for npm install
---
mk/support/pkg/npm-pkg.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mk/support/pkg/npm-pkg.inc b/mk/support/pkg/npm-pkg.inc
d /run/rethinkdb 0755 rethinkdb rethinkdb -
SUMMARY = "RethinkDB is an open source distributed database system for the realtime web."
LICENSE = "AGPL-3.0"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=5e7ac215b3ae3a8526781664de7a8282"
SRC_URI = " \
https://download.rethinkdb.com/dist/rethinkdb-2.3.0.tgz \
file://0001-wrap-compiler-env-variables-in-quotes.patch \
file://0002-configure-v8-without-snapshot-for-cross-compile.patch \
file://0003-fix-v8-pkg_install-include-for-cross-compile.patch \
file://0004-remove-no-registry-flag-for-npm-install.patch \
[Unit]
Description=RethinkDB database server for instance '%i'
[Service]
User=rethinkdb
Group=rethinkdb
ExecStart=/usr/bin/rethinkdb serve --config-file /etc/rethinkdb/instances.d/%i.conf
KillMode=process
PrivateTmp=true