This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# super class that is stored in the database | |
class Message | |
... | |
end | |
class Linkedin::Message < Message | |
... | |
end | |
class Facebook::Message < Message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# super class that is stored in the database | |
class Message | |
... | |
end | |
module Linkedin | |
class Message < ::Message | |
... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'autotest/growl' | |
Autotest.add_hook :initialize do |at| | |
%w{.svn .hg .git vendor db public log script doc}.each {|exception| at.add_exception(exception)} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm package install zlib | |
rvm package install iconv | |
rvm package install readline | |
rvm install 1.9.2-head -C --with-readline-dir=$HOME/.rvm/usr --with-iconv-dir=$HOME/.rvm/usr --with-zlib-dir=$HOME/.rvm/usr --with-openssl-dir=/usr/local | |
gem install linecache19 -- --with-ruby-include=/Users/USERNAME/.rvm/src/ruby-1.9.2-VERSION/ | |
gem install ruby_core_source -- --with-ruby-include=/Users/USERNAME/.rvm/src/ruby-1.9.2-VERSION/ | |
gem install ruby-debug-base19 -- --with-ruby-include=/Users/USERNAME/.rvm/src/ruby-1.9.2-VERSION/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
# Original credits: http://blog.inquirylabs.com/2006/04/13/simple-uri-validation/ | |
# HTTP Codes: http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTPResponse.html | |
class ActiveRecord::Base | |
def self.validates_uri_existence_of(*attr_names) | |
configuration = { :message => "is not valid or not responding", :on => :save, :with => nil } | |
configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash) | |
configuration[:with] = /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix |
NewerOlder