Skip to content

Instantly share code, notes, and snippets.

@maraigue
maraigue / devnull.rb
Created April 17, 2010 15:46
Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows) The newest version is available by "gem install devnull". See also: http://github.com/maraigue/devnull
# NOTE:
# This version is out-of-date.
# Please access http://github.com/maraigue/devnull for the versions under development.
# Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows)
# (C) 2010- H.Hiro(Maraigue) main@hhiro.net
#
# DevNull works like an IO object. For example:
# dn = DevNull.new
# dn.puts "foo" # => nil (do nothing)
@machu
machu / oauth-sample.rb
Created August 19, 2009 03:18
OAuth Consumer Example with Sinatra: http://www.machu.jp/diary/20090818.html#p01
require 'rubygems'
require 'sinatra'
require 'oauth'
require 'twitter'
helpers do
include Rack::Utils
alias_method :h, :escape_html
end