Skip to content

Instantly share code, notes, and snippets.

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 @extschema@.part_config (type);
< SELECT pg_catalog.pg_extension_config_dump('part_config', '');
@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;
@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);}
var empty_list = function(selector) {
return selector(undefined, undefined, true);
};
var prepend = function(el, list) {
return function(selector) {
return selector(el, list, false);
};
};
var head = function(list) {
var RedisClient = require('redis').RedisClient;
var util = require('util')
var CustomClient = function () {
RedisClient.call(this)
}
util.inherit(CustomClient, RedisClient);
// Extend CustomClient here
@chapel
chapel / Geeklist.json
Created June 5, 2012 20:32 — forked from jnpetersen/Geeklist JSON
GKLST Message Types
{
"created_at": "2012-05-30T05:49:19.548Z",
"messagetypes": {
"card": {
"template": "{{user1}} published a card",
"dataMap": {
"user1": "activity.user.screen_name"
}
},
"micro": {
@chapel
chapel / ideal ops.md
Created May 27, 2012 16:27 — forked from bhenerey/ideal ops.md
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

@chapel
chapel / geeklistAPIideas.md
Created May 1, 2012 21:18 — forked from csanz/geeklistAPIideas.md
Geeklist API Hackathon Ideas (In Progress)
  • An app that coordinates code commits with songs being played on Spotify
  • Post micros via SMS (with Twilio)
  • Geeklist profile to achievements based resume
var http = require('http'),
cluster = require('cluster')
function hydraServer(requestListener, heads){
var server,
i;
if(cluster.isMaster) {
for(i = 0; i < heads; i++) {
cluster.fork()
}
@chapel
chapel / jady.jade
Created January 18, 2012 02:16
Jade tricks
style.
.my-class {
background-color: #eff1f1;
border: 1px solid #dfdbe5;
}
#big-class
.other-class
h3
| Hi! Guys