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.

Task Switch in Linux Console

To pause and send a task to the background
ctrl+z

to reactivate the task
fg

to run task in background
bg

to see a list of so running tasks
jobs

Multi-line step arguments in Cucumber

Passing long text blocks to Cucumber steps keeps feature files readable while preserving full Markdown content for step definitions.

Add a method to an existing object

Use the attached initializer to do stuff like this

str = "abc"
str.imbue(:foo => 'foo value', :bar => 'bar value')
puts str.foo # 'foo value'
puts str.bar # 'bar value'

Change Paperclip secrets the hard way

Paperclip secret changes can move attachment files to new locations and break existing paths. A semi-automatic migration preserves uploaded files when secrets were copied between projects.