Skip to content

Instantly share code, notes, and snippets.

View dlackty's full-sized avatar
😇

Richard Lee dlackty

😇
View GitHub Profile
@dlackty
dlackty / cloudfront.rb
Created July 28, 2016 16:24
ActionDispatch::RemoteIp trusted proxies for CloudFront
trusted_proxies = ["52.84.0.0/15",
"54.182.0.0/16",
"54.192.0.0/16",
"54.230.0.0/16",
"54.239.128.0/18",
"54.239.192.0/19",
"54.240.128.0/18",
"204.246.164.0/22",
"204.246.168.0/22",
"204.246.174.0/23",
@dlackty
dlackty / aws-sdk.rb
Created October 3, 2016 18:21
Fixing for AWS SDK for Ruby under multi-threading environment
# config/initializers/aws-sdk.rb
require "aws-sdk"
# Threading in modern rails means the AWS autoloading can lead to partially
# loaded namespaces unless we eager load up front. But only do it when we're
# eager loading generally (in production).
Rails.application.config.before_eager_load do
Aws.eager_autoload!
end