"In traditional Japanese architecture, you start with one room—maybe the alcove, where you hang some pictures. You spend a lot of time trying to pick the right shelves, the right little pillar, what kind of handles the drawers will have. Only when you finish that room do you worry about the next. In the West, you start from the general and go to the specific. A Hitchcock movie might start off with a panorama of the city, and then the camera closes in on a street, and a house, and then the stairway inside. If you’re a Japanese filmmaker, you might start with the railing on the stairway."
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
| HEY_JUDE = <<-BEATLES | |
| Hey jude, don't make it bad. | |
| Take a sad song and make it better. | |
| Remember to let her into your heart, | |
| Then you can start to make it better. | |
| Hey jude, don't be afraid. | |
| You were made to go out and get her. | |
| The minute you let her under your skin, | |
| Then you begin to make it better. |
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
| Q: Has there been any Chinese awarded the Nobel Prize? | |
| A: Yes, but they all hold foreign passports (Samuel C. C. Ting, Yuan T. Lee, Steven Chu, Daniel C. Tsui, Roger Y. Tsien, Pearl S. Buck). | |
| Q: Has there been any Chinese citizen awarded the Nobel Prize? | |
| A: Yes, but they are all citizens of the Republic of China (Tsung-Dao Lee, Chen Ning Yang). | |
| Q: Has there been any citizen of modern China awarded the Nobel Prize? | |
| A: Yes, but he does not admit to be a Chinese citizen (Gao Xingjian). | |
| Q: Has there been any citizen of modern China, who admits to be Chinese, awarded the Nobel Prize? |
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
| Counting objects: 5, done. | |
| Delta compression using up to 4 threads. | |
| Compressing objects: 100% (3/3), done. | |
| Writing objects: 100% (3/3), 327 bytes, done. | |
| Total 3 (delta 2), reused 0 (delta 0) | |
| remote: /usr/lib/ruby/1.8/securerandom.rb:53:in `random_bytes': PRNG not seeded (OpenSSL::Random::RandomError) | |
| remote: from /usr/lib/ruby/1.8/securerandom.rb:53:in `random_bytes' | |
| remote: from /usr/lib/ruby/1.8/securerandom.rb:91:in `hex' | |
| remote: from /data/github/current/vendor/gems/ruby/1.8/gems/activesupport_notifications_backport-0.0.4/lib/active_support/notifications/instrumenter.rb:29:in `unique_id' | |
| remote: from /data/github/current/vendor/gems/ruby/1.8/gems/activesupport_notifications_backport-0.0.4/lib/active_support/notifications/instrumenter.rb:7: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
| unless ARGV.size == 2 | |
| puts "USAGE: ruby draw_something.rb ACKRCKOOLCWZ 5" | |
| exit 1 | |
| end | |
| letters = ARGV[0].downcase.split(//).sort | |
| length = ARGV[1].to_i | |
| require 'open-uri' | |
| uri = 'http://static.iminlikewithyou.com/drawsomething/wordlist.csv' |
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
| unless ARGV.size == 2 | |
| puts "USAGE: ruby guess.rb ACKRCKOOLCWZ 5" | |
| exit 1 | |
| end | |
| letters = ARGV[0] | |
| limit = ARGV[1] | |
| words = Hash.new { |h, word| h[word] = false } |
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
| (60 * 60).seconds # => 3600 seconds | |
| (60 * 60).seconds.parts # => [[:seconds, 3600]] | |
| (60 * 60).seconds.parts.size # => 1 | |
| ([1.second] * 60 * 60).sum # => 3600 seconds | |
| ([1.second] * 60 * 60).sum.parts.size # => 3600 |
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
| 1.day.ago # => Sun, 11 Mar 2012 18:58:25 EDT -04:00 | |
| 24.hours.ago # => Sun, 11 Mar 2012 18:58:28 EDT -04:00 | |
| 2.days.ago # => Sat, 10 Mar 2012 18:58:35 EST -05:00 | |
| 48.hours.ago # => Sat, 10 Mar 2012 17:58:38 EST -05:00 |
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
| # multiple exits | |
| if a | |
| code | |
| code | |
| code | |
| if b | |
| code | |
| code | |
| code | |
| return c |