Native promises have no methods to inspect their state. You can use the promiseState function below to check whether a...

github.com

rack-cargo gives your API a new /batch route that lets clients perform multiple API calls with a single request...

ActiveRecord::RecordNotFound errors provide quite meaningful error messages that can provide some insight on application details. Consider the following:

api.rubyonrails.org

Rails 5 (don't know about the others) comes with an initializer wrap_parameters.rb. Here you can tell rails to wrap...

Put the line below in the respective env.rb file to make your action controllers raise an ActionController::UnpermittedParameters error when...

Webpack is the future. We're using it in our latest Rails applications. For tests, we want to compile assets...

github.com

When storing a file with Carrierwave, it is always cached prior to actually storing it (to support form roundtrips).

This card will show you a cool way to define a class using Struct.new. A common usecase for Structs are...

Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...

makandra dev

If you use the Better Errors gem, you will sometimes notice that it can be very slow. This is because...

Nowadays it is fairly easy to intercept and modify mails globally before they are sent. All you have to do...

This is useful if, for example, you want to use a background-image that has to scale with the width...

stackoverflow.com

This card will show you how to use git rebase --onto without confusion. Use case You've got two feature...

jakearchibald.com

TLDR: Browser implementations of HTTP/2 push are horrible. You might end up with worse performance than without pushing. However, the...

By default Middleman generates files with a .html extension. Because of this all your URLs end in /foo.html instead of...

Middleman is a static page generator that brings many of the goodies that Rails developers are used to.

rspec.info

In modern default RSpec configurations, your tests are usually run in random order. This helps to detect "flickering" tests that...

This card compares patterns to store trees in a relation database like MySQL or PostgreSQL. Implementation examples are for the...

jetbrains.com

RubyMine provides a visual tool for resolving merge conflicts locally. Follow Git > Resolve Conflicts in the context menu to open...

github.com

The parallel-gem is quite easy to use and can speed up rendering time if you want to render the...

Imagine the following HTML structure, where the scrolling container has overflow-y: scroll: +--scrolling container+-+ | | | +-child element+----+ | | | ++iframe++ | | | | | | | | | | | | | | +-----------------------+ | | | | <-- actually cut...

When you load a dump for development, records may reference images that are not available on your machine.

blog.jetbrains.com

RubyMine allows bookmarking lines of code. This is super-helpful when working on a complex problem. I've been using...

When filling out forms in Selenium tests, Chrome shows the (usual) bubble, asking to store those credentials. While the bubble...