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.
Never use SET GLOBAL sql_slave_skip_counter with a value higher than 1
MySQL replication errors can be skipped safely only one event at a time; larger sql_slave_skip_counter values may skip unrelated binlog events and cause data inconsistency.
Ruby 1.8.7: Bundler crashes with "deadlock" and core dump
Bundler 1.14 can trigger deadlocks and core dumps on Ruby 1.8.7; using the newest compatible Bundler version avoids the crash.
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.
RSpec matcher to check if two numbers are the same
Numeric comparisons in RSpec can fail when BigDecimal, Float, and integers are mixed; a custom matcher compares their to_s values.
How to install guard-livereload 2.5.2 on Ruby < 2.2.5
Dependency conflicts block guard-livereload 2.5.2 on older Ruby versions; pinning listen below 3.1 avoids the Ruby 2.2.5 requirement.
eventmachine 1.0.3 failing to install native extensions
eventmachine 1.0.3 can fail while building native extensions; updating to 1.0.4 in Gemfile.lock resolves the install issue.
JSONP for Rails
JSON responses can be reused in legacy cross-domain requests by wrapping them in a callback function. rack-contrib provides a JSONP middleware for Rails apps.
Sass: Don't put CSS rules into partials that you import multiple times
CSS rules inside Sass partials are duplicated when the partial is imported more than once, bloating the compiled stylesheet.
[jruby] TruffleRuby Status, start of 2017
TruffleRuby is an experimental Ruby implementation pursuing much faster execution than MRI, with progress on Rails support, startup time, and JVM independence.
Geordi 1.6.1 released
dumple supports the --clean option for PostgreSQL pg_dump, making database export output easier to recreate by removing existing objects first.
An Introduction to Sending HTML Email for Web Developers
HTML email remains difficult because clients support standards unevenly, so layout, rendering, and responsiveness need special handling.
Enabling ** in your bash
** in bash is often disabled, so recursive globs stop at one directory level. Enabling globstar makes ** match any depth and can be persisted in .bashrc.
Chartkick
Create JavaScript charts from Ruby with a single line while keeping data local instead of sending it to Google.
Use Memoizer instead of ActiveSupport::Memoizable
ActiveSupport::Memoizable is being removed and has awkward edge cases; Memoizer provides straightforward method caching across Rails versions.
Ruby: String representations of regular expressions
Ruby regular expressions serialize more readably with inspect than to_s; source returns the pattern and options exposes the switch bitmask.
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.