...Middleman brings Haml, Sass, helpers etc. However, it can be configured to do even better. This card is a list of improvement hints for a Rails developer. Gemfile
...helpers in a helpers {...
...} block. However, this does not scale very well. You're best off creating a /helpers directory and putting helper files there just like you know it...
The robots.txt file and HTML tag can be used to control the behavior of search engine crawlers. Both have different effects. robots.txt Marking a URL path as "disallowed" in robots.txt...
There is no one-liner in Ruby or ActiveSupport with the behavior described above. There have been discussions about adding a method like Enumerable#find_map:
The Node Version Manager allows installing multiple NodeJS versions and switching between them. By default, it does not automatically switch...
Besides Plotting graphs in Ruby with Gruff, which comes handy for many uses cases, you sometimes might need configuration for more advanced plots, e.g. for academic concerns. Then using Gnuplot...
...where each array holds the data for x-, y- or z-axis. The major benefit of numo-gnuplot is that it supports advanced numpy like array operations, like multi array...
It is possible to add custom http header to request made by the docker CLI client. This can be used...
If you ever need to restore exact records from one database to another, Marshal might come in handy. Marshal.dump is...
...not scale the icon with the font size. One option that seems to work better is to use the mask CSS feature. The idea is to have an element with...
...var(--icon-url) center / contain no-repeat // this can probably be done in a better way: vertical-align: text-bottom margin-bottom: -.1em // depends on the icons @each $icon in...
SimpleForm is a great approach to simplifying your forms, and it comes with lots of well-defined input types. However...
...find(..., visible: true) or find(..., visible: :visible). Note that you could change the default behavior by setting the ignore_hidden_elements config option. However, ignoring invisible elements is a useful...
...Rails has a method ActiveRecord::Relation#merge that can merge ActiveRecord scopes. However, its behavior has never been clear, and in Rails 7 it still discards conditions on the same...
...column by the last condition. We discourage using #merge!) The best way to merge ActiveRecord scopes is using a subquery: scope_a.where(id: scope_b) It is a little less concise...
We're always striving towards keeping our website's JavaScript as small as possible. If you're using webpack(er...
Investigate why mails are frozen The exim documentation says: Freezing occurs when a bounce message encounters a permanent failure because...
While both the alt attribute and the figcaption element provide a way to describe images, the way we write for...
There is a common view that extracting text from a PDF document should not be too difficult. After all, the...
A lesser known fact about PG enums is that they are ordered. This can be really handy when values have...
RSpec 3 has verifying doubles. This breed of mock objects check that any methods being stubbed are present on an...
...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...
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...
When using tmux, selecting and copying multiple lines of text can be a hassle, especially when using splits (highlighting lines...
So you're hunting down a regression (or just a bug) and want to use git bisect to find out...
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...
When giving a presentation where you do some coding, the font size you usually use is probably a bit too...
If you need to pre-generate a scram-sha256 password hash for use with postgres, e.g. for using it with...