Airbrake notification in Rake tasks

Rake tasks can report exceptions to Airbrake without notifying in development or test environments, using the usual notification rules for tasks that depend on :environment.

The dangers of url_for in Rails applications

In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used.<br />
<br />
Most often we use foo_path, which when used in Rails URL helpers will generate a relative path, where foo_url generates a full URL. In most cases the path makes most sense, but not always.

Make box shadows look the same in IE and other browsers

The box shadows created rendered in IE by CSS3PIE look darker and are blurred differently than in browsers that render box-shadow natively.

If possible, try to be OK with this. If not, make an IE-only stylesheet that uses a different color and blur radius:

// Real browsers:
+box_shadow("0 4px 10px #bbb")

// IE with PIE:
+box_shadow("0 5px 15px #888")

We should try to package this solution in a neat way so we don't need different stylesheets.

See also this [cross-browser box-shadow comparison]...

Scope to records with a given state in state_machine

with_state from state_machine can break in complex scope chains; a custom having_state scope keeps record filtering reliable.

Fighting the @font-face FOUT « Paul Irish

Cached web fonts can still cause a flash of unstyled text during loading.

Bundler for Rails 2.3.x

Bundler support for Rails 2.3.x requires updated RubyGems and Passenger, a bundled Gemfile workflow, and bundle exec for tests and deployment.

Disable Rails XSS protection in ActionMailer views

Rails XSS protection can escape ActionMailer email bodies unexpectedly. A configuration initializer prevents rails_xss from escaping mail content.

Use the same template for multiple ActionMailer actions

One option is to use partials. Or you can set the @template field to the name of another action:

class Mailer < ActionMailer::Base
  def foo
    subject "Hello World"
  end
  
  def bar
    subject "Hello Universe"
    @template = 'foo'
  end
end

Recursively remove unnecessary executable-flags

Unexpected executable bits can appear on normal project files after copying from Windows or a Samba share. geordi remove-executable-flags clears them recursively with chmod -x.

Hide the last bottom margin in a container

Child elements’ bottom margins can create unwanted inner spacing in boxes like sidebars. A Sass mixin removes the last child’s bottom margin; older IE needs a class fallback.

Linux: create a symbolic link

You may omit the /path/to/link_name to have a link with the same filename appear in the current directory

ln -s /path/to/file /path/to/link_name

unlink link_name       // to remove the link and not where it is pointing at

Vadikom » Poshy Tip - jQuery Plugin for Stylish Tooltips

With this plugin, you can create a scalable tooltip by just using a single background image for the tooltip body.

Prototip 2 - Create beautiful tooltips with ease

Prototip allows you to easily create both simple and complex tooltips using the Prototype javascript framework.

Please note: "Permission to use Prototip on your domain is required and can be obtained by paying a small fee."

Programming Things I Wish I Knew Earlier

The point is, evented I/O is not magic scalability pixie dust, and like anything, there is a tradeoff.

Boolean attributes and pretty enumerations in Cucumber Factory 1.7

Boolean attributes can now be set by appending "which", "that" or "who" at the end:

Given there is a movie which is awesome
And there is a movie with the name "Sunshine" that is not a comedy
And there is a director who is popular

Instead of "and" you can now also use "but" and commas to join sentences:

Given there is a movie which is awesome, popular and successful but not science fiction
And there is a director with the income "500000" but with the account balance "-30000"

Update with `sudo gem install cucumber_facto...

Spec correct routing of custom URLs

When you roll custom URLs with hacks like routing-filter, you can put a spec like this into spec/routing/routing_spec.rb:

jQuery autocomplete with multiple values

Autocomplete input that accepts multiple entries in one field using jQuery and jQuery UI styling; a temporary workaround before built-in multi-value support.

Testing validates_format_of with Shoulda matchers

validate_format_of can fail in odd ways with Shoulda; allow_value is the safer matcher for checking valid and invalid email formats.

Ruby Java Bridge

rjb is a bridge software. It connects Ruby and Java.

Get rid of US keyboard layout

Problem:

Keyboard layout reverting to US on (every) reboot

Cause:

I found the same problem, but only on my wife's account. I'd set her keyboard layout to UK through Gnome preferences and every time the US layout would reappear and be selected frustratingly.\
It turned out that on the gdm login screen her choice of keyboard layout in the discreet option bar at the bottom of the screen was set to US. That was then overriding the Gnome layout preference.

Solution:

Selecting the appropriate keyboard layout on the next login solved the...

schacon's showoff at master - GitHub

the best damn presentation software a developer could ever love

Regular Expressions - Cheat Sheet

Regular-expression syntax for matching characters, boundaries, alternation, quantifiers, look-arounds, and Ruby modifiers. Useful for writing and debugging patterns safely.

Default implementation of resource_controller actions

Default CRUD action flow for resource_controller with callbacks, flash handling, and success or failure responses around object loading and persistence.

Run a POP3 server on a directory of mail files with popthis

Serve a directory of generated mail files as a local POP3 mailbox for testing clients and inaction_mailer output.