save_and_open_page
have_button(locator)
RSpec.configure do |config| | |
config.before(:suite) do | |
ActiveRecord::Base.establish_connection database['one'] | |
DatabaseCleaner.strategy = :deletion | |
ActiveRecord::Base.establish_connection config.database['two'] | |
DatabaseCleaner.strategy = :deletion | |
end | |
config.before(:each) do |
#!/usr/bin/env ruby | |
# | |
# Wubin Qu <[email protected]> | |
# | |
if ARGV.size != 1 | |
$stderr.puts " | |
Remove blank lines and leading ^M characters | |
Usage: |
# lib/tasks/deploy.rake | |
namespace :deploy do | |
desc 'Deploy to staging environment' | |
task :staging do | |
exec 'mina deploy -f config/deploy/staging.rb' | |
end | |
end |
class ApplicationController < ActionController::Base | |
before_filter :ensure_xhr | |
private | |
def ensure_xhr | |
if request.get? && request.format && (request.format.js? || request.format.json?) | |
head :forbidden unless request.xhr? | |
end | |
end | |
end |
#!/bin/bash -x | |
#=============================================================================== | |
# | |
# FILE: percona-xtrabackup.sh | |
# | |
# USAGE: ./percona-xtrabackup.sh | |
# | |
# DESCRIPTION: Forked from https://gist.github.com/jaygooby/5208373 | |
# | |
# OPTIONS: --- |
require 'benchmark' | |
require 'sidekiq-ent' | |
require 'redis-lock' | |
require 'redis-semaphore' | |
require 'ruby_redis_lock' | |
# monkey patch to remove exponential backoff in pmckee11-redis-lock, | |
# otherwise this benchmark does not complete successfully. | |
class Redis | |
class Lock |
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
For this blog post we will be using ruby version 2.4.0 and rails version 5.1.4 as backend and React/Redux as frontend. Adding Google Sign in functionality in your application can be done in two popular ways.
Adding google sign in functionality in the frontend with google api client gapi
.
Adding google sign in functionality logic in the backend server.
If your application has separate backendend with APIs feeding data to the frontend React application, I suggest you to follow the step 2. If you want yo enhance your application security, then you implement both.