Update gemspec. Since 2-2 stable isn't on rubygems yet I add spree to my Gemfile.
gem 'spree', github: 'spree/spree', branch: '2-2-stable'
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 Organizer(c)=c.select{_1=~/^(?!tom)\w{5}/} | |
# Modify the solution above. Emojis are free. | |
# Code below will check correctness. | |
example_collection = [ | |
'apples', | |
33, | |
nil, | |
'hat', | |
'tomatoes', |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
network.host: 127.0.0.1 | |
http.host: 127.0.0.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
# Usage: bundle exec cap staging execute:rake task=db:migrate | |
namespace :execute do | |
task :rake do | |
on roles(:all) do | |
within release_path do | |
with rails_env: fetch(:rails_env) do | |
execute :bundle, "exec rake #{ENV['task']}" | |
end | |
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
Spree::Admin::ProductsController.class_eval do | |
set_callback :load_collection, :after, :show_nothing | |
private | |
def show_nothing | |
@collection = @collection.where '0=1' | |
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
1.9.3-p327 :006 > class TaskBuilder | |
1.9.3-p327 :007?> include ActiveModel::Validations | |
1.9.3-p327 :008?> end | |
=> TaskBuilder | |
1.9.3-p327 :009 > class TaskBuilder | |
1.9.3-p327 :010?> include ActiveModel::Model | |
1.9.3-p327 :011?> end | |
=> TaskBuilder | |
1.9.3-p327 :012 > TaskBuilder.new | |
=> #<TaskBuilder:0x007fdd7a1400a0> |
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
/** | |
* Dit script wordt aangeroepen om een server side versie van de opgevraagde pagina op te leveren. | |
* Hiervoor wordt gebruikt gemaakt van de headless browser phantomjs. | |
* | |
* Alle relative #! urls (zoals bv #!/veilingen/376/kavels/428) worden eerst omgezet naar een absolute | |
* URL zodat er geen links ontstaan zoals: | |
* | |
* https://onlineveilingmeester.nl/seo/?_escaped_fragment_=/kavels?categorie=108#!/veilingen/376/kavels/428 | |
*/ |
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 'base64' | |
require 'rest_client' | |
class ExactOnlineClient | |
def xml_call topic, data=nil | |
if not @cookies | |
# Brutal login technique (as documented (-; ) | |
url = "https://start.exactonline.nl/docs/XMLDivisions.aspx" | |
response = RestClient.post url, {"_UserName_" => username, "_Password_" => password} | |
@cookies = response.cookies |
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
(0.2ms) BEGIN | |
(0.8ms) SELECT COUNT(*) FROM "spree_products" WHERE ("spree_products".deleted_at IS NULL) AND (spree_products.permalink LIKE 'the-other-product%') | |
Spree::Product Load (0.8ms) SELECT "spree_products".* FROM "spree_products" WHERE ("spree_products".deleted_at IS NULL) AND (spree_products.permalink LIKE 'the-other-product%') | |
Spree::Product::Translation Load (0.3ms) SELECT "spree_product_translations".* FROM "spree_product_translations" WHERE "spree_product_translations"."spree_product_id" = $1 [["spree_product_id", 303]] | |
SQL (0.7ms) INSERT INTO "spree_products" ("created_at", "name", "permalink", "shipping_category_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 13 Jan 2014 16:37:20 UTC +00:00], ["name", "The Other Product"], ["permalink", "the-other-product-1"], ["shipping_category_id", 1], ["updated_at", Mon, 13 Jan 2014 16:37:20 UTC +00:00]] | |
SQL (0.5ms) INSERT INTO "spree_product_properties" ("created_at", "product_id", "property_id", "upd |
NewerOlder