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

...the puppetdb_query feature. This can result in more complex code but has several benefits: you can use more complex puppetdb queries to get the resources you want than with...

makandracards.com

So you're hunting down a regression (or just a bug) and want to use git bisect to find out...

makandra dev
github.com

...large number of ActiveRecord objects only to collect its ID. Edge Rider has a better way. Your relations gain a method #collect_ids that will fetch all IDs in a...

...number of ActiveRecord objects only to collect its column value. Edge Rider has a better way. Your relations gain a method #collect_column that will fetch all column values in...

Geordi provides a pretty neat way to generate beautiful commit messages according to your stories in Linear: geordi commit Geordi reads from a .geordi.yml file inside your repo and connects...

...using a multiple assignment for a Regex are named groups. Especially when your Regex becomes more complicates it is easier to understand and to process. Note: In case a string...

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

You can use nmap to find out what service is running behind a given port, and most often see some details about it. This can be helpful if...

Rails offers the fresh_when method to automatically compute an ETag from the given record, array of records or scope...

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

The default configuration of Rails disables CSRF protection in tests. If you accidentally forget to send the CSRF token for...

...like keeping some HTML. If you only care about line breaks, you might be better off using a small, specialized helper method: def format_linebreaks(text) safe_text = h(text...

...the CSS property white-space: pre-wrap. With pre-wrap two line breaks will behave like , they do not actually produce elements. You can call simple_format with custom sanitization...

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

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

...the HTML required attribute. We usually turn it off due to difficulties controlling its behavior and appearance. Instead we only mark required fields with an asterisk (*) next to its label...

...after submitting the form due to the now displayed error messages. A compromise with better accessibility is to add the aria-required attribute in this case. This allows screen readers...

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

makandra dev

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

simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...

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.

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

...fills in the query "foo" Also see An auto-mapper for ARIA labels and BEM classes in Cucumber selectors

In the Gitlab settings the flag Auto-cancel redundant pipelines is enabled by default. This auto-cancels pipelines with jobs...

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