$ 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 | |
| ... |
| # Since Ruby preserves hash key insertion order, you can iterate over values. | |
| request_hash = Hash.new { |h, k| h[k] = {} } | |
| # Used to convert event timestamps to epoch time. | |
| wall_time_offset = nil | |
| # Note: Calling logs.get() will clear the log buffer. | |
| performance_logs = page.driver.browser.manage.logs.get('performance') | |
| # Extract request / response data from log messages. |
| // 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 <[email protected]> | |
| url = 'https://hooks.slack.com/services/XXXXXXX/XXXXXXXX/XXXXXXXX' | |
| import argparse |