At makandra, we've built a few gems over the years. Some of these are quite popular: spreewald (> 1M downloads...

As a web developer, you know Google Analytics (GA). Probably you've dropped the GA snippet into more than one...

If possible your code should detect features, not browsers. But sometimes you just need to sniff the browser. And when...

makandra dev
litmus.com

The 90s are calling: they want their tables back. Unfortunately, you need them all for laying out your HTML emails...

caniuse.com

Since late 2015, all major browsers (still excluding Firefox) support pointing device media queries. These can be used to distinguish...

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

makandracards.com

In medium-sized to large Rails applications, asset compilation can take several minutes. In order to speed up deployment, asset...

github.com

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

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

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

hackernoon.com

CSS Flexbox has become extremely popular amongst front-end developers the last couple of years. This isn’t surprising, as...

For applications coming with lots of stylesheets and scripts, asset compilation might take quite long. This can be annoying when...

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

Running rails server will start a local server that you can access via http://localhost:3000. When you are working...

Form fields can be rendered as noneditable by setting the disabled or the readonly attribute. Be aware of the differences...

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

makandra dev

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

This is an extension to PostgreSQL vs MySQL: How to UPDATE using a JOIN. UPDATE employees SET department_name = departments.name...

makandra dev
makandracards.com

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

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