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 Array | |
def rand | |
self[super(self.length)] | |
end | |
end | |
[1, 2, 3, 4, 5].rand #=> 4 |
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
$ gem install refraction |
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
config.gem "refraction" |
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
config.middleware.insert_before(::Rack::Lock, ::Refraction, {}) |
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
Refraction.configure do |req| | |
if req.host == "example.com" | |
req.permanent! :host => "www.example.com" | |
end | |
end |
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 'formula' | |
require 'hardware' | |
class Mongodb <Formula | |
homepage 'http://www.mongodb.org/' | |
aka :mongo | |
if Hardware.is_64_bit? and not ARGV.include? '--32bit' | |
url 'http://downloads.mongodb.org/osx/mongodb-osx-x86_64-1.3.0.tgz' |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<meta name="viewport" content="width=720, user-scalable=yes"/> | |
<meta name="description" content="{MetaDescription}"/> | |
<title>{Title}{block:PostSummary} - {PostSummary}{/block:PostSummary}</title> | |
<!-- DEFAULT COLORS --> |
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
****************************************************** | |
* TICKET #2402-811 *CLOSED* 2010-02-24 * | |
****************************************************** | |
* * | |
* ASSIGNED : n/a * | |
* DEPT CODE : AAV * | |
* CUSTOMER : 84125, James A------ * | |
* WORKSTAION: BCDM-643843 * | |
* SITE : M/BCD * | |
* * |
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
<profile> | |
<site_url>http://www.setformarriage.com</site_url> | |
<url>http://www.setformarriage.com/users/1</url> | |
<user_name>Brad</user_name> | |
<dob>1979-10-12</dob> | |
<gender>male</gender> | |
<seeking>female</seeking> | |
<zip>77054</zip> | |
<photo>http://www.setformarriage.com/system/photos/1/dsh/DSC06644.JPG?1281329860</photo> | |
<description>I am a successful entrepreneur who has a passion for business. Running this website and making it as successful as possible along with helping as many people as I can keeps my fire burning. </description> |
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
# lib/priority_mapper.rb | |
module PriorityMapper | |
extend ActiveSupport::Concern | |
module InstanceMethods | |
def priority_human | |
case priority | |
when 1 | |
'High' | |
when 2 |