Sidekiq 7: Rate limiting with capsules
Sidekiq 7 capsules let queues run with separate concurrency limits, useful for protecting apps or APIs from too many parallel jobs.
Using the Oklch color space to generate an accessible color palette
Oklch keeps derived colors aligned as a base color changes, preserving contrast more reliably than RGB or HSL for accessible palettes.
Understanding database Indexes in PostgreSQL
Unused and duplicate database indexes can slow writes, waste storage, and complicate maintenance in PostgreSQL; SQL one-liners help identify candidates for cleanup.
How to create a multiline map in SASS/SCSS
Large Sass/SCSS maps become hard to read when they grow, and multiline map syntax is unsupported in .sass. Using .scss avoids parser errors.
Rubymine: Configure CTRL + ALT + SHIFT + c to work with "Test Source Roots"
RubyMine test navigation depends on marking test folders as Test Sources Root; remapping CTRL + ALT + SHIFT + c can copy repository-relative paths like spec/foo_spec.rb instead of foo_spec.rb.
Webpacker: Configuring browser compatibility
Browser support in Webpacker depends on both Babel and UglifyJS; mismatched settings can break legacy browsers like IE11 even when JavaScript is transpiled.
Do not use transparent PNGs for iOS favicons
Transparent apple-touch-icon images on iOS turn black in Safari, so solid backgrounds prevent ugly home-screen and bookmark icons.
How Haml 6 changes attribute rendering, and what to do about it
Haml 6 renders most custom attributes verbatim, so falsy values no longer remove them. Boolean attributes keep special handling, and Haml::BOOLEAN_ATTRIBUTES can extend that list.
Rails: Assigning associations via HTML forms
Rails forms can assign tag associations in several ways, from array columns to join models; nested attributes keep tag changes in one transaction.
Rails cache connection settings
Redis cache connections in Rails can be tuned with custom timeouts, reconnect behavior, and error handling to avoid slow cache operations and missed connection failures.
Simple Form: Rendering errors without an appropriate attribute
ActiveRecord base errors do not render in Simple Form by default; they need explicit handling to display form-wide validation messages.
Using Capybara finder methods with arbitrary matching conditions
Capybara matchers and finders can take a Ruby block for extra DOM conditions when built-in options are not enough. Script calls inside filter blocks need a temporary wait time to avoid Selenium timeouts.
Project management best practices: Technical debt summary
Prioritizing refactoring and upgrade work is harder in larger projects; a maintained technical-debt summary helps compare effort, customer value, and developer value.
How not to turn your application into a spam relay
Abused sign-up and password-reset emails can turn applications into spam relays when user input is reflected in messages. CAPTCHAs, rate limits, and avoiding arbitrary text reduce the risk.
JavaScript: Detecting the end of native smooth scrolling
Native smooth scrolling has no built-in completion signal; scrollTo() and scrollIntoView({ behavior: 'smooth' }) do not return promises, so a scroll idle timeout can wait for the animation to finish.
Rails: Rescuing exceptions for specific exception types
Rails can map selected exceptions to non-500 responses and suppress error monitoring noise, such as returning 404 for missing records or denied access.
Storing trees in databases
Tree data in relational databases can be stored with parent links, paths, nested boundaries, or closure tables; the choice trades write cost against read speed.
Custom RSpec matcher for allowed values (or assignable_values)
Custom RSpec matcher for checking allowed association values, useful when validating assignable_values on model associations.
Beware when using ActiveSupport time and date calculation methods
Duration#ago and Duration#from_now return ActiveSupport::TimeWithZone, which can introduce unexpected timezone behavior when an app assumes local or timezone-unaware dates.
Rails: Your index actions probably want strict_loading
Strict loading in index actions catches N+1 queries when views touch unpreloaded associations, causing test failures instead of hidden database hits.
Rails: How to test the parsed response body
Rails response tests can parse bodies by MIME type with parsed_body, replacing manual JSON.parse(response.body) in many cases and enabling cleaner assertions.
How to exclusively lock file access in ruby
Prevent race conditions when multiple Ruby processes read or write the same file by using flock for exclusive locking, optionally via a companion .lock file.
SASS: Reusing styles from other files
@extend reuses Sass selectors, but multi-file bundling can duplicate imported styles and break the expected selector merging.
How to enable template coverage support for simplecov
Template and eval coverage in Ruby can be tracked with SimpleCov from Ruby 3.2 onward, including Haml and ERB templates.