Last active
May 4, 2016 06:29
-
-
Save theHamdiz/b47dd88c794faf291261042f78902bb7 to your computer and use it in GitHub Desktop.
Get all fridays the 13ths from now on...
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 'date' | |
lazy_dates = (Date.today..Date.new(9999)).lazy | |
fridays_the_13th = lazy_dates.select { |d| d.friday? and d.day == 13 }.first(10) | |
puts fridays_the_13th |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment