Skip to content

Instantly share code, notes, and snippets.

View revans's full-sized avatar
🤠
Building Empires

Robert Evans revans

🤠
Building Empires
View GitHub Profile
@revans
revans / 0. nginx_setup.sh
Created November 21, 2012 00:32 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@revans
revans / gist:3079723
Created July 9, 2012 23:20 — forked from avalanche123/gist:981817
GitHub Emoji
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@revans
revans / minitest_spec_expectations.md
Created March 15, 2012 18:50 — forked from ordinaryzelig/minitest_spec_expectations.md
How to write MiniTest::Spec expectations

I'm a fan of MiniTest::Spec. It strikes a nice balance between the simplicity of TestUnit and the readable syntax of RSpec. When I first switched from RSpec to MiniTest::Spec, one thing I was worried I would miss was the ability to add matchers. (A note in terminology: "matchers" in MiniTest::Spec refer to something completely different than "matchers" in RSpec. I won't get into it, but from now on, let's use the proper term: "expectations").

Understanding MiniTest::Expectations

Let's take a look in the code (I'm specifically referring to the gem, not the standard library that's built into Ruby 1.9):

# minitest/spec.rb

module MiniTest::Expectations
@revans
revans / vim7.3_mac_install.rb
Created March 11, 2012 18:39 — forked from sirupsen/vim7.3_mac_install.rb
Script to install Vim 7.3 with ruby support for Mac OS X Lion
# requires root permissions in /usr/bin/
star = String.new
8.times { star += "*" }
Star = "\n#{star * 3}\n"
def newblock string
puts "\n#{Star}#{string}#{Star}\n"
end
@revans
revans / gems_install.rb
Created February 27, 2012 18:34 — forked from vvalgis/gems_install.rb
Install gems from a gem list dump
#!/usr/bin/env ruby
#gem_cmd = ENV["GEM_CMD"] || 'sudo gem'
gem_cmd = 'gem'
STDIN.map { |l| l.strip }.each { |l|
gem, versions = l.split(' ', 2)
versions = versions.gsub(/[\(\)]/, '').split(', ')
versions.each { |version|
cmd = "#{gem_cmd} install #{gem} -v #{version} --no-ri --no-rdoc"
@revans
revans / gist:1293745
Created October 17, 2011 20:47 — forked from fennb/gist:1283573
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
@revans
revans / USAGE.md
Created September 12, 2011 15:01 — forked from kossnocorp/USAGE.md
MacVim with Drawer compile manual

Clone & Build

curl https://raw.github.com/gist/1211490/afc8c6ff2221fced522388a4220397c1a7c5ece3/build.sh | sh
@revans
revans / gist:1189555
Created September 2, 2011 19:13 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: Code Wranglers
Favorite Python project: pystache
Favorite Conference: CodeConf
Python Experience Level: Beginner
@revans
revans / Bluepill Uncorn Config File
Created May 18, 2011 02:05
Bluepill used at Halftoneapp.com
#
# Halftoneapp.com Sample Bluepill Configuration File
# Read more at: http://blog.halftoneapp.com
#
# Set paths
home_dir = "/home/railsapp"
rails_shared = "#{home_dir}/app/shared"
unicorn_path = "/path/to/unicorn_rails"
require 'minitest/unit'
require 'minitest/spec'
require 'ansi'
class MiniTest::Unit
include ANSI::Code
PADDING_SIZE = 4
def run(args = [])