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

makandra dev
developer.mozilla.org

Here is how to model basic logic in media queries. AND With keyword and. # Target viewport widths between 500 and...

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

Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...

rspec.info

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

guides.rubyonrails.org

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

github.com

Using the JS fullscreen API is painful because all browers use different methods and events and you need to use...

When your application is running on a multi-server setup, application logs are stored per server (unless you choose a...

By default, Capistrano truncates server responses and places an ellipsis at the end of lines that are longer than your...

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

You know that you can use jQuery's text() to get an element's contents without any tags.

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

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

jsfiddle.net

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

begriffs.com

The attached article explains options you have to store the order of items in a database table. The simplest solution...

Boot partitions from installations prior to the 16.04 era are terribly small. When you install updates and encounter errors due...

MySQL and MariaDB have an SQL mode setting which changes how MySQL behaves. The SQL mode value is comprised of...

api.rubyonrails.org

Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...

When you have string contents (e.g. a generated binary stream, or data from a remote source) that you want to...

You need to update a lof gems. Make sure you don't have any version constraints in your...