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
Spree::Shipment.class_eval do | |
after_save :ensure_destination_charge | |
def ensure_correct_adjustment | |
if order.destination_charges[0] | |
# recalculate | |
else | |
order.destination_charges << create a new one | |
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
def is_subset?(a,b) | |
return true if b and b.is_a? Array and b.empty? # O(1) | |
hash = {} # O(1) | |
a.each{|v| hash[v] = true} # O(n) outer, O(1) inner, O(n) total | |
b.map{|v| hash[v] }.uniq == [true] # O(n) outer, O(1) inner, O(n) total | |
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
Solr::Request::Dismax.class_eval do | |
def to_hash | |
hash = super | |
#hash[:defType] = 'edismax' # Kill this little hardcoded gem in acts_as_solr_reloaded | |
hash[:tie] = @params[:tie_breaker] | |
hash[:mm] = @params[:minimum_match] | |
hash[:qf] = @params[:query_fields] | |
hash[:pf] = @params[:phrase_fields] | |
hash[:ps] = @params[:phrase_slop] |
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 DowncaseUserKeys < ActiveRecord::Migration | |
def up | |
Spree::User.find_each do |user| | |
user.update_attributes :email => user.email.downcase | |
end | |
end | |
def down | |
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
Testing http://www.fcpeuro.com/BMW-parts | |
At Thu May 9 00:00:28 2013 | |
10 loops | |
Fastest Median Slowest Std Dev | |
--------------------------------------------------------------------------- | |
Server performance: | |
Total application time 198ms 210ms 297ms 27ms |
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
Testing http://www.fcpeuro.com/BMW-parts | |
At Thu May 9 00:09:59 2013 | |
10 loops | |
Fastest Median Slowest Std Dev | |
--------------------------------------------------------------------------- | |
Server performance: | |
Total application time 194ms 213ms 440ms 85ms |
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
Testing http://www.fcpeuro.com/BMW-parts | |
At Thu May 9 00:36:03 2013 | |
10 loops | |
Fastest Median Slowest Std Dev | |
--------------------------------------------------------------------------- | |
Server performance: | |
Total application time 193ms 196ms 205ms 3ms |
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
Testing http://www.fcpeuro.com/BMW-parts | |
At Fri May 10 01:35:52 2013 | |
10 loops | |
Fastest Median Slowest Std Dev | |
--------------------------------------------------------------------------- | |
Server performance: | |
Total application time 195ms 216ms 689ms 157ms |
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
a.icon-listen-bl:hover, .event-related .box-title a:hover, .category-related .box-title a:hover, .readmore a:hover, .footer a:hover, .pagination a:hover, .news a:hover, .latest-tweet .date a:hover, .feature .box-header .title a:hover, .caption .title a:hover, .full-agenda-link a:hover, .article a:hover, .medialib-nav a:hover, .timeline-months a:hover, .Timeline .feature .box-footer a:hover, a.icon-listen-bl:active, .event-related .box-title a:active, .category-related .box-title a:active, .readmore a:active, .footer a:active, .pagination a:active, .news a:active, .latest-tweet .date a:active, .feature .box-header .title a:active, .caption .title a:active, .full-agenda-link a:active, .article a:active, .medialib-nav a:active, .timeline-months a:active, .Timeline .feature .box-footer a:active, a.icon-listen-bl:focus, .event-related .box-title a:focus, .category-related .box-title a:focus, .readmore a:focus, .footer a:focus, .pagination a:focus, .news a:focus, .latest-tweet .date a:focus, .feature .box-header .t |
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
denis@s7-391 ~$ gem install spree | |
ERROR: While executing gem ... (Gem::ImpossibleDependenciesError) | |
rails-4.0.0 requires railties (= 4.0.0) but it conflicted: | |
Activated railties-4.0.0 instead of (~> 3.2.0) via: | |
sass-rails-3.2.6, select2-rails-3.4.9, spree_backend-2.1.2, spree-2.1.2 |