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
=begin | |
This is my current matching algorithm. It's very database-heavy - with this number of records... | |
>> User.count | |
=> 25 | |
>> Kink.count | |
=> 76 | |
>> Rating.count | |
=> 1900 |
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
# Requires mod_deflate | |
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html |
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
gzip on; | |
gzip_http_version 1.0; | |
gzip_comp_level 2; | |
gzip_proxied any; | |
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; |
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
ActionController::Base.asset_host = Proc.new do |source| | |
# This will give you asset1-asset8.example.com | |
"http://assets#{rand(8) + 1}.example.com" | |
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
@driver.return_response_as_xml = true | |
response = @driver.GSDVOrder(:RequestID => 1) | |
parsed_response = Hpricot::XML(response) |
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
@driver.GSDVOrder(:RequestID => 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
@driver = SOAP::WSDLDriverFactory.new("http://www.webservice.com/services/order.wsdl").create_rpc_driver |
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
# Changes the default date and time string formatters in Rails. See http://j.mp/2nZ022 and http://j.mp/1BRFSf for more info | |
# | |
# >> Time.now.to_s | |
# => "3rd Nov, 2009 10:54 PM GMT" | |
# >> Date.today.to_s | |
# => "3rd Nov, 2009" | |
Time::DATE_FORMATS[:default] = lambda { |time| time.strftime("#{time.day.ordinalize} %b, %Y %I:%M %p %Z") } | |
Date::DATE_FORMATS[:default] = lambda { |date| date.strftime("#{date.day.ordinalize} %b, %Y") } |
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
raise ArgumentError, "Registration type is not 'registration'" unless registration? | |
raise ArgumentError, "TLD does not support automatic registrations" unless supports_automatic_registrations? | |
raise ArgumentError, "Contact information is invalid" unless contact_information_valid? | |
if registration_complete? | |
toggle!(:processed) | |
else | |
return false | |
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
raise ArgumentError, "Registration type is not 'registration'" unless registration? | |
raise ArgumentError, "TLD does not support automatic registrations" unless supports_automatic_registrations? | |
raise ArgumentError, "Contact information is invalid" unless contact_information_valid? | |
if registration_complete? | |
toggle!(:processed) | |
else | |
return false | |
end |
NewerOlder