Ruby 2.0 Implementation Work Begins: What is Ruby 2.0 and What’s New?

Ruby 2.0 adds syntax changes, new features, and general improvements while remaining backward compatible with Ruby 1.9.3.

Run multiple local webricks at the same time using different ports

Run several local Rails servers at once by assigning each webrick instance a different port.

Using :dependent => :destroy – Issues with 'code arrangement' or 'cached objects'

dependent: :destroy runs in before_destroy, so callback order can change destruction behavior. Cached associations may destroy records unless they are reloaded first.

Fix multiple CKEditor instances using jQuery adapter - fixed since 4.2

jQuery adapter use can break CKEditor form submission, sending original textarea values instead of edited content when multiple instances share the built-in save path.

Parse & sort unique hits in logfiles

Count unique website hits per URL from logfiles by collapsing repeated requests from the same IP on a chosen date.

How to install a debian/ubuntu package without dependencies

Install a Debian or Ubuntu .deb even when dependency checks fail by modifying the package metadata; risky and can break the system.

Paste X selections into your terminal with your keyboard

X text selection can be pasted into a terminal with Shift + Insert, avoiding mouse-driven copy-and-paste for selected text.

Newly installed Android SDKs don't appear as build targets in Eclipse

New Android SDKs may stay hidden from Eclipse build targets until the IDE is restarted.

Javascript equivalent of Ruby's array.collect(&:method)

Calling a method on every element and collecting the results into a new array has no native JavaScript shorthand; library helpers like pluck fill the gap for property values.

Rails logs are not flushed automatically (in Rake tasks)

Production Rake tasks can lose Rails log output because the logger buffers lines and does not flush on exit. Rails.logger.flush or a task wrapper writes pending entries to disk.

Monitor a Rake task with God

Background Rake jobs can be tracked by God when the task writes its PID to a file path God expects; the process can then be restarted if it stops.

You can use any RSpec matcher to match arguments of method calls

RSpec method expectations can match arguments with any matcher, not just anything or hash_including, making loose argument checks more expressive.

Don't call gsub on safe strings

Calling gsub on html_safe strings can break backreferences like $1 and leave matches unusable. html_safe strings need special handling after substitution.

Capybara can match elements outside of <body>

Capybara can match elements outside body, including head nodes and hidden links, which helps test metadata and feed autodiscovery.

Mute a skype chat

Stop notifications from a single Skype chat without leaving it, or narrow alerts to specific keywords using /alertsoff and /alertson.

Mailcatcher: An alternative to inaction_mailer

Local email capture for Rails development avoids lost test messages and lets sent mail be viewed in a browser via MailCatcher.

How to update a MySQL column with ascending numbers

Assigning ascending values to an existing MySQL column can preserve a custom sort order, such as newest rows first, using a session variable and ordered UPDATE.

How to change the order of nested forms being rendered (especially blank forms)

Blank nested forms usually render last; reordering the one-to-many association changes their position and can move the empty form to the top.

Defining to_json and avoiding errors

Custom to_json methods can raise ArgumentError when their signature does not accept the expected options or arguments. Forwarding received arguments keeps JSON encoding compatible.

How to grep recursively on Solaris

Recursive grep is unavailable on Solaris, so searching files across directories requires a workaround with find and grep.

Start Rails console or server with debugger

Enable the Ruby debugger in script/console or script/server to inspect methods and local variables during a Rails session.

Git: Change author of a commit

Git commits can be reassigned to a different author when correcting attribution or rewriting shared history, using --author, --amend, or interactive rebase.

Properly adding fields with default values to a model

Avoid database defaults for new model fields; set existing rows in a migration and define defaults in the model with flag or has_defaults.

Single step and slow motion for cucumber scenarios using @javascript selenium

Pause Cucumber browser-driven tests between steps for debugging or demos, with single-step input and slower playback for @javascript Selenium runs.