...the scanf C-operation for plotting. In the most simple application plot 'file' using 1:2 just means plot the content of the first column (as x-axis) against the...

...operations or different functions such as the example from the doc: plot 'file' using 1:($2+$3) '%lf,%lf,%lf', where you reference the n-th column by $n and...

ü ↔ ü However, they are not the same: 'ä' == 'ä' # false 'ä'.size # 1 'ä'.size # 2 Looking at how those strings are constructed reveals what is going on...

...you may come across an ArgumentError with the message wrong number of arguments (given 1, expected 0) raised at the line your controller action is defined at. Controller actions don...

DevOps Curriculum

...Ruby: Get started with the greatest programming language made for humans. Note that chapters 16 (RDoc), 23 (Multi Threading) and everything after chapter 27 is irrelevant for now References

...lines and paragraphs, and outputs the result. For example: $ ruby count_words.rb test.txt test.txt has 123 words test.txt has 13 lines test.txt has 4 paragraphs Hint Find out about ARGV.

...two useful tools for your own usage. Desktop environment pie title Desktop environment "Gnome" : 16 "i3": 2 "sway": 2 "awesome": 1 "bspwm": 1 "mate": 1 "xfce": 1 Gnome dominates (unsuprising...

...most popular i3 and the mostly i3-compatible sway. Shell pie title Shell "bash" : 14 "zsh": 6 "fish": 2 Again, "bash" dominates as the default. Popular command line tools...

...go to File → Settings → Appearance and set the "Zoom" option to your liking, e.g. 150%. Everything (UI elements, UI font, editor fonts) should be scaled accordingly. Scaling everything manually (classic...

You can configure RubyMine to manually scale everything. 1. Increase UI size Navigate to Help → Custom VM Options. A file will open. Here, simply add the ide.ui.scale option with...

techblog.netflix.com

...performance issue: what do you check in the first minute? uptime dmesg | tail vmstat 1 mpstat -P ALL 1 pidstat 1 iostat -xz 1 free -m

...sar -n TCP,ETCP 1 top Also see: How to get a rough picture about a Rails project How to examine an unknown Ruby object

...rename the class and change the column details to fit your purpose. Run it. 1) Deliver attachments through Rails The first way is to store your Carrierwave attachments not in...

...SHA512.hexdigest("--#{Rails.env}--#{model_class_name}--#{model.id}--#{mounted_as}--#{secret}--") # 4 bit per character, so 128 bit for the full hash. Check if still appropriate! hash.slice(0, 32) end end

...the Internet is sparse and not even the Geniuses at the Genius Bar are 100% sure. We found out some things and can explain the backgrounds. tl;dr: when using...

...is only possible with workarounds. Docking stations Whenever you're considering using more than 1 external display, it makes sense to consider using a Docking Station for your Laptop of...

...interpolation syntax you know from strings: re1 = /x/ re2 = /a#{re1}b/ 'aaxbb' =~ re2 # => 1 Note If your regular expression contains backreferences like \1, they may no longer refer to...

In modern Rails versions you can also use ActiveRecord's pluck method. User.active.pluck(:id) => [1, 5, 23, 42] If you are plucking from the id column in particular you can...

User.active.ids => [1, 5, 23, 42] For a DISTINCT selection, use distinct on your scope (not the resulting array). Article.distinct.pluck(:state) # SELECT DISTINCT state FROM articles => ['draft', 'published']

...simple as a tuple of start and end state. const keyframes = [ { opacity: 0 }, { opacity: 1 }, ] const animation = element.animate(keyframes, { duration: 1000 }) After the animation has finished, the animation keyframes will...

...that allows you to wait for animations to finish. const animation = element.animate(keyframes, { duration: 1000 }) await animation.finished alert('animation finished!') Side note: When animations are cancelled, the promise is rejected...

...Use RAILS_ROOT as a placeholder for the remote Rails root directory. # * Append ` || test $? =1;` to grep calls in order to avoid exit code 1 (= "nothing found") # * To be able...

it "doesn't use logical negation for include, exhibit A" do expect([1, 2, 3]).to include(3, 4, 5) end it "doesn't use logical negation for...

...include, exhibit B" do expect([1, 2, 3]).not_to include(3, 4, 5) end end Exhibit A fails with: expected [1, 2, 3] to include 4 and 5

'instance_foo': api_port: 9200 content: 'index_patterns': ['foobar_*'] 'settings': 'number_of_shards': 1 'number_of_replicas': 0 Attention: This will replace all existing settings of the template. Make...

-H 'Content-Type: application/json' \ -d '{ "index_patterns": [ "foobar.*(" ], "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 0 } } }' Cleanup Now you have fixed the issue for future indices matching...

Example Compound selectors like ... .datepicker .prev, .datepicker .next, .datepicker .switch padding-bottom: 1rem ul li, ol li list-style-type: none can be simplified by using the :where...

...pseudo selector ... .datepicker :where(.prev, .next, .switch) padding-bottom: 1rem :where(ul, ol) li list-style-type: none Hint The specificity of :where() is always zero! If you need or...

makandra dev
iamvdo.me

...For example, line-height can be set as a length or a unitless value 1, but the default is normal. OK, but what normal is? We often read that it...

...is (or should be) 1, or maybe 1.2, even the CSS spec is unclear on that point. We know that unitless line-height is font-size relative, but the problem...

...diff for merge requests. There are two options how you can address this: Option 1: exclude from diff Luckily gitlab comes with a solution for this. You can ignore files...

github.com

...fly. It offers a #disasm method for further inspection. Destructuring Arrays In Blocks { key: [1,2] }.each { |key, (x, y)| puts "#{x}- #{y}" } Defaulting To Frozen String Literals

Pass A Block To Count count can be used like "count by": [1,2,3].count { |x| x.odd? } Parallel Bundle Install bundle install --jobs 4

...and want to migrate one of your Transforms, e.g. the "number" matcher from above. 1.: Create a new ParameterType based on your existing Transform to "parameter_types.rb" using the Proxy class...

...adds a Transform method to the Cucumber "World" which behaves similar to the Cucumber 1 and 2 transformations. This allows cucumber_factory to keep using your transformations.

it "creates a first project for the user" do user = FactoryBot.create(:user) user.projects.size.should == 1 user.projects[0].name.should == 'My first project' end end

index = 0 User.find_each do |user| printf("Progress: %.2f%%\r", index.to_f / count * 100) user.update!(role: 'member') index += 1 end

github.com

...you want to couple the lock to the model's soft delete logic. Option 1 might also work when setting both the lock_strategy and unlock_strategy to none.

...in your RVM or rbenv setup. Updating one does not update the others. Ruby 1.8.7 If you are using Ruby 1.8.7 you cannot use the latest version of Rubygems. Type...

...the following to get the latest version that is compatible with 1.8.7: gem update --system 1.8.30 Updating RubyGems for all installed Ruby versions Because of occasional security issues in RubyGems...