Skip to content

Instantly share code, notes, and snippets.

@todashuta
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save todashuta/10b06c2e0cd28ee83213 to your computer and use it in GitHub Desktop.

Select an option

Save todashuta/10b06c2e0cd28ee83213 to your computer and use it in GitHub Desktop.
ある期間中の日曜日の数を数える written in Ruby
# See: https://plus.google.com/103883213408660487064/posts/EmxndYMnSxm
require 'date'
puts (Date.new(1990,1,1)..Date.new(2015,2,11)).count(&:sunday?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment