Skip to content

Instantly share code, notes, and snippets.

Mark McGranaghan mmcgrana

Block or report user

Report or block mmcgrana

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 keybase.md

Keybase proof

I hereby claim:

  • I am mmcgrana on github.
  • I am mmcgrana (https://keybase.io/mmcgrana) on keybase.
  • I have a public key ASDXYWj0J0tYgYI1487IvTW794oGTH7eSp3V7_Ah5-dh1Ao

To claim this, I am signing this object:

View latest-docker.sh
#!/bin/bash
set -euo pipefail
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install lxc-docker -y
View elb_xml.go
package main;
import (
"bytes"
"encoding/xml"
"fmt"
)
var ResponseExample = `
<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
View gist.md

HTTP API Design Guide

(Copy of internal Heroku document for sharing with collaborators.)

Introduction

This guide describes the design of RESTful HTTP+JSON APIs conforming to Heroku’s API conventions. It’s based on our design work for the Heroku Platform API.

This guide informs additions to that API and also guides new internal APIs at Heroku. We hope it’s also of interest to API designers outside of Heroku.

View gist.md

An Gist

This is a thing:

def foo
  puts "bar" + :bat.to_s
end
@mmcgrana
mmcgrana / server.clj
Created Jan 8, 2012 — forked from anonymous/server.clj
http.server example
View server.clj
(ns http.server
(:require [vertx.http :as http]))
(def server (http/server))
(defn vertx-start
[]
(-> server
(http/on-request
(fn [req resp]
View handle.clj
(ns demo.handle
(:import (sun.misc Signal SignalHandler)))
(defn trap-signal [sig f]
(Signal/handle (Signal. sig)
(proxy [SignalHandler] []
(handle [_] (f)))))
(defn trap-shutdown [f]
(let [rt (Runtime/getRuntime)]
View gist:875759
#!/usr/bin/env bash
if [ "$1" == "repl" ]; then
CLASSPATH=$(lein classpath)
JAVA_OPTS="$JAVA_OPTS -Duser.home=$HOME"
JLINE="jline.ConsoleRunner"
exec java $JAVA_OPTS -cp $CLASSPATH $JLINE clojure.main --repl
else
export LEIN_VERSION="1.4.2"
LEIN_PLUGINS="$(ls -1 lib/dev/*jar 2> /dev/null | tr \\n \:)"
View gist:805776
var sys = require('sys');
var fleetdb = require('./fleetdb');
var db = new fleetdb.Database();
db.open('http://127.0.0.1:3400');
var done = 0;
setInterval(function() {
if (done == 100000) {
View gist:805775
var sys = require('sys'),
fleetdb = require('./fleetdb');
var db = new fleetdb.Database();
db.open('http://127.0.0.1:3400');
done = 0;
for(var i=0; i<10000; i++) {
db.query(['ping'], function(status, data) {
done += 1;
You can’t perform that action at this time.