Send email asynchroniously using Sidekiq.
Create your mailer us usual:
["Africa/Algiers", "West Central Africa"], | |
["Africa/Cairo", "Cairo"], | |
["Africa/Casablanca", "Casablanca"], | |
["Africa/Harare", "Harare"], | |
["Africa/Johannesburg", "Pretoria"], | |
["Africa/Monrovia", "Monrovia"], | |
["Africa/Nairobi", "Nairobi"], | |
["America/Argentina/Buenos_Aires", "Buenos Aires"], | |
["America/Bogota", "Bogota"], | |
["America/Caracas", "Caracas"], |
require "shrine/storage/s3" | |
base_s3_options = { | |
access_key_id: Rails.application.credentials.dig(:aws, :access_key_id), | |
secret_access_key: Rails.application.credentials.dig(:aws, :secret_access_key), | |
region: 'us-east-1', | |
bucket: ENV['SHRINE_S3_BUCKET'], | |
} | |
cache_s3_options = base_s3_options.merge( |
Shrine.plugin :backgrounding | |
Shrine::Attacher.promote { |data| ShrinePromoteWorker.perform_async(data) } | |
Shrine::Attacher.delete { |data| ShrineDeleteWorker.perform_async(data) } |
# encoding: UTF-8 | |
class GxApp | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
include Mongoid::Sequence | |
store_in session: "gxservice" | |
field :name, type: String, default: "Guanxi.me" | |
field :version, type: String |
#1===========First code================ | |
#!/usr/bin/env ruby | |
databases = { | |
:local_db => { | |
:database => 'my_db', | |
:username => 'root', | |
:password => 'admin', | |
:host => 'localhost' |
Rails.application.routes.draw do | |
get '/(:locale)/products/(:category)/(page/:page).:extension', | |
:to => 'products#index', | |
:as => :products, | |
:constraints => { | |
:locale => /[a-z]{2}/, | |
:category => /.+?/, | |
:page => /\d+/ | |
}, |
It sometimes happen you need change code on a machine from which you cannot push to the repo.
You’re ready to copy/paste what diff
outputs to your local working copy.
You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:
1. Generate the patch:
git diff > some-changes.patch