Skip to content

Instantly share code, notes, and snippets.


Jimmy Le Thai jlthai

  • Batch
  • Saint Augustine, Fl
  • Twitter @jlthai
View GitHub Profile
jlthai / app_config.rb
Last active Jan 28, 2019
Quick way to use ENVs from Heroku config while using Rails 5.2 style credentials for development.
View app_config.rb
module AppConfig
def self.get(key)
env_val = ENV[key.to_s]
return env_val if env_val.present?
rails_credentials = Rails.application.credentials
# Tries finding a key with the first part being nested first.
# :aws_access_key_id will attempt to grab
# { aws: { access_key_id: 'val' } }

Keybase proof

I hereby claim:

  • I am jlthai on github.
  • I am jlthai ( on keybase.
  • I have a public key ASATtXHznXlbRw7deVF1U_CjZoZrDb_w6fR02a4YFXWu4Ao

To claim this, I am signing this object: