CSS: Using interaction media detection to disable hover styles for devices that have no hover

Touch devices can trigger sticky or accidental hover states, especially when hover changes the DOM. @media (hover) and @media not all and (hover) help keep hover-only styling off devices that cannot hover.

Logic in media queries

Media queries can express basic logic for viewport ranges and device capabilities using and, commas, and not all and syntax.

Beware: Don't name a controller action "cookies"

Naming a controller action cookies can override ActionController cookie access and break unrelated requests, causing redirects or storage failures.

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.

Rails: Disabling logging entirely

Rails logs can be silenced completely in a specific environment by replacing the logger with Logger.new('/dev/null').

Capistrano + Rails: Tagging production deploys

Production releases can be linked to Git history by tagging the deployed revision automatically with Capistrano.

Capistrano + Rails: Automatically skipping asset compilation when assets have not changed

Rails deployments can spend minutes precompiling assets; Capistrano can skip that work automatically when the code and asset files have not changed.

Fixing authentication in legacy applications

Legacy authentication setups often miss SSL, cookie, CSRF, and session-fixation protections, leaving logins and browser-stored data easy to compromise.

CSS: Using the current text color for other color properties

currentColor reuses the current text color for borders and other CSS color values, avoiding duplicated color declarations and keeping states in sync.

How to create a user with all privileges to MariaDB

MariaDB administrative access can be granted to a local user without a password, with unix_socket authentication, or by setting a password.

RubyMine: Scratch files

Temporary scratch files in RubyMine let you quickly edit or transform snippets without touching a project directory, with plugin-based access and keyboard shortcuts.

screenfull.js: Simple wrapper for cross-browser usage of the JavaScript Fullscreen API

Browser fullscreen handling is inconsistent across vendors, forcing boilerplate and event workarounds. screenfull provides a small wrapper for cross-browser fullscreen requests, exit, state, and change events.

Capistrano task to tail remote application logs of multiple servers

Monitor logs across multiple app servers from one terminal and avoid missing per-host errors; LOG selects another file, and terminal line truncation can hide long entries.

How to make Capistrano not truncate server output

Capistrano can hide long command output with ellipses, making deployment logs harder to read. Disabling Airbrussh truncation keeps full server paths and responses visible.

Unpoly: Loading large libraries on-demand

Large JavaScript libraries can be loaded only when needed to keep initial bundles small and avoid duplicate script execution, memory leaks, and repeated event handlers.

jQuery: How to replace DOM nodes with their contents

Remove selected HTML tags while preserving their inner text and other child nodes using contents() and unwrap() in jQuery.

ActionMailer: How to send a test mail directly from the console

Rails console debugging for mail delivery failures, with ActionMailer settings inspection and a direct test message to verify SMTP and spam score.

PostgreSQL: How to show table sizes

Large PostgreSQL databases can hide tables that consume most disk space. pg_total_relation_size and pg_size_pretty help identify the biggest relations quickly.

Persist Rails or IRB Console Command History After Exit

Keep Rails or IRB commands available after exit by saving console history to a file and increasing the retained history length.

Understanding IRB warning "can't alias ... from ..."

IRB may warn during boot when an alias conflicts with an existing method in its context, especially in programmatic setups.

Bundler error: Downloading gem revealed dependencies not in the API

Bundler can fail when a gem exposes dependencies missing from the API or lockfile; manually adding them to Gemfile.lock may restore bundle install.

Rails: How to provide a public link in a mail

Public file links in email can lose host and port information; combining root_url with a CarrierWave file path keeps contract URLs usable in mailers.

Fixing: Gem::Package::PathError: installing into parent path is not allowed

RubyGems 2.5.1 can raise Gem::Package::PathError during installation when the target path is invalid; updating RubyGems with gem update --system often resolves it.

Two CSS layouting techniques compared: Flexbox vs. Grid

Flexbox and Grid both handle responsive layout, but Flexbox fits one-dimensional arrangements while Grid is built for two-dimensional page structures.