...set :bundle_without, %w[development test cucumber deploy].join(' ') Be aware, that gems that belong to two groups, are only excluded, when both of the groups are excluded, e.g. to...

...when the model has no database or database columns yet. Example: class Post < ApplicationRecord begin # Magically auto-strips all string attributes columns.each do |column| next if [:string, :text].exclude?(column.type...

Any form fields where users enter numbers should be an . Numeric inputs have several benefits over : On mobile or tablet devices, number fields show a special virtual keyboard that shows...

...the inert field. It might might as well be removed from the page. This behavior is OK if the fields might as well be hidden, and you're just looking...

postgresql.org

PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...

In rare circumstances, you want to use a websites full domain (say https://mywebsite.com) while testing in dev mode. This...

Ubuntu 24 added some guarding for Python packages which no longer allows installing applications through pip on system level. Instead...

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

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

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

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

tenderlovemaking.com

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

makandra dev

...make block elements take up much more space than desired, even stretching their container beyond the screen edge on small screens. min-width is defined to win against competing width...

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

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

...Although this may be useful for debugging, when writing custom steps you may be better off using XPath...

Some pseudo-elements need to be addressed with vendor prefixes. E.g. ::selection is not supported by Firefox, you need to...

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

If you're using a Redis cache in Rails (e.g. :redis_cache_store), it's possible to configure additional parameters...

w3c.github.io

Here is how to use Chromedriver without libraries like selenium-webdriver. This can be useful for debugging. The following example...

greg.molnar.io

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

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

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

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