Skip to content

Instantly share code, notes, and snippets.

View chapel's full-sized avatar

Jacob Chapel chapel

View GitHub Profile
@chapel
chapel / base.js
Last active December 21, 2015 05:58 — forked from anonymous/gist:6260605
exports.searchContactPost = function(req, res) {
if(req.body.searchContacts === '') { res.send('Oops you searching for nothing, well here is nothing!'); };
async.waterfall([
function(callback) {
User.find({$or:[
{firstName: req.body.searchContacts.toLowerCase()},
{lastName: req.body.searchContacts.toLowerCase()},
{email: req.body.searchContacts.toLowerCase()}]
}, function(err, users) {
if(err || users.length === 0) { res.send(err);}
@chapel
chapel / setup.js
Last active August 28, 2015 19:49 — forked from 58bits/setup.js
Lab BDD Setup
// Lab setup
var Code = require('code');
var Lab = require('lab');
var lab = exports.lab = Lab.script();
var describe = lab.describe;
var it = lab.it;
var before = lab.before;
var after = lab.after;
var expect = Code.expect;
1,2c1,3
< CREATE TYPE check_parent_table AS (parent_table text, count bigint);
< CREATE TABLE part_config (
---
> CREATE SCHEMA partman;
> CREATE TYPE partman.check_parent_table AS (parent_table text, count bigint);
> CREATE TABLE partman.part_config (
21,22c22,23
< CREATE INDEX part_config_type_idx ON @[email protected]_config (type);
< SELECT pg_catalog.pg_extension_config_dump('part_config', '');