stackoverflow.com

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...

guides.rubyonrails.org

When your Rails controller calls render, you can pass a :status option for the HTTP status code: render 'results', status...

makandra dev

When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use...

I recently had fun with replacing a custom video plattform ("mycustomtv") in one of our applications. I learned a lot...

Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch...

When you have a pending Cucumber step (or feature) that also uses an existing VCR cassette, your pending test may...

makandra dev

ActiveSupport::Dependencies takes care of auto-loading any classes in development. This is usually useful, but when you run into...

makandra dev
fontawesome.com

Font Awesome version 5 changed some icon names, and introduces new prefixes fab, far, and fas. There is a JavaScript...

TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...

This is a small example on how you can check if your Postgres index can be used by a specific...

This is painful. Consider using Microsoft Office or switching careers. If you need to write < 20 letters consider doing it...

github.com

The issue: You are using stub_const to change a constant value for your test. stub_const "SomeClass::CONST", 'test...

blog.bigbinary.com

This error is raised because your old database does not have a configured environment yet, which Rails 5 enforces.

makandra dev
makandracards.com

Rails applications and ruby gems should have a README that gives the reader a quick overview of the project. Its...

You should avoid using application models in your migrations. But how else could you create records in a migration?

Situation: You want to write a spec for a function inside an Angular service. This function at some point makes...

By default, browsers will not wrap text at syllable boundaries. Text is wrapped at word boundaries only. This card explains...

makandra dev

Git has two kind of tags: annotated lightweight Annotated tags are stored as full objects in the Git database. They...

georgemauer.net

If your application exports CSV, be advised that Excel and other spreadsheet applications treat certain cells (those starting with =, +, - or...

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...

makandra dev

An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium...

When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup...

Browsers support different types of redirects. Be very careful with these status codes: 301 Moved Permanently 308 Permanent Redirect