github.com

Internet Explorer until version 9 has some limitations when parsing CSS files Summarized, these are: Up to 31 CSS files...

thoughtbot.com

While both the alt attribute and the figcaption element provide a way to describe images, the way we write for...

...minimal changes. But that's not always the case, and there is a much better way. Use pnpm up (aliased to update and upgrade) with a set of exact library...

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

aaronlasseigne.com

All Rubyists should be familiar with the common definitions for include and extend. You include a module to add instance...

blog.jetbrains.com

RubyMine allows bookmarking lines of code. This is super-helpful when working on a complex problem. I've been using...

We use Sentry to be informed about different kinds of issues. One of the key features is that you are...

github.com

Let the following setup: # my_model_spec.rb describe MyModel do it 'perfoms a test' it_behaves_like 'something shared' end # something_shared.rb shared_examples_for 'something shared' do it 'does something'

...a test' is spec/models/my_model_spec.rb[1:1]. The ID of the ExampleGroup created by it_behaves_like 'something shared' is spec/models/my_model_spec.rb[1:2] as it is the second ExampleGroup in the...

In some projects we have issues with flaky tests. The best default is to fix them all. But in some cases it might be a pragmatic way to retry them...

It is possible to add custom http header to request made by the docker CLI client. This can be used...

...system's environment specifies. This is usually good enough. To test any timezone-dependent behavior in Chrome, you can change the time zone using the Chrome DevTools Protocol. Example

Be careful when using buttons without a type attribute, since browsers will consider them the default submit button of a...

Detect if a gem has been activated A gem is activated if it is either in the current bundle (Gemfile.lock...

So you are comparing two Time objects in an RSpec example, and they are not equal, although they look equal...

Rails 7.1 added the normalizes method which can be used to normalize user input. It lets you define the fields...

journalctl _CMDLINE=dockerd podman journalctl SYSLOG_IDENTIFIER=podman identifying potential filter fields journalctl -o verbose journalctl -o json | jq

makandra dev

While debugging a SPF record I found spf-record.de to be very helpful. it lists all IPs that are covered by...

...either build a ES cluster or you disable the replicas. Building a cluster is beyond the scope of this card, but we can have a look how we can disable...

...localhost:9200/_cat/shards?pretty' | grep UNASSIGNED If it's a replica (r in the column befor the UNASSIGNED) and you are on a single node elasticsearch you need to disable replicas...

Version 1.18.0 of irb introduced a welcome banner. Here is how to disable it, or how to add it to...

When an object is created / updated, various callbacks are executed in this order: before_validation after_validation before_save

A good tool to generate strong passwords and secrets is "apg". You can get it with sudo apt-get install...

unpoly.com

...up-data': {...}.to_json } (el, { key1, key2 }) => Type conversion { 'count': '5' } up.element.numberAttr(el, 'count') Best Practices ✅ Do: Use data-* for simple scalar values Use up-data for objects, arrays, and...

Rails has generic error messages you can define in your locale .yml files. You may override those application-wide error...

index 0000000..a51cbad --- /dev/null +++ b/app/models/apple.rb @@ -0,0 +1,9 @@ +class Apple < Fruit + belongs_to :juice, class_name: 'AppleJuice' + + attr_accessor :type + + def to_s + I18n.t(type, scope: 'fruits.apples...

index 0000000..a51cbad --- /dev/null +++ b/app/models/pear.rb @@ -0,0 +1,9 @@ +class Pear < Fruit + belongs_to :juice, class_name: 'PearJuice' + + attr_accessor :type + + def to_s + I18n.t(type, scope: 'fruits.pears...