...would allow to detect the end of windows size changing process. Capybara provides a better way to manipulate the browser window which you should use instead: page.current_window.resize_to. Good: Capybara...

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

...as isolated (more unit like) tests, one might want to test some cookie dependent behavior as a request, helper or model spec too. Since the rspec documentation on testing cookies...

...that into a class to DRY up your code and write solid unit tests. Beware that your class will not be able to read the cookies, since they are only...

class Post < ActiveRecord::Base has_one :attachment end # attachment.rb class Attachment < ActiveRecord::Base belongs_to :post validates :title, presence: true end Issue When creating a post with an invalid...

...Rails docs, e.g. Array#to_sentence String#dasherize Hash#slice Object#presence Libraries The best way to learn about a Ruby gem, Javascript libary, etc. is often to find the...

http://unpoly.com https://lodash.com/ https://fontawesome.com/icons Web Platform (HTML, JavaScript, CSS) The best reference to look up information on HTML tags, JavaScript features or CSS properties is the...

github.com

...find(..., visible: true) or find(..., visible: :visible). Note that you could change the default behavior by setting the ignore_hidden_elements config option. However, ignoring invisible elements is a useful...

Modern CSS offers the field-sizing property to allow elements to automatically adjust size (width and/or height) to fit their...

thoughtbot.com

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

Some tasks in a web application are better not done live when a user request a page, but in the background. Examples are longer running tasks tasks that are not...

...been accepted for 7 days. Learn about Sidekiq Read Sidekiq's Readme Read Sidekiq best practices Read Sidekiq Error Handling Understand how to schedule jobs, and work them off

makandracards.com

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

makandra dev

...changes you make to the database will be rolled back on exit. Warning Changes beyond the database (deleting files, sending emails, etc) cannot be rolled back...

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

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

If you need to pre-generate a scram-sha256 password hash for use with postgres, e.g. for using it with...

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

...shared_examples_for can have parameters. You can simply hand over arguments from it_behaves_like: shared_examples_for 'string equaling another string' do |expected_string| it 'is equal to...

...subject).to eq(expected_string) end end describe 'some string' do subject { 'foo' } it_behaves_like 'string equaling another string', 'foo' end RSpec 1 Use it_should_act_like from...

Capybara provides execute_script and evaluate_script to execute JavaScript code in a Selenium-controlled browser. This however is not...

When users type into a Tom Select control, the options list is updated with a short delay which can feel...

haml.info

...nesting level of elements. When it comes to white-space preserving content, this may become a problem: the content will be rendered including the HTML indentation. Problematic: Preserved Indentation

%pre = content Reference Hello World Better: Without Extra Indentation Render with tilde ~ instead of equals = to keep Haml from indenting content: .nest %span Reference %pre ~ content Reference

When setting up cronjobs, commands somtimes output something every time. If these commands don't support limiting their output to...

The default configuration of Rails disables CSRF protection in tests. If you accidentally forget to send the CSRF token 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...

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

Rails' url_for is useful for generating routes from a Hash, but can lead to an open redirect vulnerability.