$ rails new my-i8n --webpack
Gemfile
gem 'i18n-js'
Capybara.register_server :unicorn do |app, port, host, **options| | |
rackup_opts = Unicorn::Configurator::RACKUP | |
rackup_opts[:host] = host | |
rackup_opts[:port] = port | |
rackup_opts[:set_listener] = true | |
server = Unicorn::HttpServer.new(app, rackup_opts[:options]) | |
server.logger.level = :warn | |
at_exit do | |
trap(:CHLD, nil) | |
server.stop(false) |
$ rails new my-i8n --webpack
Gemfile
gem 'i18n-js'
# this pvc will be used to store downloaded init.sql file | |
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: init-script | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
volumeMode: Filesystem | |
resources: |
# load into test setup after `require 'capybara/rails'` | |
# some sources for below flags and profile settings | |
# https://stackoverflow.com/questions/43143014/chrome-is-being-controlled-by-automated-test-software/43145088 | |
# https://sqa.stackexchange.com/questions/26051/chrome-driver-2-28-chrome-is-being-controlled-by-automated-test-software-notif | |
# http://stackoverflow.com/questions/12211781/how-to-maximize-window-in-chrome-using-webdriver-python | |
# update sources for new Options object | |
# https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings | |
# https://github.com/teamcapybara/capybara/blob/master/lib/capybara/selenium/driver.rb | |
begin |
... | |
action_with_slack_notification = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"] | |
slack[name=%(__name__)s] | |
action = %(action_with_slack_notification)s | |
... |
// WARNING: SIDE-EFFECTS. ONLY FOR PROD VERSION | |
if (!__DEV__) { | |
require('./utils/log.js'); | |
} | |
// SIDE-EFFECTS END |
# this is an example of: config/application.rb | |
require 'rails/all' | |
require 'rspec-rails' | |
# Require the gems listed in Gemfile, including any gems | |
# you've limited to :test, :development, or :production. | |
Bundler.require(*Rails.groups) | |
module UnicornHostedRailsApp |
#Usage: PS1='[$(__active_machine "{%s} ")\u@\h $] | |
EMOJI=🐳 | |
__active_machine() { | |
FORMAT=$1 | |
if ACTIVE=$(docker-machine active 2>/dev/null); then | |
STATE=$(docker-machine status $ACTIVE) | |
if [ "$STATE" = "Running" ]; then | |
unset STATE | |
IP=$(docker-machine ip $ACTIVE) | |
fi |
#!/usr/bin/env python | |
# configure this in my.cnf on a Galera-based MySQL-alike server: | |
# wsrep_notify_cmd=/usr/local/sbin/wsrep_notify_slack | |
# by Tom Gidden <gid@starberry.tv> | |
url = 'https://hooks.slack.com/services/XXXXXXX/XXXXXXXX/XXXXXXXX' | |
import argparse |
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |