This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
:update_sources: true | |
:sources: | |
- http://rubygems.org/ | |
- http://gemcutter.org | |
gem: --no-ri --no-rdoc | |
:verbose: true | |
:backtrace: false | |
:benchmark: false | |
:bulk_threshold: 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Last login: Mon Oct 31 21:45:40 on ttys000 | |
~$ bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) | |
Cloning into rvm... | |
remote: Counting objects: 5846, done. | |
remote: Compressing objects: 100% (2786/2786), done. | |
remote: Total 5846 (delta 3840), reused 4144 (delta 2306) | |
Receiving objects: 100% (5846/5846), 1.95 MiB | 2.32 MiB/s, done. | |
Resolving deltas: 100% (3840/3840), done. | |
RVM: Shell scripts enabling management of multiple ruby environments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
last_date_header = nil | |
# Items should be sorted by date already | |
for item in items | |
if last_date_header != item.date | |
# Output item.date | |
last_date_header = item.date | |
end | |
# Output item |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'digest/md5' | |
require 'digest/sha1' | |
require 'zlib' | |
n = ARGV[0] ? ARGV[0].to_i : 100_000 | |
input = ARGV[1] || ENV.inspect | |
puts "#{n} times, #{input.size} characters" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
DIR=/tmp/watchdog | |
# Create dir if it doesn't exist | |
if [ ! -d $DIR ]; then | |
mkdir $DIR | |
fi | |
cd $DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Ashton | |
is: a | |
!douchebag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def event(type, message) | |
events type, [message] | |
end | |
def events(type, messages) | |
messages.map! { |message| envelope type, message } | |
suppress_redis_errors do | |
redis.pipelined do | |
while messages.any? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=/usr/bin/gcc-4.2 | |
if [ -x $CC ]; then | |
export CC | |
fi | |
rvm 1.9.3@project --create --install | |
rvm_project_rvmrc_default=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Contact | |
include ActiveModel::Validations | |
validates_presence_of :name, :subject, :body | |
validates :email, | |
:presence => true, | |
:format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i } | |
validates :verify, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Ability do | |
let(:admin_user) { mock AdminUser } | |
it { Ability.should include(CanCan::Ability) } | |
it { Ability.should respond_to(:new).with(1).argument } | |
context "admin" do | |
before :each do |