Skip to content

Instantly share code, notes, and snippets.

mikeclymer / api.go
Last active Aug 29, 2015
Testing out using middleware chaining for resource representations and different route contexts. negroni + httprouter
View api.go
package main
import (
func main() {
n := negroni.Classic()
mikeclymer /
Last active Dec 26, 2015
Modification of to create a local Riak 1.4.2 cluster on Mac OS X.
CWD=$(cd $(dirname $0); pwd)
echo "This script will create a local riak cluster for development purposes only."
echo "Prerequisites: install riak using homebrew (tested with v1.4.2)."
echo "The cluster will be created in the current directory."
echo "Riak admin is enabled with no security.\n"
read -p "Enter a name for your cluster [cluster]: " name
View gist:444518
class Feed
include Mongoid::Document
class << self
def type1
self.collection_name = "feeds.type1"
View gist:442385
respond_to :html, :json
def index
respond_with(@feeds = Feed.all) do |format|
format.json { render :json => {
:feeds => @feeds
:callback => params[:callback]
You can’t perform that action at this time.