Skip to content

Instantly share code, notes, and snippets.

@briandailey
Created September 27, 2012 19:58
Show Gist options
  • Select an option

  • Save briandailey/3796133 to your computer and use it in GitHub Desktop.

Select an option

Save briandailey/3796133 to your computer and use it in GitHub Desktop.
method to check a year to see if it's a leap year.
def is_leap_year?(year)
return true if year % 400 == 0
return false if year % 100 == 0
return true if year % 4 == 0
false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment