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
# For TLS Connections | |
config.cache_store = :redis_cache_store, { | |
url: ENV.fetch('CACHE_STORE_REDIS_TLS_URL') { ENV['CACHE_STORE_REDIS_URL'] || 'redis://127.0.0.1:6379' }, | |
db: 0, | |
connect_timeout: 20, # Defaults to 20 seconds | |
read_timeout: 1, # Defaults to 1 second | |
write_timeout: 1, # Defaults to 1 second | |
reconnect_delay: 1.5 , | |
reconnect_delay_max: 10.0, | |
reconnect_attempts: 10, # Defaults to 0 |
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
# Rails controller concern to enable Devise authentication for ActiveStorage. | |
# Put it in +app/controllers/concerns/blob_authenticatable.rb+ and include it when overriding | |
# +ActiveStorage::BlobsController+ and +ActiveStorage::RepresentationsController+. | |
# | |
# Optional configuration: | |
# | |
# Set the model that includes devise's database_authenticatable. | |
# Defaults to Devise.default_scope which defaults to the first | |
# devise role declared in your routes (usually :user) | |
# |
This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
Operator Mono w/ Italics on OSX Vim
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
codigo = " p 'hello world' " | |
pp Ripper.lex(codigo) # Paso 1, Tokenizacion | |
# [[[1, 0], :on_sp, " "], | |
# [[1, 1], :on_ident, "p"], | |
# [[1, 2], :on_sp, " "], | |
# [[1, 3], :on_tstring_beg, "'"], | |
# [[1, 4], :on_tstring_content, "hello world"], | |
# [[1, 15], :on_tstring_end, "'"], |
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
/* Place model */ | |
module.exports = { | |
attributes: { | |
name: { | |
type: 'string', | |
required: true | |
}, |
if you got this error while requesting the application via JSON request:
exception ActionController::InvalidAuthenticityToken
backtrace":"[\"/home/uadmin/.rvm/gems/ruby-2.1.7/gems/actionpack-4.2.4/lib/action_controller/metal/request_forgery_protection.rb:181:in `handle_unverified_request'\",
\"/home/uadmin/.rvm/gems/ruby-2.1.7/gems/actionpack-4.2.4/lib/action_controller/metal/request_forgery_protection.rb:209:in `handle_unverified_request'\",
...
pry -r ./config/app_init_file.rb
-- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
-- load your rails into a pry session
NewerOlder