This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based ON https://github.com/ddollar/heroku-autoscale/blob/master/lib/heroku/autoscale.rb | |
# This middleware implements a simple dyno scaler for heroku + rails. Requires Redis. | |
# in Gemfile | |
# gem 'redlock' | |
# in an initializer | |
REDLOCK = Redlock::Client.new([ENV['REDIS_URL']], { retry_count: 0 }) | |
REDIS = RedisClient.new(url: ENV['REDIS_URL']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# aws sdk signing doesn't allow for arbitrary form headers, issue #1399 | |
module Aws | |
module S3 | |
class PresignedPost | |
define_field(:requested_with, 'x-requested-with', starts_with: true) | |
end | |
end | |
end | |
class AmazonSignature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/locales/devise.en.yml | |
en: | |
devise: | |
failure: | |
invalid_token: "Invalid authentication token." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* ^\/assets\/(?:.*\/)?([\w-]+)-[0-9a-f]+\.(ico|css|js|gif|jpe?g|png)$ { | |
try_files $uri @missing_image; | |
} | |
location @missing_image { | |
rewrite ^\/assets(.*)-[0-9a-f]+(\.\w+)$ /assets$1$2 permanent; | |
} |