Last active
September 13, 2022 02:28
-
-
Save fidelisrafael/3709913 to your computer and use it in GitHub Desktop.
Programmers Day!
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
class ProgrammersDay | |
def initialize | |
time = Time.now ; prog_day = (time.year % 4).zero? ? 12 : 13 # or prog_day = {true => 12 , false 13}[(Time.now.year % 4).zero?] | |
return puts "Today isnt programmer's day, return tomorrow =/" if (time.strftime("%d/%m/%Y") != "#{prog_day}/09/#{Time.now.year}") | |
return puts ((((RbConfig::CONFIG["host_os"] =~ /mswin32/ ? ENV["USERNAME"] : ENV["USER"]).capitalize + ", ") rescue "") + "Happy Programmer's Day") | |
end | |
end | |
ProgrammersDay.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment