Skip to content

Instantly share code, notes, and snippets.

@wobh
wobh / ruby-mail-example.rb
Last active December 14, 2015 20:59
Basic usage of Ruby mail.
# https://github.com/mikel/mail
# http://rdoc.info/github/mikel/mail/Mail
#### Retrieving mail
yahoo_imap = {
:address => "imap.mail.yahoo.com",
:port => 993,
:user_name => "",
@wobh
wobh / rack_test_app.rb
Last active December 13, 2015 23:29
A simple rack app with response builder hack.
require 'pathname'
require 'pp'
class HTTPResponseBuilder
STATUS_CODES = {100 => "Continue",
101 => "Switching Protocols",
200 => "OK",
201 => "Created",
202 => "Accepted",
203 => "Non-Authoritative Information",