Consul 0.4.0 released

Consul 0.4.0 adds temporary power switching, support for Ruby collections and arbitrary objects as powers, and drops the ActiveSupport::Memoizable dependency.

Market share of web browsers

Browser usage on a site varies by audience and region; tracking tools provide broader traffic statistics when visitor data is unknown.

Check if an object is an ActiveRecord scope

Checking for an ActiveRecord scope with is_a?(ActiveRecord::NamedScope::Scope) breaks in Rails 3 and misses unscoped model classes. respond_to?(:scoped) is a broader check.

Use the "paper_trail" gem to track versions of records

Version history for Active Record records with paper_trail, including previous values, change diffs, and the user who made each update.

Updated: Remove quotes from Sass mixin arguments

Sass mixin arguments sometimes need unquote to pass raw values instead of quoted strings, especially when generating usable CSS.

Updated: assignable_values can now humanize any given value, even if it's not the current attribute

assignable_values now humanizes any supplied value, not only the current attribute value, making alternate labels available for display and lookup.

How to change will_paginate's "per_page" in Cucumber features

Pagination tests in Cucumber often need fewer records than the default will_paginate page size. Stubbing per_page per model keeps feature scenarios small.

Maximum size of a MySQL query

MySQL query size is limited by max_allowed_packet; the default is 16 MB, so oversized requests can fail unless the server setting is increased.

Using the Rake Build Language

Rake tasks can gain dependencies after initial declaration, making task relationships easier to extend and keep near prerequisite definitions.

When Date.today and Date.tomorrow return the same day...

Date.today and Date.tomorrow can return the same day when Rails has no configured time zone, causing date handling to drift between UTC and local time.

When connecting to a second database, take care not to overwrite existing connections

Opening a second ActiveRecord database connection can silently disconnect an unfinished transaction. Use a separate abstract class to keep the original connection intact.

MySQL operator precedence

Multiple AND and OR conditions can change query results unexpectedly; parentheses make the intended logic explicit and prevent precedence bugs.

Asset pipeline for Rails 2

Rails 2.3 can use the Rails 3.1 asset pipeline through a backport for managing and serving static assets.

Request limit of graph.facebook.com

Facebook API access is limited to 600 requests per 600 seconds; polling more often can return empty or malformed responses.

PhoneGap Build

Cloud compilation turns web apps into app-store ready builds for iOS, Android, Windows Phone, BlackBerry and more without changing your HTML, CSS or JavaScript workflow.

Drag'n'drop in trees: I went to town

Nested drag-and-drop for reorderable trees is hard when items can be leaves or containers; precise drop targets need custom JavaScript, CSS, and testing support.

Nice way to set data attributes when creating elements with Rails helpers

link_to and content_tag accept a :data hash for HTML5 data attributes in Rails 3, simplifying data-foo and data-bam output.

How to enable MySQL query logging

MySQL can record every received query for debugging at the cost of performance. Enabling the general query log helps inspect database activity on non-production systems.

jQuery.cssHooks – jQuery API

Custom $.cssHooks normalize browser-specific CSS properties and extend .css() and .animate() handling for inconsistent style values.

Updated: Capybara: Check that a page element is hidden via CSS

Hidden-element checks in Capybara can fail in Selenium when visibility is inferred too loosely. A JavaScript-based step works across Selenium, jQuery, Prototype, and Rack::Test.

Update Skype 4.x to at least 4.0.0.8

A Skype bug could send messages to the wrong recipients, including people outside your contacts. Upgrade to a fixed version immediately.

Updated: Check whether an element is visible or hidden with Javascript

Determining whether an element is truly visible in the browser can differ across JavaScript libraries; jQuery and Prototype use different visibility rules.

RubyMine: Using pinned tabs will increase your productivity

Pinned editor tabs keep important files visible in RubyMine while temporary search results can be closed without losing context.