When your controller action raises an unhandled exception, Rails will look at the exception's class and choose an appropriate...
By convention, common protocols use a defined port, like 80 for HTTP or 443 for HTTPS. You can use nmap...
When building a web application, one is tempted to claim it "done" too early. Make sure you check this list...
All new browsers support the new object-fit CSS property. It allows to specify how an element behaves within its...
Macs render fonts bolder than they are, especially on dark background. This can be fixed by configuring the font smoothing...
Reading user input in console applications is usually done using Kernel#gets. Stubbing that can be a bit hairy.
When testing Ruby code that prints something to the terminal, you can test that output. Since RSpec 3.0 there is...
It claims to be even faster and brings a new plugin that polyfills object-fit and object-position. This allows...
Spreewald gives you the within meta step that will constrain page inspection to a given scope. Unfortunately, this does not...
When you find yourself in the situation that you would like to define a custom matcher in your specs, but...
To delay your entire Jasmine test suite until the DOM is ready, add the following: beforeAll(function(done) { $(done); });
fake_stripe spins up a local server that acts like Stripe’s and also serves a fake version of Stripe.js...
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...
OAuth requires a set of params to be carried along requests, among which a nonce. Some libraries pass these along...
When creating an index using CREATE INDEX, Postgres will create a B-Tree type index by default. The B-Tree...
Current webkit browsers like Chrome and Safari have a special variable in their consoles that refers to the selected DOM...
The NestedHash class allows you to read and write hashes of any depth. Examples: hash = {} NestedHash.write hash, 'a', 'b', 'c...
Enter any command into explainshell and it will explain it to you: split into separate commands (if present), with each...
If you want to inspect the compiled code of your erb (or haml) templates, you can run the following code...
RSpec provides a nice diff when certain matchers fail. Here is an example where this diff is helpful while comparing...
Don't write resources :people, :concerns => :trashable Write resources :people do concerns :trashable end Why Writing a controller...
If you want to configure your nginx to drop connections to a specific location, you can do so by responding...
Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...