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...
Rails defines a #truncate helper as well as a method String#truncate. = truncate("my string", length: 5) = "my string".truncate...
The 90s are calling: they want their tables back. Unfortunately, you need them all for laying out your HTML emails...
Ruby has this handy block shortcut map(&:to_i) for map { |x| x.to_i }. However, it is limited to argument...
Here is how to model basic logic in media queries. AND With keyword and. # Target viewport widths between 500 and...
Since late 2015, all major browsers (still excluding Firefox) support pointing device media queries. These can be used to distinguish...
RSpec let's you chain a matcher with .or. The expectation will then pass if at least one matcher matches...
Browsers' printing methods usually don't print background colors. In most cases this is the desired behavior, because you don...
There is a kinda secret, yet well supported CSS feature called currentColor. It's like a special CSS variable that...
TL;DR Append your locale keys with _html to have them marked as html_safe and translate them with = t...
Using the JS fullscreen API is painful because all browers use different methods and events and you need to use...
When your application is running on a multi-server setup, application logs are stored per server (unless you choose a...
By default, Capistrano truncates server responses and places an ellipsis at the end of lines that are longer than your...
When your JavaScript bundle is so massive that you cannot load it all up front, I would recommend to load...
You know that you can use jQuery's text() to get an element's contents without any tags.
For outputting a given String in HTML, you mostly want to replace line breaks with or tags.
Webpacker uses Babel and Webpack to transpile modern JavaScript down to EcmaScript 5. Depending on what browser a project needs...
Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...
CSS Flexbox has become extremely popular amongst front-end developers the last couple of years. This isn’t surprising, as...
Form fields can be rendered as noneditable by setting the disabled or the readonly attribute. Be aware of the differences...
When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use...