stackoverflow.com

Ruby has this handy block shortcut map(&:to_i) for map { |x| x.to_i }. However, it is limited to argument...

Whenever is a Ruby gem that provides a nicer syntax for writing and deploying cron jobs. Leading zeros are important...

To catch all possible exceptions from a network call, we need to rescue many error classes like this: rescue SocketError...

The method cookies is defined in the ActionController and should never be overwritten. Bad example class StaticPagesController < ApplicationController

When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...

rspec.info

RSpec let's you chain a matcher with .or. The expectation will then pass if at least one matcher matches...

Just like Ruby Gems tag their version releases to the corresponding Git commit, it can be helpful to track production...

guides.rubyonrails.org

TL;DR I18n keys ending with _html are automatically marked as HTML-safe when translating with t('.your_key_html...

CoffeeScript and JavaScript (ECMAScript) both have operators in and of. Each language use them for more than one purpose. There...

When your JavaScript bundle is so massive that you cannot load it all up front, I would recommend to load...

If your rails application is unable to send mails, it might be useful to debug your settings using the rails...

For outputting a given String in HTML, you mostly want to replace line breaks with or tags.

wiki.postgresql.org

When you have a large PG database, you may want to find out which tables are consuming the most disk...

Webpacker uses Babel and Webpack to transpile modern JavaScript down to EcmaScript 5. Depending on what browser a project needs...

Sometimes, the IRB prints a warning during boot: irb: warn: can't alias source from irb_source. Explanation

developer.mozilla.org

Touch devices have their own set of events like touchstart or touchmove. Because mobile browsers should also work with with...

rubydoc.info

CarrierWave comes with some RSpec matchers which will make testing more comfortable. Let's say you have an Uploader like...

Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...

github.com

This might be a known issue with Rubygems 2.5.1. This will help: gem update --system

jsfiddle.net

When you need test images, instead of using services like lorempixel or placehold.it you may generate test images yourself.

If the argument list is the same every time: expect(object).to receive(:foo).with('argument').and_return('response 1...

When you find yourself constantly ignoring a RubyMine warning, you can simple disable that warning and de-clutter your editor...

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