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.
Ruby: How to make an object that works with multiple assignment
Ruby multiple assignment can pull values from a single object by calling to_a; defining to_a lets custom classes support destructuring into several variables.
Fix Slack call overlay on Awesome WM
Slack call overlay windows can hijack large parts of the screen in Awesome WM. A floating, always-on-top rule keeps the call panel out of the way.
Spreewald: Content-Disposition not set when testing a download's filename
Public file downloads may miss Content-Disposition, so filename checks fail in Spreewald. Matching only Content-Type or testing the downloaded file avoids flaky download assertions.
Capybara steps to match stuff within any selector
Capybara within scopes only the first matching element, so tests that need all matches use “inside any” Cucumber steps instead.
How to fix broken font collisions in wkhtmltopdf
PDFKit and wkhtmltopdf can ignore CSS font names when font metadata collides, causing one face to dominate or local files to fail. Fixing internal font names or embedding fonts restores proper rendering.
How to add a custom dictionary to Ruby Mine
RubyMine can use a custom spell-check dictionary for project-specific terms and nonstandard words. A UTF-16 dictionary must be converted to UTF-8 and added in Settings.
How to move all files in a folder to a new subfolder
Move every file in a directory into a newly created subfolder with mv, avoiding the destination folder itself with a shell glob pattern.
How to exploit websites that include user input in their CSS
Unsanitized user input in CSS can enable exploitation in web apps, and CSS input sanitization is harder than HTML sanitization.
A Theme Switcher
Implementing an inverted night-mode look with a few lines of CSS keeps image colors intact while changing the page appearance.
Bundler 2 will rename Gemfile and Gemfile.lock
Bundler 2.0 renames Gemfile to gems.rb and Gemfile.lock to gems.locked, with old filenames supported until Bundler 3.0.
Association to polymorphic model does not determine inverse_of automatically
Nested polymorphic associations can fail to save because Rails does not infer the inverse automatically; setting :inverse_of on the parent relation fixes the validation error.
How to enable the Thinkpad microphone mute key on Ubuntu 16.04
ThinkPad microphone mute key stopped working on Ubuntu 16.04 after an upgrade. Binding the ACPI event to amixer restores hardware mute control.
Rails: render a template that accepts a block by using the layout option of render
Reuse a form partial with a customizable submit section by rendering it as a layout and yielding the form object into a block.
How to change the class in FactoryBot traits
FactoryBot traits cannot use :class; a nested factory or initialize_with can build the desired subtype instead.
Import Excel files without running into memory limitations
Reading large XLSX files can exhaust memory when every cell becomes a Ruby object. Stream-based parsers like Roo and Creek avoid loading the full spreadsheet at once.
Ubuntu MATE: Fixing ALT + TAB being really slow
ALT+TAB in Ubuntu MATE can become unusably slow because the application switcher renders live thumbnails for each window. Disabling thumbnails or software compositing restores fast switching.
Sentry: How to get a list of events that is programmatically processable
Programmatic access to the latest issue events in Sentry is available as a JSON list through the events API endpoint.
Postgres: How to force database sessions to terminate
PG::ObjectInUse blocks dropping or resetting a PostgreSQL database when other sessions stay connected. Find the backend PID and terminate the process when needed.
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.
JavaScript bookmarklet to click an element and copy its text contents
Click any page element to capture its text or input value, highlight the target, and copy the cleaned content through a browser prompt.
Custom Ruby method Enumerable#count_by (use for quick statistics)
Quick statistics on collections often need grouping, counting, and sorting. Enumerable#count_by combines them for flexible Ruby-based frequency counts beyond database columns.
Async/Await Will Make Your Code Simpler
Async JavaScript can become long and deeply nested when promises are handled awkwardly; async/await offers a cleaner syntax for readable asynchronous code.
JavaScript: How to query the state of a Promise
Native promises do not expose their current state, which makes state checks in unit tests awkward; a promiseState helper can distinguish pending, fulfilled, and rejected promises.