Within Vim do the following: Move cursor to the first starting line where you want to start editing

video.yahoo.com

Web performance expert Nicole Sullivan discusses a set of best practices in the creation of supremely fast, visually impactful web sites...

...but review your final commit before pushing. Look out for changes that don't belong to your issue (and are usually in place you never touched) when you open a...

makandra dev

...fixed. However, as your frontend adds more JavaScript, AJAX and animations, this test might become "flaky". Flaky tests destroy the trust in your test suite ("I thought this is always...

...before raising NoSuchElementError. This is sufficient for basic, server-rendered application. However, as frontends become more complex (more JavaScript, AJAX requests, animations), race conditions will become too severe to be...

...is already present in the gem. Try to write your code so that everyone believes it has been there from the beginning. When adding files, you need to require them...

...yourself. Look around how similar files are being required, and try to find the best spot. Your last resort is lib/$gem_name.rb. One thing to keep in mind is that...

...model can either hold a concrete owner class (like. e.g. User) or a polymorphic belongs_to or multiple optional belongs_to associations. class CreateBlobOwnerships < ActiveRecord::Migration[7.2] def change

...false, foreign_key: true, index: true t.timestamps end end end # app/models/blob_ownership.rb class BlobOwnership < ApplicationRecord belongs_to :active_storage_blob, class_name: 'ActiveStorage::Blob' belongs_to :user end class CustomDirectUploadsController < ActiveStorage...

If you use Selenium and Launchy to open web pages, you might run into an error saying "Your Firefox profile...

thoughtbot.github.io

Let's say you have two factories that share some attributes and traits: FactoryBot.define do factory :user do screen_name...

Capybara allows you to filter elements that are focused. page.find(:fillable_field, focused: true) # Filtering only fillable inputs for performance...

Jasmine has spyOnProperty(), but it only works if the property is implemented using getter and setter functions. This is a...

...made within the transaction are rolled back and the exception is re-raised. To better understand how ActiveRecord handles exceptions within a transaction, here is the implementation of ActiveRecord::Base...

...above has all the issues that the transaction-less copy_invoice example at the beginning of this article had. In addition, it might lose money transactions.

We recommend configuring Selenium's unhandled prompt behavior to { default: 'ignore' }. When running tests in a real browser, we use Selenium. Each browser is controlled by a specific...

...when performing most options, like a simple visit or execute_script from Capybara. Different behaviors While drivers default to dismissing user prompts, you can change that. Specifically, the specification describes...

So you downloaded a theme for Chrome a while ago and don't remember which one it is?

Before any technical considerations, you need to understand the old system as best as possible. If feasible, do not only look at its API, or database, or frontend...

If your Webpack build is slow, you can use the Speed Measure Plugin for Webpack to figure out where time...

...to be performed around a deploy. Be it to notify operations about changed application behavior, be it to run a little oneline script after the deploy. Most database-related stuff...

If your project depends on an old version of ImageMagick that you can no longer install in your system, you...

The sidekiq-rate-limiter gem allows rate-limiting Sidekiq jobs and works like a charm. However, it needs to be...

...squash these small commits to meaningful, bigger ones. When merging into master it's better to have only few (or maybe just one!) commits. Each of them should have a...

...it with a (lead) developer before it is ready. The backlog Every issue should begin its life in the icebox and only be moved to the backlog if it is...

"Open-source software (OSS) is great. Anyone can use virtually any open-source code in their projects." Well, it depends...

# => 3 "foo".class # => String "foo".html_safe.length # => 3 "foo".html_safe.class # => ActiveSupport::SafeBuffer The behavior of SafeBuffer differs from a String in one way only: When you append a String...

...if it is safe. To achieve this we can simply use SafeBuffer's concatenation behavior: # ✔️ Safe def group(content) html = "".html_safe html << " ".html_safe html << content html << " ".html_safe...

makandra dev
ruby-doc.org

...used for case-equality. In general it tells if the object on the right "belongs to" or "is a member of" the object on the left: String === "hello" # true

If you are using Angular and want something like Rails' simple_format which HTML-formats a plain-text input into...