About the HTML and the BODY tag

html and body behave differently from normal elements, making them poor choices for layout, sizing, and positioning; use them mainly for global defaults.

RubyMine crashes Ubuntu 11.04 window decorator on exit

Java GUI apps can crash Ubuntu 11.04’s window decorator on exit, leaving missing title bars and requiring a temporary restart of the decorator.

Accessing Rails config in webpack(er)

Rails secrets and other configuration values can be read inside webpack bundles with rails-erb-loader, enabling environment-specific client-side settings without hardcoding them.

How to open a new tab with Selenium

Browser popup blocking prevents window.open from Selenium; injecting a clickable temporary link opens a new tab reliably in Chrome.

Fix "subprocess installed post-removal script returned error exit status ..." when installing/removing/updating a package with apt

APT package operations can fail when maintainer scripts return exit status 78, often because postinst, postrm, or prerm scripts hit leftover files or mounted directories.

Selenium: How to close another tab (popup)

Closing a Selenium pop-up requires switching to its window handle and then pointing the driver back to another tab to avoid broken subsequent steps.

Parametrized shared example groups in RSpec

Parameterized shared examples make reusable RSpec behavior checks accept arguments and blocks, avoiding duplicated expectations across similar specs.

FactoryBot: Passing attributes to associated records using transient attributes

FactoryBot transient attributes can pass custom values into associated records, letting parent factories build children with dynamic names and flags.

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.

randym/axlsx · GitHub

Create XLSX spreadsheets in Ruby with charts, images, styling, auto column sizing, and schema validation; handles large files and eases migration from spreadsheet.

Request a non-HTML format in controller specs

Controller specs can exercise non-HTML responses such as PDF, Excel, XML or JSON by setting :format or the HTTP_ACCEPT header. The format value must be a String, not a Symbol.

Puppet: Could not evaluate: Field 'device' is required

Puppet mount failures can stem from a malformed /etc/fstab; rewriting the file can resolve missing device field errors during catalog runs.

How to pair a Bose Quiet Comfort 35 with your Ubuntu computer

Bluetooth on Ubuntu can pair with Bose QC35 but still lack audio output; disabling low-energy mode and enabling the PulseAudio Bluetooth module restores sound.

Linux: How to add a task bar to VNC displays

VNC sessions often lack window switching and a visible task list, making Selenium debugging awkward. A lightweight panel such as lxpanel restores task switching on the remote desktop.

Colcade is a lightweight Masonry alternative

Lightweight grid layouting for mixed-size items with smaller footprint and no dependencies; performance is better than Masonry, but column spanning and built-in transitions are missing.

A solid and unobtrusive plugin for form field placeholders

jQuery plugin for placeholder text in browsers without native HTML5 support, including IE6. Skips elements that already support the placeholder attribute.

Testing state_machine callbacks without touching the database

Testing state transition callbacks without database writes requires isolating callback methods from the event itself. spec_candy offers helpers to exercise them directly.

Match strings in a given order with Cucumber and Capybara

Verify that page text appears in a specific sequence while ignoring HTML markup, using a Cucumber step for plain-text order checks.

Rails: Disable options of a select field

Rails select helpers can disable specific options by value, preventing choice of unavailable entries in forms.

factory_bot: Re-use partial factory definitions

Shared factory attributes and traits can be reused across FactoryBot definitions by extracting a trait and mixing it into multiple factories.

How to find out which type of Spec you are

Runtime checks can identify the current RSpec spec type, letting shared setup run only for controller, helper, or request/response-aware examples.

Cucumber: Wait for any requests to finish before moving on to the next scenario

Selenium/Cucumber scenarios can finish before browser requests and redirects are done, leaving the session busy and breaking later steps and hooks.

Using FactoryBot in Development

Dummy development data is faster to create by reusing FactoryBot factories than by using the UI or Rails console records. Defaults, associations, traits, and attribute overrides come along automatically.

Rails console tricks

Quick console shortcuts for changing receiver context, inspecting objects, making requests, using helpers, and querying schema in a Rails session.