This file contains 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
#another paste | |
#this time public |
This file contains 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
# Is there a way to combine the should_redirect_to and | |
# should_set_the_flash_to tests since they are repeated | |
# in multiple contexts? | |
context "when valid email addresses passed" do | |
setup do | |
Group.any_instance.expects(:notify_new_memberships).once | |
end | |
context "when separated by commas" do |
This file contains 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
# Is there a way to run mocha expectations against demeter violators? | |
# This is possible with Flexmock, but I grew tired of it. | |
@group.expects('users.from_subdomain').with(subdomain).once |
This file contains 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
This was nuts. On CSPAN-2 last night they were playing the Idaho senate debate from two nights ago. There were four candidates in the race to replace Larry Craig. I thought Minnesota politics was nuts. Highlights: | |
o The Republican, Jim Risch, is ahead by 20 points. | |
o Independent Rex Rammell is the "true conservative" running. | |
o Rammell was asked the "Palin question" (where does he get his news). He proudly said: FOX News, Hannity, and Limbaugh. | |
o Rammell accussed Risch of (a) stealing his land and (b) killing a large part of his elk herd that was running loose. | |
o The other independent's politics I'd loosely qualify as Christian fundamentalist + extreme libertarian | |
o Rammell would charge any woman who has an abortion at any time with murder. | |
o Since the Republican is ahead by 20 points, the independents didn't even address the Democrat, Larry LaRocco. Basically the entire debate was railing against Risch. | |
o Did I mention that the other independent candidate legally renamed himself Pro-Life? He w |
This file contains 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
# When I want to get beginning of day in the time zone set for | |
# the request, not the local machine's time zone. | |
class ::Date | |
def beginning_of_day_in_zone | |
Time.zone.parse(self.to_s) | |
end | |
alias_method :at_beginning_of_day_in_zone, :beginning_of_day_in_zone | |
alias_method :midnight_in_zone, :beginning_of_day_in_zone | |
alias_method :at_midnight_in_zone, :beginning_of_day_in_zone | |
This file contains 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
ActiveRecord::Base.send(:attr_accessible, nil) |
This file contains 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 zone | |
Thread.current[:time_zone] || zone_default | |
end |
This file contains 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 'lib/caching' | |
get '/' do | |
cache(erb(:index, :layout => :main)) | |
end |
This file contains 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
<FilesMatch "\.(ico|pdf|flv|jpe?g|png|gif|js|css|swf)$"> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 year" | |
</FilesMatch> |
This file contains 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
# If you really want safety from Twitter blowing up, this will get you | |
# to 18,446,744,073,709,551,615 tweets. (Remember, mediumint is smaller | |
# than int.) (http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html) | |
class AdjustTwitterIdToUnsignedBigint < ActiveRecord::Migration | |
def self.up | |
change_column :twitter_messages, :twitter_id, "bigint unsigned" | |
end | |
def self.down | |
change_column :twitter_messages, :twitter_id, :integer |
OlderNewer