Skip to content

Instantly share code, notes, and snippets.

View dtuite's full-sized avatar
🚀
Shipping

David Tuite dtuite

🚀
Shipping
View GitHub Profile
@bhaberer
bhaberer / submodule_strategy.rb
Last active December 8, 2024 08:47 — forked from stevenscg/submodule_strategy.rb
Capistrano 3.1.x Strategy to deploy git projects with submodules.
# Usage:
# 1. Drop this file into lib/capistrano/submodule_strategy.rb
# 2. Add the following to your Capfile:
# require 'capistrano/git'
# require './lib/capistrano/submodule_strategy'
# 3. Add the following to your config/deploy.rb
# set :git_strategy, SubmoduleStrategy
module SubmoduleStrategy
# do all the things a normal capistrano git session would do
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@nbibler
nbibler / gist:5307941
Last active August 26, 2024 20:44
A .powrc file which works with RVM's .rvmrc or .ruby-version (+ .ruby-gemset) configuration files.
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
@unixcharles
unixcharles / problem.rb
Created October 29, 2012 11:33
DelegateClass and "superclass mismatch for class" errors
require 'delegate'
class Klass < DelegateClass(String)
# ...
end
class Klass < DelegateClass(String)
# Re-open the class
end
# => TypeError: superclass mismatch for class Klass
@dtuite
dtuite / json_matcher.rb
Created September 14, 2011 14:18
RSpec2 JSON matcher
# RSpec2 JSON Matcher for functional/controller tests
# Webrat usage example:
#
# it "should be the JSON representation" do
# get :show, id: object.id, format: :json
# response.body.should be_json_eql object.to_json
# end
require 'rspec/expectations'
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install: