Skip to content

Instantly share code, notes, and snippets.

Dan MacTough danmactough

Block or report user

Report or block danmactough

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View domain-cluster-example.js
var cluster = require('cluster');
var PORT = +process.env.PORT || 1337;
if (cluster.isMaster) {
// In real life, you'd probably use more than just 2 workers,
// and perhaps not put the master and worker in the same file.
cluster.on('disconnect', function(worker) {
AndreasMadsen /
Last active Nov 2, 2019
Playing with smartos
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

View gist:2795214
import sys
import csv
import httplib, urllib, base64
def main():
# set the name of your repository, username and password
username = "test"
password = "test"
repo = "test"
erikh /
Created Mar 31, 2012 — forked from DAddYE/
OSX For Hackers
#!/usr/bin/env sh
# This is script with usefull tips taken from:
# install it:
# curl -sL | sh
tj / routes.js
Created Oct 15, 2011
Express routes
View routes.js
var app = require('../app');
console.log(' \033[90m%s \033[36m%s\033[0m', route.method.toUpperCase(), route.path);
View index.js
var mongoose = require('mongoose');
mongoose.connect('localhost', 'testing_535');
console.error('mongoose version', mongoose.version);
var OID = mongoose.Types.ObjectId;
var ASchema = new mongoose.Schema({
square: mongoose.Schema.ObjectId
, task: Number
View http-and-https.js
var express = require('./')
, http = require('http')
, https = require('https')
, app = express.createServer();
You can’t perform that action at this time.