...browser.execute_cdp('Network.clearBrowserCache') browser.execute_cdp('Network.emulateNetworkConditions', offline: false, latency: -1, # ms, unlimited downloadThroughput: kbps * 1024 / 8, uploadThroughput: kbps * 1024 / 8, ) end Then 'the Cumulative Layout Shift score should be good...

...entries = entryList.getEntries() entries = dedupe(entries, 'startTime') // Debugging // entries.forEach((item, i) => { // console.dir(item) // console.log( // `${i + 1} current LCP item : ${item.element}: ${Math.max(item.startTime - getActivationStart(), 0)}`, // ) // if (item.element) item.element.style = 'border: 5px dotted lime...

...function takes a third argument with a normalization setting. For example, a normalization of 1 will divide the rank by 1 + the logarithm of the document length: class Message < ApplicationRecord...

...Arel.sql("search_tsvector @@ #{query_sql}")) .order(Arel.sql("ts_rank_cd(search_tsvector, #{query_sql}, 1) DESC")) } # ... end There are many normalization strategies. See the PostgreSQL documentation for a list.

makandra dev

...NOTE: this image ships with a recent version of chrome! services: postgres: image: postgres:17 env: POSTGRES_DB: test POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres PGTZ: "Europe/Berlin" options: >- # Set health...

...checks to wait until postgres has started --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: [ '5432:5432' ] env: DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL...

...you continue, ensure that you've created your certificate in the region us-east-1 (N. Virginia). Otherwise the certificate is not available for CloudFront. The issue

I don't know why this error occurs, but after wasting over 1 hour of time trying to get the certificate to show up in the CloudFront console...

...have so far found this fix necessary and tested it on Lenovo P14s Gen 1 Lenovo T14 Gen 1 Observing the situation To get a good overview about load, cpu...

...system and install throttled: $ sudo apt install git build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev python3-cairo-dev python3-venv python3-wheel $ git clone https://github.com...

...constraint. For example, you can tell Sentry to notify you only if it occurs 10 times per hour. Sentry currently offers three constraints when ignoring an issue:

Occurrences (1 time, 10 times, ..) Number of affected users

Install the latest bundler version: gem install bundler Fetching bundler-2.3.5.gem Successfully installed bundler-2.3.5 1 gem installed Update the bundler version in Gemfile.lock: bundle update --bundler Confirm it worked:

...cannot use the latest bundler 2 version, so you need to stay on bundler 1...

...match?(/[[:space:]]/) # => true "\n".match?(/[[:space:]]/) # => true nbsp = "\xC2\xA0".encode!(Encoding::ISO_8859_1) # => "\xA0" nbsp.match?(/[[:space:]]/) # => Encoding::CompatibilityError (incompatible encoding regexp match (UTF-8 regexp with ISO...

# => true "\n".match?(/\p{Zs}/) # => false nbsp = "\xC2\xA0".encode!(Encoding::ISO_8859_1) # => "\xA0" nbsp.match?(/\p{Zs}/) # => Encoding::CompatibilityError (incompatible encoding regexp match (UTF-8 regexp with ISO...

makandracards.com

...Elasticsearch to Opensearch This card deals with specifics concerning the use of searchkick. Step 1: Make Opensearch available for Searchkick In your Gemfile # Search gem 'searchkick' # needs to be...

...if forces connections via https, which we don't have in local environments. Option 1: With plugins Create a Dockerfile FROM opensearchproject/opensearch:2.11.0 RUN /usr/share/opensearch/bin/opensearch-plugin list | grep 'ingest-attachment' || /usr/share/opensearch/bin/opensearch-plugin...

...first argument. Compare these two different ways of calling fun() in Ruby: # Ruby array = [1, 2, 3] fun(array) # same as fun([1, 2, 3]) (1 argument) fun(*array) # same...

...as fun(1, 2, 3) (3 arguments) Depending on your culture the spreading of array elements into multiple argument slots is called "splat args" or "spread args" or "rest operator...

So according to IEEE floating point definition only numbers between -(2^53 - 1) (-9007199254740991) and 2^53 - 1 (9007199254740991) can safely be represented in JavaScript. Note that ECMAScript...

...ppa_ubuntu_dists_jammy_main_binary-amd64_Packages | paste - - | column -t Package: git Version: 1:2.41.0-0ppa1~ubuntu22.04.1 Package: git-all Version: 1:2.41.0-0ppa1~ubuntu22.04.1

...cvs Version: 1:2.41.0-0ppa1~ubuntu22.04.1 Package: git-daemon-run Version: 1:2.41.0-0ppa1~ubuntu22.04.1 Package: git-daemon-sysvinit Version: 1:2.41.0-0ppa1~ubuntu22.04.1 Package: git-doc...

...fully permitted parameters object. You never want that. Why? Because it introduces potential vulnerabilities. [1] Even if you are sure that nobody else accesses the params object after your code...

...be. Be careful what you use it; we have a separate card on that. [1] For example: If params are assigned to model attributes, your model won't complain, since...

...user_input, { class: 'paragraph' }, { sanitize_options: { tags: [], attributes: [] } }) will result in Hello World alert(1) For Rails versions that don't support this option, consider using a custom method...

...change completely for 2.0, so you might find a bunch of unrelated documentation for 1.2 Here is an example, what smarter_csv does for you: Input: first name,last name...

Dan,McAllister,2,,, Lucy,Laweless,,5,, Miles,O'Brian,,,,21 Nancy,Homes,2,,1, Output: [ {first_name: 'Dan', last_name: 'McAllister', dogs: '2'}, {first_name: 'Lucy', last_name: 'Laweless...

...slider--item.is-current, [aria-label="slider's item that is current"]' when /^the (.*)$/ match = $1 match =~ /^(.+?)(?:'s (.+?))?(?: that (.+))?$/ bem_selector = '.' bem_selector << selectorify($1) bem_selector << '--' << selectorify($2) if...

...selector = '[aria-label="' aria_selector << match.gsub('"', '\\"') aria_selector << '"]' [bem_selector, aria_selector].join(', ') when /^"(.+)"$/ $1 else raise "Can't find mapping from \"#{locator}\" to a selector.\n" + "Now, go and...

I, [2024-01-21T06:22:17.484221 #2698200] INFO -- : [4cdad7a4-8617-4bc9-84e9-c40364eea2e4] test I, [2024-01-21T06:22:17.484221 #2698200] INFO -- : [4cdad7a4-8617-4bc9...

...84e9-c40364eea2e4] more I, [2024-01-21T06:22:17.484221 #2698200] INFO -- : [6e047fb3-05df-4df7-808e-efa9fcd05f87] test I, [2024-01-21T06:22:17.484221 #2698200] INFO -- : [6e047fb3...

...integration tests: Capybara.register_driver :chrome do |app| options = Selenium::WebDriver::Chrome::Options.new options.browser_version = '138.0.7204.183' Capybara::Selenium::Driver.new(app, browser: :chrome, options:) end The first time you run a test...

...chromedriver version is installed to the cache ~/.cache/selenium/. You will notice a delay of ~1 minute. Note: This setup does not work, when you use the Rails driven_by method...

...is also suggested by Rubocop's Style/GlobalVars cop. Example before: if 'foo' =~ /foo/ puts $~[1] # => foo end Example after: if 'foo' =~ /foo/ puts $LAST_MATCH_INFO[1] # => foo end

...sort the number of requests for a single IP address. Bash Command awk '{ print $1}' test.log | sort | uniq --count Result 1 87.140.79.41 3 87.140.79.42 Explain awk '{ print $1}' test.log...

87.140.79.41 87.140.79.42 87.140.79.42 87.140.79.42 uniq --count [1] 1 87.140.79.41 3 87.140.79.42 [1] -c, --count: prefix lines by the number of occurrence

...example.metadata[:type] # => "controller" From an example itself or a before block, query self.class.metadata. RSpec 1 Unfortunately, RSpec 1 doesn't offer such filters, and the helpful metadata isn't around...

...in a spec that knows about request and response You can use the RSpec 1 approach to find out if your current example knows about RSpec's request and response...

...ActiveRecord::Base.establish_connection(config) end it 'should synchronize processes on the same lock' do (1..20).each do |i| fork_with_new_connection do @reader.close ActiveRecord::Base.connection.reconnect! Lock.acquire('lock') do...

...a typo or similar lines.each_slice(2) do |start, finish| start.should =~ /Started: (.*)/ start_thread = $1 finish.should =~ /Finished: (.*)/ finish_thread = $1 finish_thread.should == start_thread end @reader.close end end Caveats

...approaches in Rails, how you can assign such an association via HTML forms. Option 1: Array column One way to solve the problem is using a database column with an...

...We need to take care of not assigning nil as value of posts Option 1: Using with_defaults! in the controller + include_hidden: false in the form (used in the...

...column_value(value) method in active record is traced (simplified output): git log -n 1 --pretty=oneline -S 'convert_number_column_value(value)' -- activerecord/lib/active_record/base.rb ceb33f84933639d3b61aac62e5e71fd087ab65ed Split out most of the...

...activerecord/lib/active_record/base.rb - def convert_number_column_value(value) - if value == false - 0 - elsif value == true - 1 - elsif value.is_a?(String) && value.blank? - nil - else - value - end - end activerecord/lib/active_record/attribute_methods/write.rb + def convert_number_column...