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/ruby | |
#url labels can only be /a-zA-Z0-9-/ | |
urls = [ | |
['Spreedemo-home', 'http://demo.spreecommerce.com/'], | |
['Spreedemo-product', 'http://demo.spreecommerce.com/products/xm-inno-xm2go-portable-satellite-radio-mp3-player-and-home-kit'] | |
] | |
n = 100 | |
cons = [2, 20] | |
results = { "rps" => [], "tpr" => [] } |
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
#### core/lib/spree_core/railtie.rb ##### | |
initializer "spree.environment" do |app| | |
app.config.spree = Spree::Environment.new | |
end | |
initializer "spree.register.payments" do |app| | |
app.config.spree.payment_methods = [ | |
Gateway::Bogus, | |
Gateway::AuthorizeNet, |
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
$('#add_product_name').val('apache'); | |
$('#add_product_name').trigger($.Event('keydown', { which: 34} )); |
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 'sprockets/asset_attributes' | |
Sprockets::AssetAttributes.class_eval do | |
alias_method :sprockets_path_with_fingerprint, :path_with_fingerprint | |
def path_with_fingerprint(digest) | |
if Rails.env.development? | |
pathname.to_s | |
else | |
sprockets_path_with_fingerprint(digest) |
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
Deface::Override.new(:name => 'set_cart_form_enctype', | |
:virtual_path => 'products/_cart_form', | |
:replace => "code[erb-loud]:contains('populate_orders_url')", | |
:text => "<%= form_for :order, :url => populate_orders_url, :html => {:multipart => true} do |f| %>") |
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
desc "Duplicates images from all app/assets directories" | |
task :cache_images_for_development => :environment do | |
image_paths = Rails.application.assets.paths.select {|path| path.ends_with? "/images" } | |
image_paths.reverse.each do |path| | |
Dir.glob(File.join(path, "**/*")) do |file| | |
puts file.to_s.sub(path, '') | |
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
worker_processes 4 | |
preload_app true | |
timeout 30 | |
listen 3000 | |
after_fork do |server, worker| | |
ActiveRecord::Base.establish_connection | |
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
<% if Rails.env.development? %> | |
<% DefaceEditor::Theme.active.each do |theme| %> | |
<% theme.stylesheets.each do |stylesheet| %> | |
<style id="<%= stylesheet.name %>"> | |
<%= stylesheet.css %> | |
</style> | |
<% end %> | |
<% theme.javascripts.each do |javascript| %> | |
<script type="text/javascript" id="<%= javascript.id %>"> |
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 'rubygems' | |
require 'diffy' | |
require 'nokogiri' | |
require 'cgi' | |
module Deface | |
class Parser | |
# converts erb to markup | |
# |