-
-
Save sai43/c4a4a9b0294db68a21e06f5bada4c89b to your computer and use it in GitHub Desktop.
Get all fridays the 13ths from now on...
This file contains 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