Skip to content

Instantly share code, notes, and snippets.

@grantmichaels
grantmichaels / license
Created January 27, 2010 14:32 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Chris Wanstrath
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
#!/usr/bin/env ruby
require 'fileutils'
def fail!(msg = "Failure!")
puts(msg)
exit(1)
end
REPOSITORY_URL = 'git://github.com/plastictrophy/homebrew.git'
PACKAGE_URL = 'http://github.com/plastictrophy/homebrew/tarball/masterbrew'
echo "deb ftp://mir1.ovh.net/debian/ sid main contrib non-free" > /etc/apt/sources.list
echo "deb-src ftp://mir1.ovh.net/debian/ sid main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert rubygems git-core rake liblibxml-ruby librspec-ruby zlib1g-dev libxml2-dev
gem sources -a http://gems.opscode.com
gem install jeweler merb-core cucumber uuidtools json libxml-ruby --no-ri --no-rdoc
mkdir ~/src
cd ~/src
git clone git://github.com/opscode/chef.git
git clone git://github.com/opscode/ohai.git
@grantmichaels
grantmichaels / Gemfile
Created February 1, 2010 21:04 — forked from rmanalan/.gems
gem 'rack-contrib', :git => 'git://github.com/rack/rack-contrib.git'
gem 'rack-rewrite'
# Config for Nginx to act as a front-end for Riak
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc)
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_)
# Config is in /etc/nginx/sites-available/default or somewhere like that
# Set up load-balancing to send requests to all nodes in the Riak cluster
# Replace these IPs/ports with the locations of your Riak nodes
upstream riak_hosts {
server 127.0.0.1:8098;
;; this file is a walkthrough of Moustache features, a web framework for Clojure
;; http://github.com/cgrand/moustache/tree/master
;; Moustache allows to declare routes, apply middlewares and dispatch on http methods.
;; Moustache is compatible with all frameworks built on Ring, including Compojure
(ns demo
(:use net.cgrand.moustache)
(:require [ring.httpcore :as hc])) ;; hmmm Ring without servlets
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
#!/usr/bin/ruby
#
# I deliberately didn't DRY /usr/local references into a variable as this
# script will not "just work" if you change the destination directory. However
# please feel free to fork it and make that possible.
#
# If you do fork, please ensure you add a comment here that explains what the
# changes are intended to do and how well you tested them.
#
# 14th March 2010:
bonsai
rdiscount