...index: true option. Use it only inside create_table or for add_reference (= add_belongs_to) statements, and use add_index for other cases. Never use index: true but only...

Performing COUNT(*) on large tables is slow. Sometimes you don’t need the exact number once results exceed a certain...

...all Unpoly updates work using AJAX requests, you won't get the more detailled better_errors page with the interactive REPL. Below is an event listener that automatically repeats the...

...full CSS and JavaScript. The code assumes you are using Ruby on Rails with better_errors, which is the default error view that modern Rails versions employ. If you are...

makandra Curriculum

How to write an issue Issue format Read the card Project management best practices: Issues. Gatekeeping Get familiar with our Gatekeeping process. In particular you should understand the...

...intensive for large files Other ways to solve this problem Other solutions might work better and make more sense depending on what you are trying to achieve. These alternatives could...

When you don't only have a favicon.ico in your project but also PNGs of different sizes and backgrounds, you...

makandra Operations

JSON Web Tokens are often times used for authentication delegation from one system to another. They can be decoded for...

...you obviously do not want to duplicate it and your tests might very well benefit from this approach. Use it with care, however -- doing this more than a few times...

...making the test impossible to read). An alternative is also to hide that functionality behind other steps that do more complex things differently...

postgresql.org

TL;DR PostgreSQL handles Rails 4+ text and string columns the same. Some libraries may still reflect on the column...

This cards describes an example with a Github Client on how to keep your Rails application more maintainable by extracting...

github.com

The parallel-gem is quite easy to use and can speed up rendering time if you want to render the...

Resources RubyGuides: Mastering Ruby Regular Expressions Using regular expressions in JavaScript Testing regular expressions visually Regular Expressions: Quantifier modes...

When you want to group rails models of a logical context, namespaces are your friend. However, if you have a...

makandra dev

Knowing when to refactor Just feeling like refactoring is not a good reason to do it. Make an educated decision...

When you use Sentry to monitor exceptions, an important feature is Sentry's error grouping mechanism. It will aggregate similar...

By default subscript ( ) and superscript ( ) tags are styled with vertical-align: sub, respectively vertical-align: super by most browsers.

When HTTP clients make an request they can define which response formats they can process. They do it by adding...

makandra dev

...change the rendered html, some variation of @message.content.body.to_rendered_html_with_layout Changing the behavior of the editor You may want to add some functionality to the editor or remove...

...addEventListener("trix-action-invoke", event => { const { editor } = event.target if (event.actionName === "x-horizontal-rule") { // ... } // Add behavior for the other buttons // ... }) Check the Trix README to check what you can do.

Spammers have started abusing other application to send their spam. This works like this: The application has some form that...

There is no one-liner in Ruby or ActiveSupport with the behavior described above. There have been discussions about adding a method like Enumerable#find_map:

Let's say you have a gem which has the following module: # within the imaginary super gem module SuperClient

...t have control of. Solutions Don't log SQL queries. This is the default behavior of rails but can be changed in the config/environment/production.rb file: config.log_level should not be...

...not scale the icon with the font size. One option that seems to work better is to use the mask CSS feature. The idea is to have an element with...

...var(--icon-url) center / contain no-repeat // this can probably be done in a better way: vertical-align: text-bottom margin-bottom: -.1em // depends on the icons @each $icon in...

kernel.org

...John Doe <user@example.com> Date: Thu Dec 23 13:37:00 2010 +0100 make everything better Once you are done bisecting you can go back with git bisect reset