This file contains hidden or 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
class Object | |
Dir[root_path("app/models/*.rb")].each do |file| | |
autoload File.basename(file, '.rb').camelize, file | |
end | |
end |
This file contains hidden or 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
# default.gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator | |
activemodel -v3.0.0.beta | |
activerecord -v3.0.0.beta | |
activesupport -v3.0.0.beta | |
archive-tar-minitar -v0.5.2 | |
arel -v0.2.1 | |
builder -v2.1.2 | |
carrierwave -v0.4.5 | |
columnize -v0.3.1 | |
crack -v0.1.7 |
This file contains hidden or 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
<div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/<%= Blog.disqus_shortname %>/embed.js"></script><noscript><a href="http://<%= Blog.disqus_shortname %>.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> |
This file contains hidden or 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
" Ruby | |
au BufNewFile,BufRead *.rb,*.rbw,*.gem,*.gemspec set filetype=ruby | |
" Ruby on Rails | |
au BufNewFile,BufRead *.builder,*.rxml,*.rjs set filetype=ruby | |
" Rakefile | |
au BufNewFile,BufRead [rR]akefile,*.rake set filetype=ruby | |
" Rantfile |
This file contains hidden or 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 syntax file | |
" Language: Ruby | |
" Maintainer: Doug Kearns <[email protected]> | |
" URL: http://vim-ruby.rubyforge.org | |
" Anon CVS: See above site | |
" Release Coordinator: Doug Kearns <[email protected]> | |
" ---------------------------------------------------------------------------- | |
" | |
" Previous Maintainer: Mirko Nasato | |
" Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN) |
This file contains hidden or 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 zsh | |
function resolve_symlink() { | |
local result=`readlink $1` | |
[ -z $result ] && echo $1 || $0 $result | |
} | |
function expand_path() { | |
cd -qP $1 | |
pwd |
This file contains hidden or 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 'rubygems' | |
require 'sinatra' | |
require 'twitter/login' | |
require 'haml' | |
use Rack::Session::Cookie | |
use Twitter::Login, | |
consumer_key: "__YOUR_KEY_HERE__", | |
secret: "__YOUR_SECRET_HERE__", | |
return_to: "/authenticated" |
This file contains hidden or 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 'open-uri' | |
require 'benchmark' | |
total = Benchmark.realtime { | |
threads = 30.times.map do | |
Thread.new { | |
gamers = Benchmark.realtime { | |
open("http://boughtstuff.com").read | |
} | |
puts "-----> Done in #{gamers}!" |
This file contains hidden or 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
__END__ | |
-----> Done in 6.2943651676178! | |
-----> Done in 6.49692893028259! | |
-----> Done in 6.55151987075806! | |
-----> Done in 6.82303881645203! | |
-----> Done in 6.86100506782532! | |
-----> Done in 6.87509894371033! | |
-----> Done in 6.94020700454712! | |
-----> Done in 7.06164002418518! | |
-----> Done in 7.09178400039673! |
This file contains hidden or 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 "ostruct" | |
module Spawn | |
Invalid = Class.new(ArgumentError) | |
def spawner &default | |
@@spawn ||= Hash.new | |
@@spawn[self] = default | |
end |