Skip to content

Instantly share code, notes, and snippets.

View mmclead's full-sized avatar

Mason McLead mmclead

  • Software.com
  • San Diego, CA
View GitHub Profile
@al2o3cr
al2o3cr / presentation.md
Last active March 1, 2019 23:02
50 Ways To Leave Your Method
@swoker
swoker / i18n_redis
Last active November 5, 2020 06:42
Set Redis as I18n Cache in Rails
### Gemfile
gem 'redis', '~> 3.0.2'
gem 'redis-rails', '~> 3.2.3'
### as initializer or in application.rb
$redis = Redis.new(:host => 'localhost', :port => 6379)
# delete all i18n keys before so they will be reloaded
$redis.keys.find_all{|k| k.start_with? "i18n"}.each {|k| $redis.del k}