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
" Vim color scheme | |
" | |
" My version of the Railscast VIM color scheme originally by: | |
" | |
" Name: railscast.vim | |
" Original Maintainer: Josh O'Rourke <[email protected]> | |
" License: public domain | |
" | |
" A GUI Only port of the RailsCasts TextMate theme [1] to Vim. | |
" Some parts of this theme were borrowed from the well-documented Lucius theme [2]. |
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
require 'memcache' | |
require 'digest/md5' | |
module Sinatra | |
class Cache | |
def self.cache(key, &block) | |
unless CONFIG['memcached'] | |
raise "Configure CONFIG['memcached'] to be a string like 'localhost:11211' " | |
end | |
begin |
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
#!/usr/bin/env ruby | |
def duration_for spec | |
ret = nil | |
if((m = %r/^ (\d+(?:\.\d+)?) : (\d+(?:\.\d+)?) : (\d+(?:\.\d+)?) $/iox.match(spec.to_s))) | |
m, h, m, s, ignored = m.to_a | |
h, m, s = Float(h), Float(m), Float(s) | |
ret = (h * 60 * 60) + (m * 60) + (s) | |
else | |
pat = %r/(\d+(?:\.\d+)?)\s*([sSmMhHdDwWyY][^\d]*)?/ |
NewerOlder