When Paperclip attachments should only be downloadable for selected users, there are three ways to go. The same applies to...
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...
So you're hunting down a regression (or just a bug) and want to use git bisect to find out...
before(:all) runs the block once before all of the examples. before(:each) runs the block once before each...
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...
...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
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...
Bundler allows you to specify the name of the Gemfile you want to bundle with the BUNDLE_GEMFILE environment variable...
I recently built a screen with a very high and wide table in the center. This posed some challenges:
This card describes different flavors for concatting HTML safe strings in a helper method in Rails. You might want to...
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...
In RSpec you can tag examples or example groups with any tags you like simply by saying describe ReportCreator, slow...
Recently we detected a memory leak in one of our applications. Hunting it down, we found that the memory leak...
Sometimes it is useful to define a named scope by implementing a static method with the scope's name on...
Most of our applications use CarrierWave for file uploads. CarrierWave has an integrated processing mechanism for different file versions with...
...the window's resize event, that might call your event listener many times. A better way is to subscribe to changes of the MediaQueryList object that is returned by matchMedia...
It's possible to implement simple custom RuboCop cops with very little code. They work exactly the same like existing...
...write <<EOT. If you do this, your terminating sequence must be at the very beginning of the line. It's less pretty and there is rarely a reason to use...
Most of the time it is a tedious task to apply a code style guide to an existing code...
When building an application that sends e-mails to users, you want to avoid those e-mails from being classified...