How to mount a legacy database to migrate data
Legacy data can be imported into a new Rails app by connecting a second database and mapping old tables and columns with Active Record models.
Joining PDFs with Linux command line
Combine multiple PDF files from the Linux command line with pdftk or pdfjam; convert works too, but often lowers quality and increases file size.
IE11 ignores calc() functions in the flex shorthand
IE11 drops calc() inside the flex shorthand, breaking layouts that need percentage widths with gutters. Using flex-basis separately preserves the intended size.
Class methods in Coffeescript
CoffeeScript class methods use @ on the class definition and can be called from instances through @constructor or the class itself.
Take care of existing users when upgrading Clearance
Upgrading Clearance can break existing logins when password hashes change from SHA1 to BCrypt, causing BCrypt::Errors::InvalidHash for legacy users.
Known MariaDB version incompatibilities
MariaDB and MySQL version changes can alter query results despite sql_mode; aggregated date queries may switch from strings to Datetime, breaking existing applications.
Fix for "Rails assets manifest file not found" in Capistrano deploy
Webpacker-only Rails deploys can fail on deploy:assets:backup_manifest because capistrano-rails expects Sprockets assets. Clearing that task avoids the missing manifest error.
Capistrano: Finding out who deployed which revision of your application and when
Capistrano records successful deployments with branch, commit, release ID, and user, letting teams trace who shipped which revision and when.
DOM API for jQuery users
Quick reference for replacing common jQuery DOM tasks with native browser APIs and handling event delegation gaps without jQuery.
Restore changes, even from deleted files, with RubyMines "Local History"-Feature
Lost or overwritten files can sometimes be recovered after git accidents or failed undo actions by using RubyMine's Local History.
CSS font metrics in detail
CSS line-height and vertical-align depend on font metrics and inline formatting, making text and element alignment less predictable than it seems.
Installing Ruby 2.3 or below on Ubuntu 17 and above
Ruby versions below 2.4 fail to build on newer Ubuntu because of OpenSSL and compiler mismatches. Temporary libssl1.0-dev and gcc-6 workarounds restore old installs.
How to inspect the HTML of an email in Thunderbird
Encoded email source can hide the plain HTML markup in Thunderbird. Opening a message in composition mode gives access to the HTML view.
Git: Apply a diff
git apply can place a diff onto HEAD, often replacing a rebase-and-merge workflow when reconstructing commits or working from a patch file.
Adding Jasmine JavaScript specs to a Webpack(er) project
Browser-based unit tests in a Rails app can run with Jasmine and Webpacker by separating test runner and spec packs; a /jasmine page makes the setup easy to open.
How to get a backtrace if rspec (or any other ruby process) hangs with no output
RSpec can freeze without output and ignore --backtrace or Ctrl-C; sending USR1 can print all thread backtraces from a running Ruby process.
Cucumber: Clear localStorage after each scenario
Client-side storage can persist between Cucumber scenarios even when cookies are cleared, causing test leakage in Selenium-driven browser runs.
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.
How to: Fix json 1.8.3 with Ruby 2.5
json 1.8.3 fails to build on Ruby 2.5 because of removed C API constants; updating the gem resolves the native extension error.
Katapult EOL
Katapult reduced the effort of bootstrapping Rails apps, but its maintenance cost outweighed the gains and development has ended.
faviconit.com: Super-simple favicon generator
Simple favicon generation for web apps with image editing, multi-size output, and ready-made HTML for inclusion in Rails layouts.
LoDash: isBlank and isPresent mixins
JavaScript truthiness makes 0 and "0" look blank, while _.isEmpty only fits collections. Custom _.isBlank and _.isPresent give human-friendly checks.
Active Record and PostgreSQL — Ruby on Rails Guides
PostgreSQL offers native column types such as json and arrays that simplify data modeling in Rails and can replace awkward workarounds from MySQL.
Deal with certain travis CI failures
Travis CI builds can break after Ubuntu image changes, causing PostgreSQL, MySQL, and Rails test failures. Pinning dist: trusty keeps the older environment until the setup is updated.