island94.org

Rails 5.2 soft-deprecated the storage of secrets in secrets.yml in favor of a new thing, credentials.yml.enc. Rails 7.1 deprecated...

makandra dev
relishapp.com

RSpec 3 has verifying doubles. This breed of mock objects check that any methods being stubbed are present on an...

web.archive.org

There is a common view that extracting text from a PDF document should not be too difficult. After all, the...

makandracards.com

So you're hunting down a regression (or just a bug) and want to use git bisect to find out...

...follow redirects to get the desired response. This is supported but not the default behavior. You can do so by using the .follow method. This follows redirects for the following...

makandra dev

Geordi provides a pretty neat way to generate beautiful commit messages according to your stories in Linear: geordi commit Geordi reads from a .geordi.yml file inside your repo and connects...

You can use nmap to find out what service is running behind a given port, and most often see some details about it. This can be helpful if...

When giving a presentation where you do some coding, the font size you usually use is probably a bit too...

When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:

haml.info

...nesting level of elements. When it comes to white-space preserving content, this may become a problem: the content will be rendered including the HTML indentation. Problematic: Preserved Indentation

%pre = content Reference Hello World Better: Without Extra Indentation Render with tilde ~ instead of equals = to keep Haml from indenting content: .nest %span Reference %pre ~ content Reference

Let's say you have a gem which has the following module: module SuperClient def self.foo 'Foo' end

github.com

When internationalizing your Rails app, you'll be replacing strings like 'Please enter your name' with t('.name_prompt'). You...

...often show or hide elements based on viewport dimensions, or may have components that behave differently (like mobile vs desktop navigation menus). Since you want your integration tests to behave...

...metrics". This allows you to configure dimensions larger than your display and enable/disable touch behavior. Simply use register_driver to set up a driver that you then connect to Capybara...

makandra dev

Bundler allows you to specify the name of the Gemfile you want to bundle with the BUNDLE_GEMFILE environment variable...

...the HTML required attribute. We usually turn it off due to difficulties controlling its behavior and appearance. Instead we only mark required fields with an asterisk (*) next to its label...

...after submitting the form due to the now displayed error messages. A compromise with better accessibility is to add the aria-required attribute in this case. This allows screen readers...

In the discussion of the difference between include and extend in Ruby, there is a misconception that extend would add...

Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

before(:all) runs the block once before all of the examples. before(:each) runs the block once before each...

When changing code in mailers, updating the corresponding mailer preview can be forgotten very easily. Mailer previews can be tested...

...the file system. Since load order can be important, this may lead to different behavior on different machines which are hard to debug. Simply add a .sort: Dir.glob(Rails.root.join('lib/ext...

relishapp.com

In RSpec you can tag examples or example groups with any tags you like simply by saying describe ReportCreator, slow...

bibwild.wordpress.com

While debugging an intricate issue with failed HTTP requests I have come to appreciate the more advanced features of the...

This Capistrano task runs a command on all servers. bundle exec cap production app:run cmd='zgrep -P "..." RAILS_ROOT/log/production.log...

It's possible to implement simple custom RuboCop cops with very little code. They work exactly the same like existing...