makandra dev

...number of options. Offers some pretty skins for downloading, but is hard to customize beyond that. SoundManager 2 Free. Only does audio. Awkward API. There seems to be no way...

This card tries to summarize by example the different uses of heredoc. In Ruby << vs. <<- vs. <<~ In Rails strip_heredoc...

makandra dev

> {% client.global.set("auth_token", response.body.token); %} ### //Accessing a variable GET https://example.com/api Authorization: Bearer {{auth_token}} Complete documentation can be found here: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html

Starting with ChromeDriver 127, if your application displays a beforeunload confirmation dialog, ChromeDriver will immediately close it. In consequence, any automated tests which try to interact with unload prompts will...

...such dialogs. This means that we want to use the BiDi driver when testing beforeunload prompts. Enabling the BiDi WebDriver Using Capybara, simply set the :web_socket_url option to...

makandra dev

...gitignore, see https://makandracards.com/makandra/15947 [diff] algorithm = patience # A slower algorithm that sometimes produces better diffs [fetch] prune = true # Remove local remote-tracking branches that have been deleted [rebase]

main-view = date:relative author:abbreviated commit-title:graph=true,refs:true A better diff tool You may switch to delta, a fancy diff tool with syntax highlighting and...

In a JavaScript console, type this: > 9112347935156469760 9112347935156470000 Ooops. And that's not a float! This occurs because JavaScript uses...

Your package-lock.json should always match and resolve all packages from your package.json. Coming from Yarn, I was looking for an...

Here are some hints on best practices to maintain your tasks in larger projects. Rake Tasks vs. Scripts The Rails default is using rake tasks for your application tasks. These...

run_script(subject, 42, 'some_arg') assert_something end end Further reading Best practices: Writing a Rails script (and how to test it...

jQuery doesn't store information about event listeners and data values with the element itself. This information is instead stored...

A recent patch level Ruby update caused troubles to some of us as applications started to complain about incompatible gem...

In a nutshell: Use git rebase --onto target-branch source-commit target-branch means "branch you want to be based...

tenderlovemaking.com

In Ruby, the meaning of protected and private is different from other languages like Java. (They don't hide methods...

When you have two models in a has_many, has_one or belongs_to association, the :inverse_of option in Rails tells ActiveRecord that they're two sides of the...

...same association. Example with a has_many / belongs_to association: class Forum < ActiveRecord::Base has_many :posts, inverse_of: :forum end class Post < ActiveRecord::Base belongs_to :forum, inverse_of...

If you are using PDFKit / wkhtmltopdf, you might as well want to use custom fonts in your stylesheets. Usually this...

github.com

This might be relevant for us since we're often managing customer documents in our apps. I played around with...

You can use the code below to check whether the browser can make connections to the current site: await isOnline...

...pre-existing mocks inside the block, they are not reverted to the previously mocked behavior. This is usually not relevant and you should be fine in most cases...

...described above. legacy_transforms.rb This file 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...

around do |example| superuser_power = Power.new(create(:user, :superuser)) Power.with_power(superuser_power) do # before-block will be run here, DB snapshot will be created example.run # after-block will...

bundler.io

...version you want to use for each bundler command, e.g. bundler _2.1.4_ update New behavior Bundler now honors the version specified under BUNDLED_WITH in the Gemfile.lock. The necessary version...

gem update --system Updating the bundler version for a project With the new behavior bundler should never update its version in a Gemfile.lock automatically anymore. Therefore, unless there are...

You can ignore certain commits when using git blame with the --ignore-revs-file option. This is handy to ignore...

In Ruby on Rails ActiveRecord::Relation#merge overwrites existing conditions on the same column. This may cause the relation to...

...provide a lot of ways to style your scrollbars for now, it might be best to only use them in Browsers that don't support the non-standard scrollbar styling...

greg.molnar.io

Greg Molnar has written a neat article about creating a single-file Rails app. This is not meant for production...