From Exploring ES6: Module imports are hoisted (internally moved to the beginning of the current scope). Therefore, it doesn’t matter where you mention them in a module and the...
Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch...
Rails includes a way to see what an e-mail will look like. Integration to RSpec All you need to...
...Gemfile.lock carefully when submitting a commit. Note that the approach in this card works best, if you use bundle outdated together with bundle update some_gem --convervative for major updates...
Recent rails security updates have shown that people make incorrect assumptions about the possible contents of the params hash.
...methods for calculating times and dates, like Duration#ago or Duration#from_now. But beware when using those, because they wont give you Dates or Times but ActiveSupport::TimeWithZone instances...
...your local timezone, but Rails.application.config.time_zone, which has UTC as default value. The mitigation Best case, you have already defined Rails.application.config.time_zone, as we recommend anyway. In this case you...
Text fragments allow linking directly to a specific portion of text in a web document, without requiring the author to...
Today I got a better understanding of how git works, in particular what git checkout and git reset do. Git basics A commit holds a certain state of a directory...
The linked article suggests an interesting way to speed up tests of Rails + Postgres apps: PostgreSQL allows the creation of...
Working with a self-signed certificate is much easier, when the browser accepts it. Google Chrome Warnings from chrome might...
...accept both optional and keyword arguments is dangerous and should be avoided. This confusing behavior will be deprecated in Ruby 2.7 and removed in Ruby 3, but right now you...
end end colored_p(User.new) # ArgumentError: unknown keywords: first_name, last_name This behavior is not very smart. The easy fix is just to never mix optional and keyword...
...not do that and if everything was fine before, maybe just restore the previous behavior by adding environment.loaders.delete('nodeModules') to your environment.js. If you used postcss-cssnext before, add it...
Sometimes you want to fetch associations for an ActiveRecord that you already loaded, e.g. when it has deeply nested associations...
...equal $my-great-blue instead of blue. The reason is that custom property values behave differently and allow any kind of value to be assigned (thus not being bound to...
...I've seen examples using directory but there are no indications this attribute will become standard soon. Feel free to use to feel future-proof. On JavaScript file objects, webkitRelativePath...
In RubyMine folders can be excluded from search, navigation etc. by marking it as excluded. You might sometimes wish to...
...of a datepicker or just the english one. Most often you want to import beside the default JS defined in the package.json the styles of the library.
By default, Devise sends all emails synchronously with deliver_now. To change that, Devise's readme suggests overwriting the send...
Sometimes I ran across a GitHub merge request of a gem where it was not completely obvious in which version...
simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...
People do. Whether consumers or developers, the end users of software are human beings who care about what's in the software. When the software changes, people want to...
...be aware of its security implications. Both variants have options to change their default behaviour. Search engines and redirects If you have a public facing website that ranks on search...
...their expected input (e.g. username, email, current-password, cc-number), browsers can offer a better autocomplete experience. There's a host of possible values. Try it live! Better Mobile Inputs...
Setting array columns When using PostgreSQL array columns, you can set an array attribute to a value with square brackets...