Skip to content

Instantly share code, notes, and snippets.

// nested
db.call(query, function (err, value) {
// do stuff here
nestedFn('foo', function (err, something) {
// do more stuff here
})
})
// below
db.call(query, gotValue)
@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
@chapel
chapel / publish.js
Created January 12, 2012 04:39
Mongoose publish
function shim(obj) {
if (toString.call(obj) == '[object Function]') {
return obj()
}
return obj
}
module.exports = function(schema, options) {
options || (options = {})
{
"status": "ok",
"data": {
"short_code": {
"id": "707a098e2f345b76392eea59084e2d219da9ecc67b0599565680cee12b424544",
"gklst_url": "http://gkl.st/XttuO"
},
"stats": {
"highfives": 0
},
{
status: "ok",
data: {
total_followers: 1,
followers:
[
{
id: "3aea9cb8ee5c93fdec2a84156cf4a69b8f3c15bc6e8f763ee19599db252bda8a",
name: "Christian Sanz",
screen_name: "csanz",
{
status: "ok",
data:
[
{
user: {
avatar: {
small: "http://a2.twimg.com/profile_images/1690395138/mesmal_normal.jpg",
large: "http://a2.twimg.com/profile_images/1690395138/mesmal.jpg"
},