Skip to content

Instantly share code, notes, and snippets.

@jcf
jcf / Moving ActiveRecord Errors.rb
Created September 17, 2009 10:52
Copy errors on an ActiveRecord object in to another instance's errors
# cat, dog = Cat.new, Dog.new
# cat.friends << dog
# cat.save
# => false
# cat.errors
# #<ActiveRecord::Errors ... @errors={"dog" => "is not valid"}>
# cat.errors << dog.errors
# cat.errors
# #<ActiveRecord::Errors ... @errors={"dog" => "is not valid", "bark" => "is not bigger than bite"}
@calas
calas / firefox_emacs_handler.rb
Created September 11, 2009 09:51 — forked from diasjorge/FirefoxEmacsHandler
Firefox emacs handler for textmate txmt:// protocol
#!/usr/bin/env ruby
# To install:
# about:config
# create a new boolean network.protocol-handler.external.txmt with value true
# create a new string network.protocol-handler.app.txmt with value path to the script
require 'rubygems'
require 'cgi'
require 'uri'