Skip to content

Instantly share code, notes, and snippets.

View barrywoolgar's full-sized avatar

Barry Woolgar barrywoolgar

View GitHub Profile
@shioyama
shioyama / webpacker_sync.rake
Last active June 24, 2020 13:34
Sync files from Rails webpacker manifest.json to S3 asset bucket.
# Sync files from webpacker manifest.json to S3 asset bucket.
# Based on asset_sync but much simplified for this case.
#
# Requirements
#
# Add fog to Gemfile.
#
# Environment variables:
# - AWS_S3_ASSETS_BUCKET_NAME
# - AWS_S3_REGION
@smanolloff
smanolloff / setenv.sh
Last active July 4, 2018 11:16
MacOS: optimize RVM ruby in Sublime Text 3
#!/bin/sh
rvmdir="$HOME/.rvm"
rubyversion=$(${rvmdir}/bin/rvm-auto-ruby -e 'puts ENV.fetch("RUBY_VERSION")')
export PATH="${rvmdir}/gems/${rubyversion}/bin"\
":${rvmdir}/gems/${rubyversion}@global/bin"\
":${rvmdir}/rubies/${rubyversion}/bin"\
":${rvmdir}/bin"\
":$PATH"
@danielfone
danielfone / devise_safe_store_location.rb
Last active May 20, 2020 13:10
Monkey-patch to prevent Devise from causing CookieOverflow errors
# config/initializers/devise_safe_store_location.rb
module SafeStoreLocation
MAX_LOCATION_SIZE = ActionDispatch::Cookies::MAX_COOKIE_SIZE / 2
def store_location_for(resource_or_scope, location)
super unless location && location.size > MAX_LOCATION_SIZE
end
end