Eine ASG skaliert abhängig von der CPU Auslastung, skaliert aber immer maximal 1 Instanz dazu und das nur alle 5 Minuten. Jeden Tag um 20 Uhr steigt der...
Connect to your memcached host. (AWS elasticache is memcached) telnet foohost23.cs2631.0001.euw1.cache.amazonaws.com 11211 Once you're connected, find out which 'slabs' exist within the cache: stats items STAT items:1:number...
...STAT items:1:age 5166393 STAT items:1:evicted 0 STAT items:1:evicted_nonzero 0 STAT items:1:evicted_time 0 STAT items:1:outofmemory 0
...you insert a record "by hand". This will cause an error: record = Record.create! record.id # => 100, next automatic id will be 101 Record.create!(id: record.id + 1) # okay, but next automatic id...
...will still be 101 Record.create! # will cause an SQL error 'duplicate key value violates unique constraint "records_pkey"' Workaround In tests, one workaround would be to simply initialize all sequences...
...find out about #fill but it is not really what you are looking for. [1] For arrays of unknown size that you want to grow or shrink to a fixed...
...sized << fill_with while sized.size < expected_size sized end end Use it like this: >> [1, 2, 3].in_size(5) => [1, 2, 3, nil, nil]
RSpec 1, RSpec 2 To test whether two arrays have the same elements regardless of order, RSpec 1 and 2 give you the =~ matcher: actual_array.should =~ expected_array Rspec 3
...you can choose one of these two matchers: expect(actual_array).to match_array(['1', '2', '3']) expect(actual_array).to contain_exactly('1', '2', '3') Note how match_array...
Example display configuration Screen 0: minimum 8 x 8, current 5760 x 1200, maximum 32767 x 32767 eDP1 connected 1920x1080+0+0 (normal left inverted right x axis...
...y axis) 276mm x 155mm 1920x1080 60.00*+ 59.93 1680x1050 59.95 59.88 1600x1024 60.17 1400x1050 59.98 1600x900 60.00 1280x1024 60.02 1440x900 59.89 1280x960 60.00 1368x768 60.00 1360x768 59.80 59.96
...webcam in PulseAudio use the following one-liners: # Connected cards $ pactl list short cards 1 alsa_card.pci-0000_00_1f.3 module-alsa-card.c 5 alsa_card.usb-Lenovo_ThinkPad_Thunderbolt_4_Dock...
...form_for(@user) do |form| = form.input :email = form.submit 'Save', class: ['btn', 'btn-primary'] Option 1: Using the form.error method The form.error method renders the first error on :base.
...to set a default region and the JAVA_HOME: export EC2_REGION=eu-west-1 export EC2_URL=https://eu-west-1.ec2.amazonaws.com export JAVA_HOME=/usr Add a bash script somewhere in...
...your $PATH (I called it am): #!/bin/bash if [[ $1 == "list" ]]; then cd ~/.aws && git branch -l elif [[ $1 != "" && `cd ~/.aws && git branch | grep $1` ]]; then cd ~/.aws && git checkout $1...
...which might not work for testing directly on the VM. $ curl -v http://localhost:12345 * Trying 127.0.0.1:12345... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 12345 (#0) > GET / HTTP/1.1...
...Host: localhost:12345 > User-Agent: curl/7.68.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 301 Moved Permanently < Date: Wed, 26 Apr 2023 06:38:09 GMT < Server: Apache
...class Article < ActiveRecord::Base named_scope :available, :conditions => { :state => [ 'unassigned', 'draft' ] } end #<Article id: 1, title: "Cooking noodles", state: "unassigned"> #<Article id: 2, title: "How to rock", state: "draft">
>> Article.available # SELECT * FROM `articles` WHERE (`articles`.`state` IN ('unassigned','draft')) => [ #<Article id: 1, title: "Cooking noodles", state: "unassigned">, #<Article id: 2, title: "How to rock", state: "draft"> ]
...XML.inner_text(column).include? expected_column.strip end if first_column.nil? false else row = row[(first_column + 1)..-1] true end end end if first_row.nil? false else rows = rows[(first_row + 1...
Hashes can now be compared like numbers: <, >, <=, >=, which checks for (proper) subsets. {a: 1} >= {a: 1} # => true {a: 1} > {a: 1} # => false Numeric predicates Numeric#positive? and Numeric#negative...
...allow for easy filtering: [1, -4, 2, -100].select &:positive? # => [1, 2] Negative grep Enumerable#grep_v excludes from the result set. It's similar to Rails' #reject:
...rewrite legacy git aliases to make them work with differently named default branches Step 1: Decide which is the most common default branch name of your projects, e.g. master. Define...
On the other hand – all these items are not to hard to fix. 1, 3, 4, 5, 7, 8, 9, 10 should be easy to do right, and...
mysql> SELECT @@global.version; +------------------+ | @@global.version | +------------------+ | 5.6.30 | +------------------+ 1 row in set (0,00 sec) MySQL 5.6 Reference Manual says "BLOB and TEXT columns cannot have DEFAULT values". If you want to run...
...an application-side default. You can use a gem like has_defaults for that. 1. Temporally change the migration code Replace things like: create_table "some_table", :force => true do...
...Task['notify:critical_operation']).to receive(:invoke) expect { described_class.clean }.to change(User, :count).from(1).to(0) end Note: Try to avoid logic in rake tasks and prefer to just...
...part of the web". Do not use standards in any stage before (like 2, 1 or 0). Run NODE_ENV=production rake assets:precompile to get compiled output in public/packs...
CSSnext Input: body { font-variant: small-caps; background-image: image-set(url(test_1.svg) 1x, url(test_2.svg) 2x); } Output: body { -webkit-font-feature-settings: "c2sc"; font-feature-settings: "c2sc";
...your first request on opening the input element. The Select2 data format { "results": [ { "id": 1, "text": "Option 1" }, { "id": 2, "text": "Option 2" } ], "pagination": { "more": true } } Basic ajax options
ajax: { url: , data: function (params) { return { query: params.term, page: params.page || 1 } } processResults: function (data, params) { return data }, } }); Further reading: https://select2.org/data-sources/ajax
Option 1: JSON dump In config/webpack/environment.js you can get inspect environment which includes all webpack config options set for the current environment: const { environment } = require('@rails/webpacker') const webpack = require('webpack...
...by the group_concat_max_len system variable, which has a default value of 1024. This will cause horrible, data-destroying bugs in production. For this reason you should probably...
...id | user_id | title | +----+---------+-----------------+ | 8 | 5 | How to rock | +----+---------------------------+ | 9 | 5 | Shoes are weird | +----+---------------------------+ | 10 | 5 | Best song | +----+---------------------------+ | 11 | 6 | Sunny day | +----+---------------------------+ | 12 | 6 | Greetings | +----+---------------------------+ For each user_id we...
...the endpoint from our notebook. Fixture JSON file: { "categories":[], "created_at":"2020-01-05 13:42:21.795084", "icon_url":"https://assets.chucknorris.host/img/avatar/chuck-norris.png", "id":"02e1usSQT_yO1AahT6meRg", "updated_at...
...13:42:21.795084", "url":"https://api.chucknorris.io/jokes/02e1usSQT_yO1AahT6meRg", "value":"Paul McCartney eats a vegan diet all the time -- except when he eats in the presence of Chuck Norris." } # spec/chuck_norris_spec.rb require 'webmock/rspec...
...have the content type "text/plain" And the download should contain the following lines: | Line 1 |
...syntax is a bit different. UnderscoreJS In UnderscoreJS, methods always return a value: x = [1, 2, 2] _.uniq(x) // => [1, 2] _(x).uniq() // => [1, 2] If you want to chain...
...call value() to terminate the chain. _.chain(x).uniq().map(function(i) { return i + 10 }).reverse().value() // => [12, 11] LoDash In LoDash, methods called from _ (like _.uniq) will behave as...