JavaScript: Sharing content with the native share dialog
Native share dialogs on mobile and desktop let users hand off links, text, and titles to installed apps; navigator.share works only on HTTPS pages.
Disable text-transforms in Selenium tests
text-transform: uppercase can make Selenium assertions flaky and break umlaut handling; disabling transforms in tests improves reliable label text matching.
Let the browser choose the protocol
Protocol-dependent links break mixed-content embeds and tests; protocol-relative URLs let the browser pick http or https from the page context.
Advanced plotting in Ruby with Gnuplot
Complex plots in Ruby often need direct access to Gnuplot syntax for histograms, boxplots, and multi-column data. Ruby wrappers differ in how much file handling and array support they hide.
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.
Rails: Preloading associations in loaded records
Preloading nested associations on already loaded ActiveRecord objects avoids extra queries when rendering deeply related data and fits legacy Rails models via preload_associations.
A nicer way to run RSpec and/or Cucumber
Convenience scripts streamline RSpec and Cucumber runs with bundle exec, parallel execution, spinner support, and a full test check against regressions.
Preventing users from uploading malicious content
Uploaded HTML or SVG can execute JavaScript and steal session cookies; safer uploads rely on extension allowlists, strict CSP, attachment disposition, or octet-stream delivery.
Cucumber step to match table rows with Capybara
Cucumber step for checking table rows in Capybara, with optional exact matching, row order control, wildcards, and support for colspan or rowspan tables.
Checklist for Implementing Design
Design changes need more than visual parity: implementations should be tested, responsive, touch-friendly, accessible, localized, and consistent with existing patterns.
How to hide your selenium browser window with "headless"
Selenium browser windows can steal focus during Cucumber acceptance tests; headless with xvfb keeps them hidden while running Selenium WebDriver through Capybara.
Opt out of selenium manager's telemetry
selenium-webdriver can send hourly usage stats during browser feature specs; setting SE_AVOID_STATS=true disables the telemetry call.
Devise: Don't forget to lock users with soft delete
Soft-deleted users can stay authenticated in Devise unless account activity checks are tied to the trash state. Customizing active_for_authentication? blocks sign-in and protects password reset flows.
Heads up: Quering array columns only matches equally sorted arrays
PostgreSQL array queries in Rails match element order, so [16, 17] and [17, 16] are different. Order-independent matching needs normalization or bidirectional containment.
Don't use migrations to seed default data
Seeding rows in a Rails migration breaks tests that expect an empty database and creates maintenance pain. Use db/seed.rb or a script in lib/scripts for default application data.
Running "bundle update" will update all gems without constraints
bundle update without arguments refreshes every gem and can break an app; updating gems regularly and conservatively reduces risky dependency changes.
How to write modular code
Reduce spaghetti code by splitting behavior into focused functions, service classes, form models, and value objects, while avoiding long parameter lists and excessive DRY.
Heads up: Byebug has problems with zeitwerk
Byebug 11.1.3 can trigger NameError with Rails 6 zeitwerk autoloading; binding.pry, eager loading, or another debugger avoid the issue.
Use <input type="number"> for numeric form fields
Numeric form fields on mobile get digit-focused keyboards, locale-aware decimal display, and consistent point-based values in JavaScript and form submission.
Bash: How to count and sort requests by IP from the access logs
Count and sort request frequencies by client IP in access logs with a short awk pipeline for quick traffic checks and abuse spotting.
Rails: Example on how to extract domain independent code from the `app/models` folder to the `lib/` folder
Move API-client code out of app/models into lib/ to separate domain logic from reusable infrastructure and keep Rails code more maintainable.
ActiveRecord: When aggregating nested children, always exclude children marked for destruction
Nested form deletions can inflate aggregated totals when child records marked for removal are still counted. marked_for_destruction? filters them out before saving.
An introduction to Hybrid search
Hybrid search combines vector retrieval and BM25 keyword search to catch paraphrases and exact terms, improving recall when either method alone misses relevant documents.
Optimizing images for LLM inference
Reducing image size and trimming whitespace lowers vision-token cost while keeping text readable; OCR-based strip slicing can keep dense pages within context limits.