- The Clash - The Clash
- Elvis Costello - My Aim Is True
- The Jam - In the City
- The Jam - This Is the Modern World
- Wire - Pink Flag
- The Clash - Give 'Em Enough Rope
- Elvis Costello & The Attractions - My Aim Is True
module AllIfAny | |
def validates_all_if_any(fields, options={}) | |
fields = [fields].flatten | |
all_fields = fields.dup | |
validates_each(fields, options) do |record, attr_name, value| | |
if !(all_fields.find_all{|f| !record.send(f).to_s.empty?}.empty?) | |
record.errors.add(attr_name, (options[:message] || 'is invalid')) if value.to_s.empty? | |
end | |
end |
#!/usr/bin/env ruby | |
require 'benchmark' | |
REGEXPS = [ | |
/^no such file to load -- (.+)$/i, | |
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i, | |
/^Missing API definition file in (.+)$/i, | |
/^cannot load such file -- (.+)$/i, | |
] |
$ gem install bin | |
Successfully installed bson-1.4.0 | |
Successfully installed mongo-1.3.1 | |
Successfully installed multi_json-1.0.3 | |
Successfully installed activesupport-3.1.0 | |
Successfully installed bin-0.7.0 | |
5 gems installed | |
$ gem dependency bin | |
Gem bin-0.7.0 | |
activesupport (~> 3.1.0, runtime) |
BASIC OI (CUCUMBER) KIMCHI | |
-------------------------------------------------------------------------- | |
Oi (cucumber) kimchi is a delicious, refreshing variation on the | |
traditional Korean kimchi recipe. | |
This particular recipe is a modified version of the recipe posted by Dr. | |
Ben Kim, at http://www.drbenkim.com/how-to-make-cucumber-kim-chi.htm. | |
-------------------------------------------------------------------------- |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
I hereby claim:
To claim this, I am signing this object:
class ActiveRecord::Base | |
mattr_accessor :shared_connection | |
@@shared_connection = nil | |
def self.connection | |
@@shared_connection || retrieve_connection | |
end | |
end | |
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
class Account | |
#blahblah | |
def external_management | |
if appdirect? | |
@external_management ||= OpenStruct.new(:user_url => 'blah', :accont_url => 'blah') | |
end | |
end | |
#blahblah | |
end |
(define person (lambda (first last) | |
(define setFirst (lambda (value) (set! first (list-ref value 0)))) | |
(define setLast (lambda (value) (set! last (list-ref value 0)))) | |
(lambda (method . args) | |
(case method | |
('first | |
(if (null? args) | |
first | |
(setFirst args) | |
) |