Hack of the day: A reverse for Rails' &:

Ruby has a reverse of Rails' each(&:method) shorthand for calling an object method with each element: each(&object.method(:call)).

Change the timestamp of a file in Ruby

Set a file's modification time in Ruby with FileUtils.touch; it can create missing files and update multiple paths at once.

See which Rails applications are being served by your Passenger

passenger-memory-stats lists Passenger processes with application directories and memory usage, making it easy to identify which Rails apps are currently served.

Force Google Chrome to run in English on Linux

Google Chrome can inherit a non-English browser language from the Linux locale, which affects sites and Selenium tests. Keeping only en locale files forces Chrome to use English.

What to do when Google only syncs some of your contacts

Google contacts may stop syncing to e-mail clients or phones when they are not in the "My Contacts" group; moving them there restores synchronization.

How to fix: undefined method `specifications' (caused by RubyGems 1.8)

RubyGems 1.8.5 can abort rake tasks with undefined method 'specifications' on /usr/lib/ruby/gems/1.8; a manual patch or version downgrade restores gem path handling.

Sanitize filename with user input

Building filenames from user input can create security issues; a whitelist-based sanitizer replaces unsafe characters and can transliterate Umlauts before saving or downloading.

RubyMine crashes Ubuntu 11.04 window decorator on exit

Java GUI apps can crash Ubuntu 11.04’s window decorator on exit, leaving missing title bars and requiring a temporary restart of the decorator.

How to use helper methods inside a model

Calling view helpers from a model is possible through ApplicationController.helpers, delegation, or a custom proxy when model code needs presentation logic.

Unsafe string methods in Rails

Rails SafeBuffer loses HTML safety after many string transformations, and in-place replacement can raise TypeError; this prevents injection tricks through user input.

markbates/coffeebeans

When CoffeeScript was added to Rails 3.1 they forgot one very important part, the ability to use it when responding to JavaScript (JS) requests!

In Rails 3.1 it’s incredibly easy to build your application’s JavaScript using CoffeeScript, however if you fire off an AJAX request to your application you can only write your response using regular JavaScript and not CoffeeScript, at least until CoffeeBeans came along.

How to use Git on Windows with PuTTY

Use PuTTY's plink.exe and Pageant to make Git work over SSH on Windows, with keys loaded from the tray agent and GIT_SSH set for command-line use.

Using RSpec's late resolving of "let" variables for cleaner specs

Lazy let evaluation keeps RSpec examples shorter when a setup call has many required arguments, and lets stubs change the result before the value is used.

How to upgrade RubyMine

Upgrading RubyMine safely keeps the previous version available and preserves settings, license data, and launchers during the switch to a newer release.

Read your mail in networks that forbid e-mail traffic

Restricted networks can block mail protocols while still allowing SSH. Tunneling the mail connection through a trusted server lets an e-mail client reach the server from localhost.

Move a Gnome panel to another monitor in Ubuntu

Moving a GNOME panel to another monitor in Ubuntu 11.04 requires disabling Expand, dragging the grip handles, then enabling Expand again.

Opening Rubymine projects from the command line

Open RubyMine projects directly from the terminal with the mine launcher, attaching to a running instance or starting the IDE if needed.

Lessons learned from implementing Highrise's custom fields feature

We recently added custom fields to Highrise which allow you to keep track of extra details beyond standard contact information like phone, email, address, etc. After the launch, we had a “looking back” conversation to see what lessons could be learned from the process.

Better is better: improving productivity through programming languages

Programming language popularity rises and falls with productivity trade-offs, tooling, and developer experience rather than technical elegance alone.

The Rise of "Worse is Better"

An ancient essay on software design that, after 20 years, should still guide you for every line of code you write.

When Google analytics won't let you add a @googlemail.com account

Google Analytics may reject older @googlemail.com accounts as invalid Google accounts; using the equivalent @gmail.com address can resolve the sign-in problem.

"no such file to load require_relative (MissingSourceFile)" after installing ruby-debug

Installing ruby-debug can trigger a MissingSourceFile error from require_relative; pinning linecache to version 0.43 resolves the load failure.

Helpers to render (money) amounts

Formatting numeric and currency values for display, with configurable decimal separators, minimum precision, and a dash for missing amounts.

Why developers should be force-fed state machines

Most web applications contain several examples of state machines, including accounts and subscriptions, invoices, orders, blog posts, and many more. The problem is that you might not necessarily think of them as state machines while designing your application. Therefore, it is good to have some indicators to recognize them early on. The easiest way is to look at your data model.