If the argument list is the same every time: expect(object).to receive(:foo).with('argument').and_return('response 1...
Don't sum up columns with + in a sql-query if NULL-Values can be present. MySQL and PostgreSQL cannot...
You might have some trouble running a Rails LTS 2 app with MySQL 5.7. If you don't want to...
MySQL and MariaDB have an SQL mode setting which changes how MySQL behaves. The SQL mode value is comprised of...
You need to update a lof gems. Make sure you don't have any version constraints in your...
mysql> SELECT @@global.version; +------------------+ | @@global.version | +------------------+ | 5.6.30 | +------------------+ 1 row in set (0,00 sec) MySQL 5.6 Reference Manual says "BLOB and TEXT...
Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch...
This is a small example on how you can check if your Postgres index can be used by a specific...
When making requests using curl, no cookies are sent or stored by default. However, you can tell curl to re...
By default, browsers will not wrap text at syllable boundaries. Text is wrapped at word boundaries only. This card explains...
We're usually running Ubuntu LTS versions. Sometimes newer hardware requires packages from more recent Ubuntu releases that only come...
Checking if a JavaScript value is of a given type can be very confusing: There are two operators typeof and...
When an Rspec example fails, I usually investigate by running that example again using rspec . However, this does not work...
An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium...
Slides for Henning's talk on Sep 21st 2017. Understanding sync vs. async control flow Talking to synchronous (or "blocking...
TL;DR: Bundler 2.0 will rename Gemfile to gems.rb and Gemfile.lock to gems.locked (sic). The old filenames will be supported...
RSpec allows defining methods inside describe/context blocks which will only exist inside them. However, classes (or any constants, for that...
On my Ubuntu MATE machine, switching applications with ALT + TAB was impossible, because it took nearly 2 seconds. The culprit...
If another session is accessing your database you are trying to reset or drop you might have seen the following...
Use return to return from a method. return accepts a value that will be the return value of the...
I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...
There are many approaches out there how you can import data from a legacy application to a new application. Here...
You should prefer native promises to jQuery's Deferreds. Native promises are much faster than their jQuery equivalent. Native promises...
In the ruby shell (IRB) and rails console the return value of the previous command is saved in _ (underscore). This...