Skip to content

Instantly share code, notes, and snippets.

View gen1321's full-sized avatar
🏠
Working from home

Boris Beginin gen1321

🏠
Working from home
View GitHub Profile
AmzLookUp.item_lookup(query:{'ItemId' => 'B000CST01A'}).to_h["ItemLookupResponse"]["Items"]["Item"]
mLookupResponse"]["Items"]["Item"]
=> {"ASIN"=>"B000CST01A",
"DetailPageURL"=>
"http://www.amazon.com/LiftMaster-Chamberlain-315MHz-Wireless-377LM/dp/B000CST01A%3FSubscriptionId%3DAKIAI42PXZ2Q3M2SUVBQ%26tag%3Dmborisbeginin-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000CST01A",
"ItemLinks"=>
{"ItemLink"=>
[{"Description"=>"Technical Details",
"URL"=>
"http://www.amazon.com/LiftMaster-Chamberlain-315MHz-Wireless-377LM/dp/tech-data/B000CST01A%3FSubscriptionId%3DAKIAI42PXZ2Q3M2SUVBQ%26tag%3Dmborisbeginin-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB000CST01A"},
MAX_WORKERS_IN_QUEUE = 2000
def self.get_products
find_each do |result|
wait_for_sidekq
GetProductsWorker.perform_async(result.id)
end
end
def self.wait_for_sidekq
DEPRECATION WARNING: [Devise] config.email_regexp will have a new default on Devise 4.1
To keep the current behavior please set in your config/initializers/devise.rb the following:
Devise.setup do |config|
config.email_regexp = /\A[^@\s]+@([^@\s]+\.)+[^@\W]+\z/
end
If you want to use the new default:
Devise.setup do |config|
<%= message.subject %>
<%= message.render_body.html_safe %>
<%= message.published_at%>
require 'rails_helper'
describe "the signin process", :type => :feature do
before :each do
AdminUser.create(:email => 'user@example.com', :password => 'password')
end
let(:sign_in) { visit '/admin'
within("#session_new") do
fill_in 'Email', :with => 'user@example.com'
fill_in 'Password', :with => 'password'
require 'rails_helper'
describe History ,type: :model do
let(:member){ create(:member) }
let(:channel){ create(:channel) }
let(:create_sub){create(:subscription )}
it 'should be created after subscribe' do
expect{create_sub}.to change{History.count}.by(1)
end
class CreatePermissions < ActiveRecord::Migration
def change
create_table :permissions do |t|
t.integer :publisher_id
t.integer :channel_id
t.timestamps null: false
end
end
end
# == Schema Information
#
# Table name: users
#
# *id*:: <tt>integer, not null, primary key</tt>
# *email*:: <tt>string, default(""), not null</tt>
# *encrypted_password*:: <tt>string, default(""), not null</tt>
# *reset_password_token*:: <tt>string</tt>
# *reset_password_sent_at*:: <tt>datetime</tt>
# *remember_created_at*:: <tt>datetime</tt>
#require 'rubygems'
#require 'Celerity'
require 'nokogiri'
require 'watir-webdriver'
require "open-uri"
#b.goto 'bit.ly/watir-webdriver-demo'
#b.text_field(:id => 'entry_1000000').set 'your name'
#b.select_list(:id => 'entry_1000001').select 'Ruby'
#b.select_list(:id => 'entry_1000001').selected? 'Ruby'
@gen1321
gen1321 / simple-capistrano-docker-deploy.rb
Created April 9, 2016 21:38 — forked from johnbintz/simple-capistrano-docker-deploy.rb
Simple Capistrano deploy for a Docker-managed app
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"