Rails: How to restore a postgres dump from the past
Old PostgreSQL dumps can fail to load when their schema no longer matches the current Rails database; restoring them often requires checking out the migration version used when the dump was created.
Security issues with hash conditions in Rails 2 and Rails 3
Hash conditions in Rails scopes can overwrite earlier constraints when chained, creating security risks in user-filtered queries. SQL fragments avoid the overwrite, but change record-building behavior.
Where to find .desktop files on Ubuntu
Launcher entries on Ubuntu are stored in different locations depending on how an app was installed, which affects finding or editing desktop launchers.
How to implement simple queue limiting/throttling for Sidekiq
Sidekiq queue-wide throttling can be implemented with middleware and a mutex when simple per-queue limits are enough. Blocking workers is a trade-off compared with re-queuing.
Generated face images for UI mockups
AI-generated face images for UI mockups avoid real people and copyrighted stock photography while providing realistic-looking portraits.
VCR and the webdrivers gem
VCR can complain when webdrivers checks the internet for driver updates during tests. Updating locally, ignoring the update host, or pinning the driver version avoids the noise.
Rails: How to list all validations on a model or an attribute
Inherited models and concerns can hide which checks run on a Rails model; validators and validators_on reveal them at runtime.
Always, always declare your associations with symbols
Active Record associations must be declared with symbols, especially in metaprogramming, or newer Rails versions raise an ArgumentError.
How to include Sidekiq job IDs in Rails logs
Sidekiq jobs lose request context in Rails logs, making parallel worker output hard to trace. Tagging log lines with worker class and jid keeps job activity readable.
Pagy
Pagy is a Ruby gem for pagination with strong performance claims and benchmark advantages over other gems.
How to generate GIDs from an ActiveRecord scope
Efficiently generate Global ID URI strings for an ActiveRecord scope without instantiating records. Supports STI and avoids the performance cost of map(&:to_global_id).
Chrome: Using browser notifications
Chrome blocks browser notifications on insecure origins, so HTTP sites cannot use them except http://localhost. A Chrome flag can temporarily treat selected insecure origins as secure.
Git: Search for text in all branches
Find versions containing a regular expression anywhere in branch history with git grep and git rev-list --all, optionally narrowed to a file type.
Ruby Jard: Just Another Ruby Debugger
Ruby Jard adds a Terminal UI for debugging Ruby programs, making navigation easier and stopping at relevant points while reducing manual and mental effort.
Workflow: How to use a key management service to encrypt passwords in the database
Protect stored login secrets with KMS-backed encryption so a stolen database does not reveal password hashes; key rotation and audit logs add control.
Carrierwave: How to migrate to another folder structure
Large attachment trees slow directory listings and waste time; CarrierWave can serve old and new paths during a staged move to a hierarchical layout.
How to fix: Rails query logs always show lib/active_record/log_subscriber.rb as source
Rails verbose query logs can point every SQL query to lib/active_record/log_subscriber.rb when backtrace silencers are disabled, making sources unhelpful.
Fixing AfterAll TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'
Jasmine describe() throws AfterAll TypeError: Failed to execute 'appendChild' on 'Node' when an object is passed instead of a string.
Service Worker series by GoMakeThings
Create offline-capable web apps with service workers, including caching, updates, and background control for better resilience and performance.
RubyMine: Restore main menu in Ubuntu
Ubuntu updates can hide RubyMine’s menu bar; disabling linux.native.menu in the RubyMine registry restores the File/Edit/View menus.
Cucumber 4 and VCR integration
VCR integration with Cucumber 4 breaks when use_scenario_name: true is enabled, causing an undefined feature method error in Cucumber::RunningTestCase::TestCase.
apt: how to prevent a package from upgrading
New package versions can introduce regressions; keeping a Debian package back avoids upgrading it during apt upgrade by placing it on hold.
Clean your Rails routes: grouping
Large routes.rb files become hard to manage as Rails apps grow. Splitting routes into small partial files keeps routing organized.
Ruby: Appending lines to a file in sync
File writes can stay invisible until close when buffering is enabled; setting sync = true makes appended log lines available to other processes immediately.