Git: Apply a diff

git apply can place a diff onto HEAD, often replacing a rebase-and-merge workflow when reconstructing commits or working from a patch file.

Adding Jasmine JavaScript specs to a Webpack(er) project

Browser-based unit tests in a Rails app can run with Jasmine and Webpacker by separating test runner and spec packs; a /jasmine page makes the setup easy to open.

How to get a backtrace if rspec (or any other ruby process) hangs with no output

RSpec can freeze without output and ignore --backtrace or Ctrl-C; sending USR1 can print all thread backtraces from a running Ruby process.

Cucumber: Clear localStorage after each scenario

Client-side storage can persist between Cucumber scenarios even when cookies are cleared, causing test leakage in Selenium-driven browser runs.

Unpoly: Testing values for presence or blankness

Blank and missing values in JavaScript need explicit handling; Unpoly provides up.util.isBlank(), up.util.isPresent(), up.util.isMissing() and up.util.isGiven() for common and custom types.

How to: Fix json 1.8.3 with Ruby 2.5

json 1.8.3 fails to build on Ruby 2.5 because of removed C API constants; updating the gem resolves the native extension error.

Katapult EOL

Katapult reduced the effort of bootstrapping Rails apps, but its maintenance cost outweighed the gains and development has ended.

faviconit.com: Super-simple favicon generator

Simple favicon generation for web apps with image editing, multi-size output, and ready-made HTML for inclusion in Rails layouts.

LoDash: isBlank and isPresent mixins

JavaScript truthiness makes 0 and "0" look blank, while _.isEmpty only fits collections. Custom _.isBlank and _.isPresent give human-friendly checks.

Active Record and PostgreSQL — Ruby on Rails Guides

PostgreSQL offers native column types such as json and arrays that simplify data modeling in Rails and can replace awkward workarounds from MySQL.

Deal with certain travis CI failures

Travis CI builds can break after Ubuntu image changes, causing PostgreSQL, MySQL, and Rails test failures. Pinning dist: trusty keeps the older environment until the setup is updated.

Yarn: How to recognize that you are using a different node version than your colleagues

Mismatched Node.js versions can trigger Yarn integrity errors and unexpected node_modules changes, especially when dependencies are committed or .nvmrc is missing.

cucumber_factory: How to keep using Cucumber 2 Transforms in Cucumber 3

Cucumber 3 replaces legacy Transforms with ParameterTypes, but gem-defined steps and implicit argument conversion can still require backported behavior.

Bundler: How to install version 1 instead of 2 (latest version)

Installing Bundler 1 instead of Bundler 2 is needed for older Ruby versions, especially Ruby < 2.3, and gem install bundler -v '~>1' fetches the latest 1.x release.

Selenium may break with ChromeDriver 75+

ChromeDriver 75+ can trigger W3C errors in Selenium tests, and browser log access may fail. Disabling w3c in Chrome options restores the older behavior.

How to recognize CVE-2019-5418

Path traversal probes in Rails request parameters can indicate attempts to exploit CVE-2019-5418. Fixed releases block the vulnerability.

Execution of shell code in Ruby scripts

Deprecated Ruby ways to run shell commands can be unsafe or behave differently; capture3 is the preferred option for new code.

How to install npm packages globally without sudo on Linux

Install Node global packages in a user-owned directory so npm install -g works without sudo and added executables are available on your PATH.

Rails Asset Pipeline: Building an Icon Font from SVG Files

Asset pipeline setups can still build an icon font from SVG files, but the workflow needs manual generation and stylesheet integration.

Migrating from CoffeeScript to ES6

Moving from CoffeeScript to ES6 is straightforward with decaffeinate, which converts .coffee files to modern JavaScript and may need manual cleanup afterward.

Fun with Ruby: Returning in blocks "overwrites" outside return values

return inside a block can replace a method’s own result and skip later code, which can break Rails helpers like capture and lose html_safe? information.

Better compression for /boot partition

A too-small /boot partition can block updates; switching initramfs compression to xz may shrink boot images without resizing the partition.

Use "overflow: hidden" to avoid floating elements from wrapping a container's text

A floated sidebar can make surrounding text wrap underneath it; overflow: hidden creates a new block formatting context that keeps the content from flowing around the float.

Function Composition in Ruby

Ruby 2.6 adds Proc and Method composition, making functional-style chaining possible in Ruby code.