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 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 elb_xml.go
package main;
import (
"bytes"
"encoding/xml"
"fmt"
)
var ResponseExample = `
<DescribeInstanceHealthResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
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 conclusions.txt
clj-html.core & compojure.html comparison conclusions
be sure to see syntax.clj and performance.clj first
* Interoperability between clj-html.core and compojure.html might be feasble, as
their syntax are similar.
* Helper functions must be written to return html Strings, not vector syntax, if
they are to be used with both libraries.
* clj-html.core is between 1 and 2 orders of magnitude faster than compjure.html.
* Users need to decide how they want to balance the speed of clj-html.core with
View config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ ./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.11.4
## --------- ##
## Platform. ##
View clj
#!/bin/bash
USER_CLJ_DIR=/Users/mmcgrana/Clojure
# Local src, test, and classes
CP=src/:test/:classes/
# Local jars
if [ -d jars ]; then
for file in jars/*.jar; do
View gist:286232
~/remote/ring(clojure-test) $ lein test
[null] Exception in thread "main" java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:1)
[null] at clojure.lang.Compiler.eval(Compiler.java:4658)
[null] at clojure.lang.Compiler.eval(Compiler.java:4633)
[null] at clojure.core$eval__5236.invoke(core.clj:2017)
[null] at clojure.main$eval_opt__7411.invoke(main.clj:227)
[null] at clojure.main$initialize__7418.invoke(main.clj:246)
[null] at clojure.main$null_opt__7446.invoke(main.clj:271)
[null] at clojure.main$main__7466.doInvoke(main.clj:346)
[null] at clojure.lang.RestFn.invoke(RestFn.java:426)
View project.clj
(defproject foo "0.0.1"
:repositories [["clojure-releases" "http://build.clojure.org/releases"]]
:dependencies [[org.clojure/clojure "1.1.0"]
[org.clojure/clojure-contrib "1.1.0"]])
View gist:288863
~/remote/leiningen(master) $ git show-ref HEAD
b6a807bd3350138cfe88821207071378dcba9fdb refs/remotes/origin/HEAD
~/remote/leiningen(master) $ lein deps
[INFO] snapshot leiningen:lein-swank:1.0.0-SNAPSHOT: checking for updates from central
[INFO] snapshot leiningen:lein-swank:1.0.0-SNAPSHOT: checking for updates from clojure-snapshots
[INFO] snapshot leiningen:lein-swank:1.0.0-SNAPSHOT: checking for updates from clojars
[INFO] snapshot leiningen:leiningen:1.0.0-SNAPSHOT: checking for updates from clojure-snapshots
[INFO] snapshot leiningen:leiningen:1.0.0-SNAPSHOT: checking for updates from clojars
[INFO] snapshot leiningen:leiningen:1.0.0-SNAPSHOT: checking for updates from central
View session_thoughts.clj
;; possible functional interface
(defn with-sessions [handler session-store-impl & [opts]] ...)
(defn session [req] ...)
(defn flash [req] ...)
(defn session-assoc [resp key val] ...)
(defn session-dissoc [resp key] ...)
(defn session-set [resp session] ...)
(defn session-drop [resp] ...)
(defn flash-assoc [resp key val] ...)
You can’t perform that action at this time.