JavaScript Coordinates

Positioning elements in JavaScript depends on window-relative and document-relative coordinates; mixing them causes misplaced layouts and incorrect measurements.

SASS: Defining linear sizes

SASS mixin for fluid calc() sizing between two breakpoints, letting padding, margin, or height scale proportionally instead of stepping.

How to show an ordered crontab

Unordered crontabs are hard to scan; sorting scheduled rows by time makes recurring jobs easier to read, including @reboot entries.

ActiveRuby

Commercial Ruby distributions for enterprises and smaller teams add secure builds, technical support, updates, and IP indemnification for business applications.

The pitfalls of postMessage

postMessage enables cross-origin data exchange, but careless use can create client-side security vulnerabilities and make origin handling error-prone.

VCR: Inspecting a request

VCR can stub remote API calls in tests while still letting you inspect what was sent, including request payloads, through WebMock.

Open dialogs from shell scripts

dialog lets shell scripts open text-based popups for prompts, choices, file selection, progress, and calendars without leaving the terminal.

Thinkpad: Disable Bluetooth on start-up

Bluetooth starts enabled on some ThinkPads and can be turned off automatically during boot with a simple rc.local command.

CSS tests and experiments

Tests and experiments around CSS features, possibilities, and browser bugs across more than 200 cases.

Ruby and Rails deprecation warnings and how to fix them

Ruby and Rails deprecations can hide runtime problems and break future upgrades. Typical fixes involve updating gems, replacing obsolete API calls, or adding compatibility shims.

Getting error Bundler::Plugin::API::Source

Bundler raises Bundler::Plugin::API::Source NameError on older RubyGems versions; upgrading RubyGems beyond 2.6.9 resolves the failure.

Properly require your "spec_helper"

Different require paths for spec_helper can execute the same file multiple times in Ruby 1.8; using one consistent require 'spec_helper' avoids duplicate loading.

Some useful vim settings

Practical Vim configuration for safer editing, cleaner indentation, better search behavior, and persistent undo, using settings that reduce friction in daily use.

RubyMine: Better soft wraps

Long code lines are hard to read in narrow editor panes; RubyMine soft wraps improve visibility without changing files and can preserve original indentation.

JavaScript Start-up Performance

JavaScript parse and execution can delay app interactivity long after download, making heavy startup code a common cause of slow page load.

How to get the currently selected text in Javascript

Retrieve the user’s highlighted text in the browser with window.getSelection(). Browser support starts at IE9+, Android 4.3+, and Safari 5+.

JavaScript: Hash/Object with default value

Use Proxy to make a JavaScript object return a default value for missing properties instead of undefined, for modern browsers only.

Bug in Chrome 56+ prevents filling in fields with slashes using selenium-webdriver/Capybara

Chrome 56+ can drop slashes when fill_in runs through Selenium and Capybara, breaking form input for paths and HTML strings; a JavaScript workaround updates the field directly.

Linux: Quickly create large files for testing

Create large placeholder files fast for testing disk usage, storage limits, or performance without writing real data using fallocate.

Versatile Cucumber step regarding hovering above elements

A reusable Cucumber step triggers hover events on matched page elements, useful with Spreewald and BEM selector auto-mapping in feature tests.

Capybara: Disable sound during Selenium tests

Integration tests can trigger browser audio; passing --mute-audio to Chrome through Capybara’s Selenium driver disables sound. No equivalent Firefox command-line option is noted.

rbenv: A basic introduction

Multiple Ruby versions can coexist on one machine for old projects and per-project switching. rbenv selects the right interpreter automatically from .ruby-version.

Partially disable animations for Angular 1.4+

Control AngularJS ng-show, ng-hide, and ng-class animations selectively with $animateProvider.classNameFilter, so only chosen elements animate.