...is to encode the string using JSON, and then escaping all code points above 127 using unicode escape sequences: escapeHighASCII('{"foo":"xäy"}') // => '{"foo":"x\\u00e4y"}' Escaping high ASCII in JavaScript...

...function escapeHighASCII(string) { let unicodeEscape = (char) => "\\u" + char.charCodeAt(0).toString(16).padStart(4, '0') return string.replace(/[^\x00-\x7F]/g, unicodeEscape) } Escaping high ASCII in Ruby def escape_high_ascii(string...

digitalocean.com

...enabled for node. Installing nvm DigitalOcean has a HOWTO for installing nvm on Ubuntu (16.04, 18.04, 20.04) that I recommend. During the installation of node via nvm, a compatible version...

...to be done separatly for each node version on your system, though. Install yarn 1 system-wide via apt The yarn package depends on the nodejs debian package, but with...

...shutdown the Elasticsearch cluster, as soon as everything works as expected. flowchart TB subgraph "1" A0[App]-- Search -->ES0[Elasticsearch] A0[App]-- Update -->ES0[Elasticsearch] OS0[OpenSearch] end

...please refer to the breaking changes linked below. On request we may provide OpenSearch 1.x corresponding to Elasticsearch 7.x. How do you update your application? This depends on...

...S3 Bucket ohne Public access erstellt Wende das Modul für die Region eu-west-1 an Füge zu deinem Modul das managen eines VPC hinzu. Das VPC soll jeweils...

...Public und 3 Private Subnetze (je eines für 1 AZ) aber nur 1 public NAT Gateway haben. Die 3 Private Subnetze sollen Internet Zugriff haben. Erweitere dein Terraform modul um...

...you might want to enable logging for the chromedriver itself. Here is how. Option 1: Use Selenium::WebDriver::Service In your test setup, you may already have something like Capybara...

...can also start chromedriver yourself in a terminal on a custom port: chromedriver --port=12345 --verbose --log-path=/tmp/chromedriver.log Then configure Selenium to connect to that port. Like in option...

An example would be an AngularJS application where the following HTML actually works. [1] Hello Capybara will fail to find that link, even though looking it up via the...

...and click_link work, simply add href="#" to your element: Hello >> find_link("Hello") => # [1] Note that while it does work in your application (links are usually styled correctly, and...

makandra Curriculum

...distinction between virtual pixels vs. physical pixels. Understand how raster images prepared for a 1:1 pixel ratio look like on high density displays. Understand which classes of devices typically...

makandra dev

...a video with a very low resolution and framerate) Create a 21s video with 1fps and 10x10 resolution: ffmpeg -t 21 -s 10x10 -r 1 -f rawvideo -pix_fmt rgb24...

.../dev/zero sample_21_seconds.mp4 Option Explanation -t 21 set the length to 21s -s 10x10 set the resolution the 10 by 10 pixel -r 1 set the framerate to 1...

masilotti.com

...quite manageable. Let’s dive into how this works. Only few fixture per model (1-2 is enough in most cases) You should only have a minimal amount of fixtures...

...User.count == 3 end Good example: test "user can be created" do assert_difference "User.count", 1 do post users_path, params: { first_name: "Foo", last_name: "Bar" } end end Conclusion

...install -dm 755 /etc/apt/keyrings wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee...

...a version string) is easy: $ mkdir -p ~/.config/mise/config.toml $ echo '[tools]' > ~/.config/mise/config.toml $ sed -i 's/\([^ ]*\).*/\1 = "latest"/' .tool-versions >> ~/.config/mise/config.toml Now you can just run mise upgrade and it will bring...

...this releases the commit we need c67e8d8 o Merge pull request #44641 from SkipKayhil/fix-rubocop-errors 1afe117 o Update CHANGELOG [ci skip] 87528db o Revert "Merge pull request #43209 from mpestov/check-basic-auth-credentials"

...branch '6-1-sec' into 6-1-stable 6607333 │ o Preparing for 6.1.4.7 release 1f66424 │ o bumping version b0b5eaf │ o Added image trasnformation validation via configurable allow-list

...setup such a layout nvme0n1 259:0 0 931.5G 0 disk ├─nvme0n1p1 259:1 0 1G 0 part /boot/efi ├─nvme0n1p2 259:2 0 2G 0 part /boot

...crypt-0 252:0 0 928.4G 0 crypt └─ubuntu--vg-ubuntu--lv 252:1 0 928.4G 0 lvm / Reboot Install BTRFS tools: apt install btrfs-progs Set filesystem...

Execute one query per involved table with a condition like...

...WHERE id IN (123, 125, 170). Execute a single query for a huge table joined from all involved tables...

ActiveRecord prefers option 1, probably because it is less costly. But as soon as your conditions reference another table (like other_table.column), ActiveRecord will go with option 2 and build a...

makandra dev
github.com

...margin_top: '200px', # Height of the header, can be px or mm margin_bottom: '150px', # Height of the footer, can be px or mm header_spacing: 52.197, # margin_top converted...

...number or the custom JSON encoded hash: function allQueryInformation() { var pdfInfo = {}; var queryStrings = document.location.search.substring(1).split('&'); for (var query in queryStrings) { if (queryStrings.hasOwnProperty(query)) { var keyValuePair = queryStrings[query].split...

...saves CPU time and reduces the bandwidth cost for a request/response exchange to about 1 KB. The most efficient way to produce and compare ETags are the fresh_when and...

...exploit, especially in 2023: The attacker needs to force the victim to make about 1000 requests. The attacker needs to be within the same local network as the victim, so...

...explains some options to make browsers wrap inside a long word like "Donaudampfschifffahrt". Option 1: hyphens CSS property (preferred) Modern browsers can hyphenate natively. Use the hyphens CSS property:

The hyphens property has good browser support. If you need to support Safari < 17, you may need to also set -webkit-hyphen. If a browser lacks the dictionary for...

...rows, migration performance becomes an issue. We will talk about this in another card. 1. Use the full power of SQL Plain SQL can be very powerful. Once you get...

select_all('SELECT * FROM articles') # => [ { 'name': 'Bioshock Infinite', 'price': 40.0 }, { 'name': 'EVOLAND', 'price': 19.0 } ] As an example, we have Article has_many :vendors. We now introduce a boolean flag...

...to use our own daho.im service. All daho.im subdomains resolve to your local IP (127.0.0.1). That means you can use a different hostname for different apps, and you will stay...

...logged in in each app: http://foo-app.daho.im:3000 => 127.0.0.1 http://bar-app.daho.im:3000 => 127.0.0.1 http://bam-app.daho.im:3000 => 127.0.0.1 Caution It's safe to use daho.im since it's our own domain. Don't use...

makandra dev

$ ruby --yjit -e "puts RubyVM::YJIT.enabled?" true # via ENV variable $ RUBY_YJIT_ENABLE=1 ruby -e "puts RubyVM::YJIT.enabled?" true # Start Ruby without YJIT, but enable it later

...to not use the CLI flag --yjit or the ENV variable RUBY_YJIT_ENABLE=1 for starting Rails processes on your server...

end describe '#age' do it { is_expected.to validate_inclusion_of(:age).in_range(1..100) } end end See the shoulda-matchers README for a full list of matchers provided...

...with Rails 6 and below, or when the inverse scope may contain NULL values. [1] There are two different ways of "inverting a scope": As an example, consider the following...

...role" IN ('admin', 'superuser')) That also works with range conditions like where(created_at: 1.week.ago..), but does not work for missing (because its join statement is lost). So, sadly this...

...and straightforward) Enable caching for individual test Enable caching for individual test (file cache) 1. Leave the default configuration 2. Add a caching helper which gives you a unique file...

...some_key')).to be(true) end end Enable caching for individual test (memory store) 1. Leave the default configuration 2. Now stub the Rails cache and clear it before each...

Always optimize: Don't do stupid things with the database. Avoid "n + 1" queries. Don't do costly calculations live when you can precalculate and cache. Don't...

...instantiate 1000s of records. Use query_diet. Add database indexes. Don't descend into callback hell. Use form models. Optimize on demand: Don't optimize without knowing what's actually...

...fingerprint and stack trace rules at https://sentry.io/settings/projects/$project-id/issue-grouping. Fingerprint rules have this syntax: 1 or more key:value conditions, followed by ->, followed by your custom fingerprint string. Read the...