Skip to content
View gist:f5b425a89cfcc6938a2a
class Object
def interesting_methods
case self.class
when Class
self.public_methods.sort - Object.public_methods
when Module
self.public_methods.sort - Module.public_methods
else
self.public_methods.sort - Object.new.public_methods
end
View hash.rb
class Hash
# traverse a nested hash, yielding keypath and value
def walk(path = [], &block)
self.each do |k,v|
path.push(k)
v.is_a?(Hash) ? v.walk(path, &block) : yield(path, v)
path.pop
end
end
end
View gist:6105218

Why the Ruby community is wrong about soft tabs

View gist:856066
chrome://net-internals/#events&q=type:SPDY_SESSION%20is:active
View sinatra-apps.txt
let's make a list of sinatra-based apps!
apps:
- http://github.com/cschneid/irclogger "Sinatra based irclogger.com"
- http://github.com/rtomayko/wink "minimalist blogging engine"
- http://github.com/foca/integrity "The easy and fun Continuous Integration server"
- http://github.com/sr/git-wiki "git-powered wiki"
- http://github.com/entp/seinfeld "Seinfeld-inspired productivity calendar to track your public github commits."
- http://github.com/karmi/marley "Marley, the blog engine without <textareas>. See in action @ www.restafari.org"
- http://github.com/ichverstehe/gaze "Serve up your Markdown files with this tiny Sinatra app!"
View gist:7546
module Merb
def self.cache
Merb::Controller._cache.store
end
end
class Merb::Cache::MemcacheStore
def fetch(key, options = {})
if !options[:force] && value = cache_get(key)
value
View gist:7218
module Merb
module GlobalHelpers
def include_templates
rv = '<div style="display: none;" class="jqt-templates">'
rv += glob_dir("#{Merb.root}/app/views/shared").join
rv += glob_dir("#{Merb.root}/app/views/#{controller_name.downcase}").join
rv + '</div>'
end
private
Something went wrong with that request. Please try again.