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

makandra dev

...tagname.. for "everything after that tag" Example output for spreewald: 60 Tobias Kraze 12 Henning Koch 7 Dominik Schöler 6 Thomas Eisenbarth 5 Martin Straub 3 Minh Hemmer...

1 Manuel Kallenbach 1 Andreas Robecke Alternatives There is a powerful CLI tool called git who...

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

...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...

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']

...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...

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...

labs.bishopfox.com

irb(main):001:0> require 'json' => true irb(main):002:0> JSON.parse('{"qty": 1, "qty": -1}') => {"qty"=>-1} Character Collision irb(main):009:0> JSON.parse('{"qty": 1, "qty\ud800...

...incomplete surrogate pair at 'qty\ud800": -1}') irb(main):007:0> JSON.parse('{"qty": 1, "qty"": -1}') JSON::ParserError (784: unexpected token at '{"qty": 1, "qty"": -1}') This one was unexpected...

makandra dev

...for the root user and you prefer using a password for root. Solution Step 1 is getting a root mysql shell that allows us to change user credentials. We need...

...MariaDB [mysql]> UPDATE user SET password='', plugin = 'unix_socket' WHERE user='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 Re-read permissions

...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.

...9200/my_documents Index ansehen: http GET :9200/my_documents { "my_documents": { "aliases": { }, "mappings": { }, "settings": { "index": { "creation_date": "1556793804746", "number_of_replicas": "1", "number_of_shards": "5", "provided_name": "my_documents", "uuid": "Q9nNksJhT3Ky7SOqDQa4bA", "version...

...PUT :9200/my_documents/post/1 { "title": "A sample document", "body": "I wrote something", "author": { "name": "Tobias" } } { "_id": "1", "_index": "my_documents", "_primary_term": 1, "_seq_no": 0, "_shards": { "failed": 0, "successful": 1,

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

...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...

...low-level logic and have good reasons to do otherwise, probably stick with option 1.

...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...

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.

...PDF file, you can use ghostscript to compress embedded images: ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=new-smaller-file.pdf large-original-file.pdf Note that your PDF printer (or similiar...

...put this snippet into your ~/.bash_aliases: alias pdf_compress='_compress(){ ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$1".c.pdf "$1";}; _compress' Reload aliases (source ~/bash_aliases) and...

...and weekdays differ. Times are formatted differently in different regions. Some regions use a 12 hour clock instead of 24 hours. Numbers and money amounts have different fractional separators and...

...has many issues that can lead to stored timestamps being off by some hours (1, 2, 3, 4). You can control this, but you will shed tears.

...next if [:string, :text].exclude?(column.type) attribute_name = column.name class_eval <<~RUBY, __FILE__, __LINE__ + 1 def #{attribute_name}=(value) super(value.to_s.strip.presence) end RUBY end rescue PG::ConnectionBad, ActiveRecord::StatementInvalid

...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...

...than a few months, it may stay at level 2. Never go below level 1. 0. Working code You have implemented that feature and it works. Congrats! You have reached...

...three levels of code quality lie ahead. First, make sure your code is reliable: 1. Reliable code In order to reach the baseline for good code, make your code: