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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'cinch' | |
bot = Cinch.setup do | |
server 'irc.freenode.org' | |
nick 'cardroid' | |
channels %w[#namaste_bitches] | |
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
!!!!! DEPRECATION NOTICE !!!!! | |
The WWW constant is deprecated, please switch to the new top-level Mechanize | |
constant. WWW will be removed in Mechanize version 2.0 | |
You've referenced the WWW constant from /Users/yossef/bin/southwest_checkin:22, please | |
switch the "WWW" to "Mechanize". Thanks! | |
Sincerely, | |
Pew Pew Pew |
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 Object | |
def to_bool | |
TrueClass === self | |
end | |
end | |
class Numeric | |
def to_bool | |
return false if self == 0 | |
return true | |
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
source :gemcutter | |
gem 'bundler', '0.9.25' | |
gem 'net-sftp', '2.0.4' | |
gem 'state_machine', '0.9.1' | |
gem 'rails', '2.3.5' | |
gem 'authlogic', '2.1.3' | |
gem 'haml', '3.0.3' | |
gem 'whenever', '0.4.2' | |
gem 'will_paginate', '2.3.12' |
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
$ irb | |
irb(main):001:0> things = %w[one two three] | |
=> ["one", "two", "three"] | |
irb(main):002:0> things.inject([]) do |result, item| | |
irb(main):003:1* result + [ [item, "#{item} fish"], [item*2, "#{item} doubled"]] | |
irb(main):004:1> end | |
=> [["one", "one fish"], ["oneone", "one doubled"], ["two", "two fish"], ["twotwo", "two doubled"], ["three", "three fish"], ["threethree", "three doubled"]] | |
irb(main):005:0> | |
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 initialize(options = {}) | |
load_config | |
set_options(options) | |
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
photos = photos[0, photos.size > limit ? limit : photos.size] | |
############################################################# | |
@order_type = (params[:order_type])?params[:order_type]:"New" |
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 Invitation < ActiveRecord::Base | |
# Returns encoded invitation id | |
def encoded_id | |
self.id*10011981 * 1820062 - 1981 | |
end | |
def self.decode_id(id) | |
i = ((id.to_i + 1981)/1820062)/10011981 | |
if (i*10011981 * 1820062 - 1981)==id.to_i | |
begin |
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
Thing = Struct.new(:a, :b, :c) do | |
def some_thing | |
end | |
end | |
class Thing | |
attr_accessor :d | |
alias_method :old_brackets, :[] | |
def [](m) |