Skip to content

Instantly share code, notes, and snippets.

View divineforest's full-sized avatar

Alexander Balashov divineforest

View GitHub Profile
rvm:
- 2.1.3
env:
global:
- DATABASE_URL=postgres://postgres@localhost/app
matrix:
- BUILD_CMD='rspec'
- BUILD_CMD='rake assets:precompile RAILS_ENV=production'
- BUILD_CMD='rake db:setup RAILS_ENV=development'
inherit_from: .rubocop_todo.yml
AllCops:
RunRailsCops: true
Exclude:
- bin/*
- config/**/*
- db/**/*
- Gemfile
stage:
before:
- apt-get install -y zip unzip
- export REDIS_URL=redis://localhost:6379/1
@divineforest
divineforest / wait_for_ajax.rb
Created January 19, 2015 10:31
Capybara wait for AJAX request finished
def wait_for_ajax
return unless respond_to?(:evaluate_script)
wait_until { finished_all_ajax_requests? }
end
def finished_all_ajax_requests?
evaluate_script("!window.jQuery") || evaluate_script("jQuery.active").zero?
end
def wait_until(max_execution_time_in_seconds = Capybara.default_wait_time)
@divineforest
divineforest / gateway.rb
Created February 4, 2015 13:27
Spree example gateway
module Spree
class Gateway::NewGateway < Gateway
preference :login, :string
preference :password, :string
preference :signature, :string
preference :currency_code, :string
def provider_class
ActiveMerchant::Billing::New
end
0xeFE8E473c06FE6bB297534048b0B8167040162dd
var disableTouchMove = function(evt) {
evt.preventDefault();
);
document.body.addEventListener('touchmove', disableTouchMove);
document.body.style.top = '-' + window.scrollY + 'px';