Downgrade Firefox 6 to Firefox 5 on Ubuntu

Firefox regression can break Selenium tests after an upgrade; running an older browser is unsupported and may leave the system unstable.

Prevent your Firefox from auto-updating

Freezing Firefox versions for broken Selenium tests is a poor long-term fix because old releases stop receiving security patches. Auto-update can be disabled via about:config, but keeping Firefox current is safer.

An ActiveRecord is invalid, but has no errors

before_validation returning false can make an ActiveRecord object invalid without populating errors, leaving validation failures hard to diagnose.

Distance of time in what you like: days, months, years

Rails’ distance_of_time_in_words can be too imprecise when a fixed unit is needed. A custom helper returns rounded differences in days, months, or years.

Print large PDFs as a poster

Convert a large PDF into tiled pages for printing as a poster using pdfposter; sizing the output can be awkward, but it works for oversized prints.

Best GitHub feature

Repository navigation becomes faster with GitHub’s file-name search shortcut, letting you jump to files immediately instead of scrolling through folders.

Random list of ActiveSupport goodies

Handy ActiveSupport helpers add callbacks, message signing and encryption, ordered options, array wrapping, deep hash merging, whitespace squishing, and zone-aware current time.

How to make a single check box (or image, etc) align vertically

Single inline controls like checkboxes or images can sit top-aligned inside a line-height container when they are alone; adding adjacent inline content or a non-breaking space centers them.

Ruby GetText will eval scripts containing ActiveRecord classes

Ruby-GetText may execute entire files while scanning for ActiveRecord models, so one-off scripts can run during PO rebuilds.

List sizes of MySQL databases

MySQL database directories can misrepresent real storage use when ibdata1 holds the data; querying information_schema.TABLES reveals per-database size in MB.

Grep the number of occurences in a file, counting multiple hits per line

grep -c counts matching lines, not repeated hits on the same line. Inserting line breaks with sed makes every occurrence count.

Solarized color scheme for Rubymine

Solarized support in RubyMine requires importing an IntelliJ port, and selecting a scheme can reset the editor font.

Fix: FreeBSD is not able to connect to the network

FreeBSD systems can fail to get network access even when rc.conf enables DHCP. Starting dhclient manually or rebooting can restore connectivity.

How to change the font in Sublime Text 2

Sublime Text 2 font appearance can be customized through user settings, including typeface and size, with changes applied immediately after saving.

Solve issues with Samsung TV as computer screen

Samsung TVs used as monitors can have audio routing problems, input lag, and oversharp text, and store settings only after leaving store-demo mode.

Create RAID on Amazon EC2 EBS volumes

Software RAID on Amazon EC2 EBS volumes improves I/O for database and other intensive workloads. mdadm creates the array and preserves it across reboots.

Solarized

A 16-color palette for terminal and GUI apps with calibrated lightness and hue relationships, built to stay readable across varied displays and lighting.

Marry Date::Performance and Spreadsheet gems

Date::Performance speeds up Ruby date methods but breaks Spreadsheet because Date.ajd_to_jd is missing from the C implementation.

"The certificate is not trusted because no issuer chain was provided." Error with SSL + Nginx

SSL connections fail when the certificate chain is incomplete. Appending the intermediate certificate to the server certificate lets Nginx present a trusted chain.

Capistrano: Delete old releases automatically

Capistrano keeps recent release folders on the server for rollback, and the retention count can be lowered with set :keep_releases, 3.

Resque + God + Capistrano

Capistrano deployment for a Resque app with God process monitoring and restart hooks, running under the deployment user without a system service.

How to: Store multiple Vim commands in macros and recall them

Vim macros record repeated command sequences for batch editing and reuse. @, @@, numeric prefixes, and . support quick reruns without retyping.

Chosen - makes select boxes better

Long, unwieldy dropdowns become easier to use with Chosen, a JavaScript enhancement available for jQuery and Prototype.

Thunderbird: Confirm encryption absence/presence before sending an e-mail

Prevent accidental leaks of sensitive mail by showing a confirmation before sending unencrypted messages; Enigmail can display whether OpenPGP encryption will be used and which keys apply.