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.

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.

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.

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.

responsive.is

Online tool for checking how a site renders across common desktop, tablet and phone screen sizes.

Using Thin for development (with SSL)

Local SSL development with Thin avoids mixed-content and redirect issues while testing force_ssl on localhost using a self-signed certificate and separate HTTP and HTTPS ports.

How to grep through the DOM using the Capybara API

Capybara can search page HTML in Ruby when CSS or XPath is awkward, but DOM changes can cause stale element errors.

Freeze (vendor, unpack) a single Ruby gem with and without Bundler

Vendoring a patched Ruby gem in Rails can fail without gem metadata, especially with Bundler. A proper .specification file and :path setup make the local copy usable.

Online tool to convert tables between different formats

Online table conversion helps move data between JSON, Markdown and CSV, with transpose support for rotated tables. Not suitable for sensitive data.

Rails logs are not flushed automatically (in Rake tasks)

Production Rake tasks can lose Rails log output because the logger buffers lines and does not flush on exit. Rails.logger.flush or a task wrapper writes pending entries to disk.

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.

httpbin: HTTP Client Testing Service

Generic endpoints for testing HTTP clients with slow connections, redirects, and compressed responses, useful when debugging timeout issues.

How to inspect RSS feeds with Spreewald, XPath, and Selenium

RSS feeds in Capybara can fail as XML inside the browser DOM; inspecting page source, using XPath, and opening the feed URL directly avoids false results.

Traversing the DOM tree with jQuery

jQuery traversal methods move a selection through the DOM tree to find descendants, ancestors, parents, children, or matching elements efficiently.

Rails: Reverse Lookup a Fixture Name by it's id and table name

Find a Rails fixture name from a table and numeric id when the record label is unknown. ActiveRecord::FixtureSet can search loaded fixtures and return the matching key.

Speed up JSON generation with oj

Use oj to generate JSON much faster for large Ruby hashes, but account for symbol handling, Rails compatibility, and HTML escaping to avoid XSS.

Cucumber.yml was found, but could not be parsed.

cucumber fails because cucumber.yml cannot be parsed; removing rerun.txt in the Rails directory often fixes the invalid rerun state.

Error "undefined method last_comment"

RSpec loaded by Rake can fail with NoMethodError: undefined method 'last_comment' when Rake 11 removes a method required by older rspec-core.

Resources for working with the Youtube API

Working with the YouTube Data API requires API keys and quota awareness; request costs vary by query type, so testing requests and understanding the domain model helps.

How to fix: Microphone recording levels are too quiet (or get lowered automatically)

Low microphone input makes calls hard to hear, and Skype can silently reduce recording gain. Adjusting the input level and disabling automatic mixer changes keeps speech audible.

Capybara 'fill_in': Ambiguous match for different input names

Capybara fill_in can raise Capybara::Ambiguous when visible field labels overlap. match: :prefer_exact or a global exact matching strategy avoids substring conflicts.

During deployment: "You are trying to install in deployment mode after changing your Gemfile"

Deployment can fail with a misleading Gemfile error when the server uses a newer Bundler than the version recorded in Gemfile.lock. Matching Bundler major versions on both sides prevents the install mismatch.