Quick HTML testing with RubyMine
Quickly preview embed code or other HTML in RubyMine without creating a project file by using an HTML scratch file and opening it in a browser.
How to install packages from newer Ubuntu releases
Install newer Ubuntu release packages on an LTS system when new hardware or software needs them, while minimizing dependency conflicts and upgrade risk.
Project maintenance: four levels of code quality
Code quality determines maintainability, from merely working code to reliable, readable, and changeable code. Long-lived projects need at least readable code; short-lived code can stop at reliable code.
RCov: The difference between "code coverage" and "total coverage"
Code coverage can look misleading when blank lines and comments count against the ratio; RCov total coverage ignores them for a more useful metric.
Minify Font Awesome fonts with webpack
Reduce Font Awesome icon font size by subsetting unused glyphs with fontmin-webpack, keeping low CPU usage and no JavaScript while avoiding oversized font downloads.
RSpec: Increase readability with super_diff
Hard-to-read RSpec diffs for nested hashes and collections can be improved with super_diff, which formats expectation mismatches more clearly.
Output of ParallelTests::Cucumber::FailuresLogger was fixed in 4.9.1
ParallelTests::Cucumber::FailuresLogger now emits valid rerun arguments in version 4.9.1, so patched custom loggers can be removed and the default logger restored.
Ruby object equality
Ruby equality methods differ by purpose: == for value comparison, eql? and hash for hash keys, === for case matching, equal? for identity.
How to: Validate dynamic attributes / JSON in ActiveRecord
JSONB columns can hold dynamic attributes in ActiveRecord, but validation and strict defaults are easy to lose. JSON Schema keeps evolving hashes predictable.
Show the character set and the collation of your MySQL tables
MySQL table collation and default character set are available through SHOW TABLE STATUS and SHOW CREATE TABLE; individual columns can still use different encodings.
Cucumber features as documentation
Natural-language Cucumber features and scenarios can capture intent and context beyond one-line labels, helping future developers understand application behavior quickly.
Check that a Range covers an element in both Ruby 1.9 and 1.8.7
Range#include? becomes slow for non-numeric ranges in Ruby 1.9, while Range#cover? is unavailable in 1.8.7. A compatibility method keeps one check working across both versions.
Embed Google Analytics code for some environments only
Google Analytics should run only in production to avoid polluting visitor statistics. Rails environment checks can gate the tracking snippet.
Rails: How to write custom email interceptors
Global mail interception in Rails can prefix subjects by environment and redirect staging mail to a fallback address unless recipients are allowlisted.
Raise when there's a I18n translation missing
translate! and t! raise I18n::MissingTranslationData on missing translations instead of returning placeholder text. A custom exception handler can make I18n raise globally.
Performance analysis of MySQL's FULLTEXT indexes and LIKE queries for full text search
MySQL text search performance differs sharply between LIKE and FULLTEXT; LIKE stays surprisingly fast on medium datasets, while FULLTEXT benefits from larger vocabularies.
SSHKit 1.9.0 failure for Capistrano deploy
Capistrano deploys can crash in sshkit-1.9.0 with NoMethodError in pretty.rb; upgrading SSHKit to 1.21.0 resolves the failure.
Web Operations 101 For Developers
Web application developers increasingly need operational knowledge beyond coding, testing, and deploying. Traditional development workflows now overlap with running and maintaining production systems.
Understanding the Selenium error "Modal Dialog Present" (aka Selenium::WebDriver::Error::UnhandledAlertError)
Intermittent Cucumber failures can come from a leftover browser alert blocking Selenium commands after an unfinished AJAX request.
Project management best practices: User stories & Issues
Clear, well-scoped issues reduce misunderstandings and rework in Linear. User stories, acceptance criteria, backlog priority, and rough estimates keep work actionable.
Unpoly: Testing values for presence or blankness
Blank and missing values in JavaScript need explicit handling; Unpoly provides up.util.isBlank(), up.util.isPresent(), up.util.isMissing() and up.util.isGiven() for common and custom types.
Copy to clipboard without flash (clipboard.js)
Flash-free copy-to-clipboard handling with clipboard.js, including success and error callbacks, text selection feedback, and support for text fields or data attributes.
How to check if a file is a human readable text file
Ruby's File.binary? is only a fast guess and can misclassify PDFs or UTF-8 text. A safer check validates the file contents against the target encoding.
ActiveRecord::Store: migrate data in store
Migrate hashed settings stored in a single column by renaming keys safely in an ActiveRecord::Migration, using the store's coder and an embedded model.