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 Array; def rand; self[Kernel.rand self.length]; end; end | |
Array.new(rand(100)*2+1){[:pizza, :chinese, :greek].rand}.inject(Hash.new{0}){|h, i| h[i]+=1;h } |
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
*# | |
*~ | |
.#* | |
.DS_Store | |
.svn | |
db/*.sql* | |
db/schema.rb | |
log/* | |
tmp/* | |
test/* |
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
document.createElement('header'); | |
document.createElement('footer'); | |
document.createElement('section'); | |
document.createElement('aside'); | |
document.createElement('nav'); | |
document.createElement('article'); |
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
header, footer, section, aside, nav, article { | |
display: block; | |
} |
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
$(document).ready(function() { | |
$("a[rel='external']").attr('target', '_blank'); | |
}); |
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
fib = Hash.new {|hash, key| hash[key-1] + hash[key-2]} | |
fib[0],fib[1] = 0, 1 |
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
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. | |
Locking environment | |
Your bundle is already locked, relocking. | |
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize': not in gzip format (Zlib::GzipFile::Error) | |
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `new' | |
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize' | |
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:63:in `each' | |
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in `loop' | |
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in `each' | |
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:32:in `initialize' |
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
-----> Heroku receiving push | |
-----> Rails app detected | |
-----> Gemfile detected, running Bundler version 1.0.0.rc.5 | |
Unresolved dependencies detected; Installing... | |
Could not find rake-0.8.7 in any of the sources | |
FAILED: Have you updated to use a 0.9 Gemfile? | |
http://docs.heroku.com/gems#gem-bundler | |
error: hooks/pre-receive exited with error code 1 |
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 W_SimpleObject(object): | |
def getvalue(self, key = None): | |
for parent in self.get_mro(): | |
try: | |
return parent.getval(key) | |
except KeyError: | |
pass | |
return None | |
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 Foo(object): | |
def f(self, x=None): | |
print 'hello' | |
print x | |
return None | |
class Bar(Foo): | |
pass | |