- Install getmail (aptitude install getmail4)
- Set Up Your Imap Server (tl;dr)
- getmail
ruby date_based_archive.rb ~/Maildir/.Archive
This file contains 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
def things_I_tried | |
# didn't work | |
render :js => "alert('sucks')" | |
render :text => "<script>alert('blah')</script>;", :content_type => "text/javascript" | |
# worked | |
javascript_tag("alert('ftw')") | |
end |
This file contains 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
# Original find_for_authentication from Devise authenticatable.rb | |
def find_for_authentication(conditions) | |
find(:first, :conditions => conditions) | |
end | |
# Overwrite find_for_authentication and put it in your User model | |
def self.find_for_authentication(conditions={}) | |
if conditions[:login] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex |