How to remap keys in Ubuntu

Keyboard remapping in Ubuntu lets you change key behavior when layouts or hardware keys are inconvenient. xmodmap can adjust mappings using keycodes from xev.

Redactor WYSIWYG html editor

Lightweight WYSIWYG HTML editing for web apps, with a cleaner interface than TinyMCE or CKEditor and Rails integration.

Launch Gnome disk utility from command line

Launch the GNOME disk utility from the terminal with sudo palimpsest.

Ruby Scripts: Select the Ruby version in the shebang

Use rvm in a script shebang to run Ruby with a specific version instead of the system default.

News flash: Absolute CSS positioning on opposite sides is not a problem

Absolutely positioned boxes can use opposing offsets on both sides in modern browsers; only IE6 and older break this layout.

How to clear cookies in Capybara tests (both Selenium and Rack::Test)

Need to remove cookie data during a Capybara scenario when browser state must reset before the test ends.

How to: Build a "generic observer" widget for the awesome window manager

Periodic command output in an awesome panel can be turned into a widget with a timeout timer and escaped text.

LibreOffice Calc: Reset positions of split dividers

Split panes in LibreOffice Calc can end up in awkward positions; moving the dividers off screen and toggling splitting restores the default layout.

Inherit without Single-Table-Inheritance (STI) in ActiveRecord

ActiveRecord can inherit without STI when no type column exists or inheritance_column is overridden, making form models and presenters possible.

Duplicate a git repository with all branches and tags

Copying a Git repository with every branch and tag requires a bare clone and a mirror push to preserve the full ref set.

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.

How to find out if you are in Cucumber or in RSpec

Feature and spec code may need different behavior when Rails env is unavailable. Capybara.current_driver can distinguish Cucumber scenarios from RSpec examples.

Do HTTP referers survive a 301 redirect?

HTTP referer headers can persist across a 301 redirect, affecting analytics and referrer-based logic.

Quick git contributors list

git shortlog -s -n lists contributors by commit count for a revision range, making it easy to find the most active authors.

Using Thin for development (with SSL)

Local SSL development with Thin avoids mixed-content and redirect issues while testing force_ssl on localhost using a self-signed certificate and separate HTTP and HTTPS ports.

Howto: Create a self-signed certificate

Local HTTPS development often needs a trusted certificate; openssl or mkcert can create self-signed X.509 certificates for testing without browser warnings.

Use the same translations for ActiveRecord and ActiveModel

Duplicate model, attribute, and error translations for ActiveRecord and ActiveModel by reusing YAML anchors and aliases instead of maintaining separate locale entries.

JavaScript: How to generate a regular expression from a string

Build RegExp objects from strings, but literal characters are not escaped automatically. Escaping input avoids unintended matches, and flags are passed as a second argument.

Mac OS: Remove app from Launchpad

Remove a stuck app icon from Launchpad by deleting its entry from the Dock database and restarting Dock.

AngularJS: Access the scope for a rendered DOM element

Accessing the AngularJS scope attached to a rendered DOM node helps inspect or manipulate repeated elements, useful for advanced directives and drag-and-drop trees.

Good real world example for form models / presenters in Rails

Rails form-specific model layer for screen logic, separate validations, and callbacks without bloating the base model; useful for different workflows and presentable collections.

Git: How to show only filenames for a diff

Need a quick view of changed files without the full patch; git diff --name-only lists filenames, while --stat and --numstat add compact change counts.

Deal with different ways of counting weeks and weekdays in Ruby

Ruby Date uses different weekday and week-number conventions for ISO 8601 and North American calendars, affecting year boundaries and week calculations.