The way that Javascript schedules timeouts and promise callbacks is more complicated than you think. This can be the reason...
As your Rails project grows, you will accumulate a number of small patches. These will usually fix a bug in...
When you find yourself in the situation that you would like to define a custom matcher in your specs, but...
ActiveRecord offers an explain method similar to using EXPLAIN SQL statements on the database. However, this approach will explain all...
When dealing with time zones in Rails, there is one key fact to keep in mind: Rails has configurable time...
Expecting a primitive value as an argument to a method invocation is easy: expect(object).to receive(:foo).with('arg1...
This card existed before, but was outdated due to browser implementation changes. The information below is validated for the current...
RSpec provides a nice diff when certain matchers fail. Here is an example where this diff is helpful while comparing...
If you are on a Linux shell and want to open a file with whatever default application is configured for...
TL;DR There are three dimensions you can control when scoping routes: scope module: 'module', path: 'url_prefix', as: 'path...
Talking with APIs makes more fun using Postman. As an alternative you can also use command line tools like cURL...
Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...
Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...
If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...
A HTTP 302 Found redirect to PATCH and DELETE requests will be followed with PATCH or DELETE. Redirect responses to...
Note The maintenance mode is enabled on all application server as soon as the file /public/system/maintenance.html is present. Installation
The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g...
Ruby has the class Proc which encapsulates a "block of code". There are 2 "flavors" of Procs: Those with "block...
A very informative and interesting presentation about browsing performance, looking at efforts Google Chrome takes to increase it.
You can use mail-tester.com to check your application's e-mails for issues that might cause e-mails to be...
git rebase -i -> mark your commit with edit git reset HEAD~ (remove the marked commit, but keep its...
By pressing Ctrl + Shift + V you can select a recently copied string for pasting.
Ruby has a set of methods to convert an object to another representation. Most of them come in explicit and...
Our applications not only need to be functional, they need to be fast. But, to quote Donald Knuth, premature optimization...