github.com

Barby is a great Ruby gem to generate barcodes of all different sorts. It includes support for QR codes via...

makandra dev

This is a visualization of the files that will be generated by some useful rails generators. Invoke a generator from...

There are various ways to run external commands from within Ruby, but the most powerful ones are Open3.capture3 and Open3.popen3...

makandra dev

Sometimes your code has long lines: describe 'foo' do describe 'bar' do really_long_line_really_long_line_really_long...

stackoverflow.com

A collection of code snippets which return a boolean value for a regex comparison. regexp.match?(string) # Recommended for Ruby >= 2.4...

There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...

evilmartians.com

Adding a gem means you take over the liability towards the external code. Checklist Based on "To gem, or not...

If you have a replication error with MySQL and you know the "error" is okay (e.g. you've executed the...

stackoverflow.com

This error message may occur when rspec gets loaded by rake, e.g. when you migrate the test database. NoMethodError: undefined...

makandra dev
github.com

Reminder of what you can do with Geordi. Note: If you alias Geordi to something short like g, running commands...

First find the reference for the entry you want through looking at the stash: $ git stash list stash@{0}: WIP...

Sometimes huge refactorings or refactoring of core concepts of your application are necessary for being able to meet new requirements...

TLDR: A function is hard to use when it sometimes returns a promise and sometimes throws an exception. When writing...

smashingmagazine.com

A comprehensive introduction to sending HTML emails. Intro: HTML email: Two words that, when combined, brings tears to a developer...

So you're getting an error like this: undefined method `activate_bin_path' for Gem:Module (NoMethodError)

Chrome gives you the currently selected element in the inspector with $0. If you select a button in the DOM...

So you're getting this failure when running bundle install on an older project: Your Gemfile.lock is corrupt. The following...

Building plain text emails with an .erb template doesn't allow you to indent code like you normally do in...

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

TL;DR Debugging problems with javascript errors in cucumber tests is sometimes easier in the browser. Run the test, stop...

This method will remove automatically installed packages that no other packages depend on any more. This, of course...

When you're writing specs for ActiveRecord models that use memoization, a simple #reload will not do: it 'updates on...

api.rubyonrails.org

Instantiating ActiveRecord objects comes expensive. To speed up things, you can choose a more direct way to talk to your...

makandra dev

Knowing when to refactor Just feeling like refactoring is not a good reason to do it. Make an educated decision...