Skip to content

Instantly share code, notes, and snippets.

@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@mbland
mbland / README.md
Created October 1, 2012 14:51 — forked from JanDupal/README.md
Quick'n'dirty Jekyll plugin for sorted cycle

Jekyll sorted_for plugin

Quick'n'dirty Jekyll plugin for sorted cycle.

Install

Copy sorted_for.rb to _plugins/ directory of your Jekyll site.

Usage

Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
# since authentication could fail on any type of method, we need
# to set it for the failure app so it is routed to the correct block
env['REQUEST_METHOD'] = "POST"
end
@BinaryMuse
BinaryMuse / gist_tag.rb
Created January 31, 2011 00:44
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@richardlawrence
richardlawrence / gist:1299371
Created October 19, 2011 19:17
Convert a Capybara table to something you can diff with a Cucumber table
# change 'table' to a more specific selector when the page will have more than one table
find('table').all('tr').map { |row| row.all('th, td').map { |cell| cell.text.strip } }
@thewebfellas
thewebfellas / nginx.conf
Created January 28, 2009 16:19
sample nginx.conf for thin
user nginx;
worker_processes 5;
error_log /var/log/nginx.error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
# Our own variable where we deploy this app to
deploy_to = "/srv/example.com"
current_path = "#{deploy_to}/current"
shared_path = "#{deploy_to}/shared"
shared_bundler_gems_path = "#{shared_path}/bundler_gems"
# See http://unicorn.bogomips.org/Sandbox.html
# Helps ensure the correct unicorn_rails is used when upgrading with USR2
Unicorn::HttpServer::START_CTX[0] = "#{shared_bundler_gems_path}/bin/unicorn_rails"
@mbleigh
mbleigh / Gemfile
Created March 21, 2012 03:14
Non-Rails Rackup with Sprockets, Compass, Handlebars, Coffeescript, and Twitter Bootstrap
source "https://rubygems.org"
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
gem 'handlebars_assets'
gem 'coffee-script'
@rcreasey
rcreasey / solo_data_bags.rb
Created May 12, 2011 05:21
Using data bags with chef-solo
From: Brian Akins < brian@akins.org>
To: chef < chef@lists.opscode.com>
Subject: [chef] Data bag implementation for chef-solo
Date: Tue, 1 Feb 2011 10:42:05 -0500
We often use chef-solo for quick testing, etc. This is our extremely simple implementation of data bags for chef-solo. Add "data_bag_path /some/dir/data_bags" to your solo.rb and add this into your libraries:
if Chef::Config[:solo]
class Chef
module Mixin
module Language