...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...
...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...
...the constructor. returnValue & returnValues it('shuffles the array', () => { spyOn(Random, 'shuffle').and.returnValue([3, 2, 1]) array = [1, 2, 3] testedClass = new testedClass(array) expect(Random.shuffle).toHaveBeenCalled() expect(testedClass.array).toEqual...
}) If you have several new classes created in one test you could also use returnValues for any call of the method Random.shuffle. callFake If you are testing the class...
...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...
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...
...once results exceed a certain threshold. For example, you may only need to display 100+ in the UI. Using a plain COUNT(*) would scan all matching rows. The following query...
...LIMIT to cap the scan early. You’ll get the exact number up to 100 otherwise you can show 100+. SELECT COUNT(*) FROM (SELECT 1 FROM movies LIMIT 101) AS...
...This task list is divided by the Gate keeping process in the following steps: 1. Starting a new feature 2. Working on the issue 3. Finishing a feature
...design and the points from Building web applications: Beyond the happy path The template: 1 Starting a new feature Set the issue to "In Progress" in Linear Pull the most...
...t: the current time in 24-hour HH:MM:SS format, \T: same, but 12-hour format, @: same, but in 12-hour am/pm format \n: newline \r: carriage return
...x: attribute of the text 3y: foreground color 4y: background color x: 0: normal 1: bold 4: underline 7: reverse y is the color: 0 black 1 red
The git doc states on the difference of these two commands: git-restore[1] is about restoring files in the working tree from either the index or another commit. This...
...also be used to restore files in the index from another commit. git-reset[1] is about updating your branch, moving the tip in order to add or remove commits...
loop until state change wait 60 seconds (vrrp_garp_master_refresh) send 1 GARP/NA package (vrrp_garp_master_refresh_repeat) The timings here are default which can be...
...is full, no more packets are enqueued. This is logged as follows: Jun 29 16:49:53 myhost Keepalived_vrrp[787]: Error 11 sending ndisc unsolicited neighbour advert on eth0...
...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
...einige übliche nennen. Du kannst den folgenden Response Code Kategorien einen Überbegriff/Kategorienamen zuordnen: 1xx 2xx 3xx 4xx 5xx Was ist ein HTTP Body? Wo ist der Unterschied zu einem...
...Evolution of HTTP HTTP/1.1 vs HTTP/2: What's the Difference? HTTP cookies WebSockets in 100 Seconds & Beyond with Socket.io WebSockets Explained Cross-Origin Resource Sharing (CORS) Content Security Policy (CSP...
...a SHA1 revision. Your editor will open with a file like pick fda59df commit 1 pick x536897 commit 2 pick c01a668 commit 3 Each line represents a commit (in chronological...
...these commits into a single one, change the file to this: pick fda59df commit 1 squash x536897 commit 2 squash c01a668 commit 3 This means, you take the first commit...
...using Geordi, disable automatic updating of chromedriver in ~/.config/geordi/global.yml: auto_update_chromedriver: false Option 1: Use Geordi The geordi gem can upgrade to the correct version of chromedriver: geordi chromedriver...
...z "$VERSION" ]; then echo "Failed to read current version from $VERSION_URL. Aborting." exit 1 else echo "Current version is $VERSION" fi # Abort script if any of the next commands...
...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
...a new frame is rendered 60 times a second. Thus, a single frame is 1000ms / 60 = 16.6...ms long. Once a frame renders longer than 16ms, the page will begin...
...s well searchable when you just have a question about some function. Performance issue 1: Slow JavaScript If an event occurs and JavaScript has to run, the browser have to...
...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...
...can list them like this: $ git stash list stash@{0}: WIP on feature/foo stash@{1}: WIP on feature/bar stash@{2}: WIP on fix/baz All those stashed changes have their own...
...reference (like branch names) that you can look at, like stash@{0}, stash@{1}, etc. Above, we looked at stash@{0} which is the default for stash actions.
...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...
...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...
...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...
attribute attr end validates *REQUIRED_ATTRIBUTES, presence: true validates *ALL_ATTRIBUTES, length: { maximum: 1000 } # From this you already get methods like `#valid?` and `#==`. # (optional) Here is the perfect place...
...Address instance: # without :mapping Rails uses keyword arguments Address.new(street_and_number: 'Foo St. 1', zip_code: '12345', city: 'Bar Town') # with a :mapping (even if that is just the...