Run rails new --help to see all of the options you can use to create a new Rails application:
Output for Rails 8+
Usage:
rails COMMAND [options]
You must specify a command:
Run rails new --help to see all of the options you can use to create a new Rails application:
Output for Rails 8+
Usage:
rails COMMAND [options]
You must specify a command:
| class ConvertToActiveStorage < ActiveRecord::Migration[5.2] | |
| require 'open-uri' | |
| def change | |
| active_storage_blob_statement = ActiveRecord::Base.connection.raw_connection.prepare('active_storage_blob_statement', <<-SQL) | |
| INSERT INTO active_storage_blobs ( | |
| "key", filename, content_type, metadata, byte_size, checksum, created_at | |
| ) VALUES ($1, $2, $3, '{}', $4, $5, $6) | |
| SQL |
| FROM ruby:2.5.1 | |
| ENV LANG C.UTF-8 | |
| RUN apt-get update -qq && \ | |
| apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libpq-dev \ | |
| libfontconfig1 \ | |
| less \ |
Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describeNote the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.
| # app/workers/active_admin_export_worker.rb | |
| class ActiveAdminExportWorker | |
| include Sidekiq::Worker | |
| sidekiq_options queue: 'high' | |
| def perform(options = {}) | |
| model = options[:model_name].classify.constantize | |
| path = "#{Rails.root.to_s}/tmp/#{filename(options[:name])}" | |
| columns = model.send(:column_names) |
| def fill_stripe_elements(card) | |
| using_wait_time(15) { within_frame('stripeField_card_element0') do | |
| card.to_s.chars.each do |piece| | |
| find_field('cardnumber').send_keys(piece) | |
| end | |
| find_field('exp-date').send_keys("0122") | |
| find_field('cvc').send_keys '123' | |
| find_field('postal').send_keys '19335' | |
| end } |
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :developmentThen you'll want to rebuild your Docker container to install the gems
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm