Haml lets you prefix a group of attributes by wrapping them in a hash. This is only possible with the...
Option 1: JSON dump In config/webpack/environment.js you can get inspect environment which includes all webpack config options set for the...
As a web developer, you know Google Analytics (GA). Probably you've dropped the GA snippet into more than one...
Why secure-only cookies used to be necessary Cookies have an optional secure flag. It tells the browser to not...
Background information about session storage in Rails Rails has a default mechanism to store the session in the CookieStore. This...
If you want to fill in textareas with multiple lines of text (containing line breaks / new lines) you can use...
If possible your code should detect features, not browsers. But sometimes you just need to sniff the browser. And when...
On some machines, installing Ruby 1.8.7 with ruby-build can lead to this error: math.c:37:13: error: missing binary...
Rails defines a #truncate helper as well as a method String#truncate. = truncate("my string", length: 5) = "my string".truncate...
Ruby has this handy block shortcut map(&:to_i) for map { |x| x.to_i }. However, it is limited to argument...
Whenever is a Ruby gem that provides a nicer syntax for writing and deploying cron jobs. Leading zeros are important...
To catch all possible exceptions from a network call, we need to rescue many error classes like this: rescue SocketError...
The method cookies is defined in the ActionController and should never be overwritten. Bad example class StaticPagesController < ApplicationController
When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...
RSpec let's you chain a matcher with .or. The expectation will then pass if at least one matcher matches...
Just like Ruby Gems tag their version releases to the corresponding Git commit, it can be helpful to track production...
TL;DR I18n keys ending with _html are automatically marked as HTML-safe when translating with t('.your_key_html...
CoffeeScript and JavaScript (ECMAScript) both have operators in and of. Each language use them for more than one purpose. There...
When your JavaScript bundle is so massive that you cannot load it all up front, I would recommend to load...
If your rails application is unable to send mails, it might be useful to debug your settings using the rails...
For outputting a given String in HTML, you mostly want to replace line breaks with or tags.
When you have a large PG database, you may want to find out which tables are consuming the most disk...
Webpacker uses Babel and Webpack to transpile modern JavaScript down to EcmaScript 5. Depending on what browser a project needs...
Sometimes, the IRB prints a warning during boot: irb: warn: can't alias source from irb_source. Explanation