Skip to content

Instantly share code, notes, and snippets.

require 'amazon_product'
require 'json'
require 'CSV'
products = Hash.new
req = AmazonProduct["us"]
req.configure do |c|
# Get key/secret from Amazon, sign up for Product Advertising API
@jpurcell001
jpurcell001 / gist:5190514
Created March 18, 2013 20:28
Failure case for poltergeist - missed click
require 'rubygems'
require 'bundler/setup'
Bundler.require
require "capybara"
require "capybara/poltergeist"
Capybara.register_driver :webkit do |app|
Capybara::Webkit::Driver.new(app)
end
@jpurcell001
jpurcell001 / gist:5148357
Last active December 14, 2015 21:08
Failure case for capybara master
require 'rubygems'
require 'bundler/setup'
Bundler.require
require "capybara"
require "capybara/poltergeist"
Capybara.register_driver :webkit do |app|
Capybara::Webkit::Driver.new(app)
end
@jpurcell001
jpurcell001 / gist:4646105
Created January 27, 2013 03:30
tpl plugin for requirejs, for loading Underscore templates asynchronously
// RequireJS plugin that loads template files and converts them into
// Underscore-compiled template functions. Inspired by the tpl! plugin at
// https://github.com/abersager/requirejs-tpl.
// Usage:
// - Specify template files as a resource to load with the `tpl!` prefix e.g.
// `tpl!products/productView.html`. If the template has (non-nested) <script>
// or <template> tags, then each script tag will be independently parsed as a template, and
// the set of templates will be returned by the module in a hash, keyed by each
// script's `id` attribute. Otherwise, a single function will be returned by
// the module. This allows multiple small templates to be combined into a single