Skip to content

Instantly share code, notes, and snippets.

View bricejlin's full-sized avatar

bleezi bricejlin

  • New York
View GitHub Profile
@bricejlin
bricejlin / gist:6399502
Last active December 22, 2015 01:49
ruby learning wk 2 ex 3
def leap_year?(year)
if year % 100 == 0
year % 400 == 0 ? true : false
else
year % 4 == 0 ? true : false
end
end
def minutes_in_year(year)
if leap_year?(year)
@bricejlin
bricejlin / gist:6399326
Created August 31, 2013 16:42
ruby learning wk 2 ex 1
s = <<-STRING
Line 1: Welcome to the forum.
Line 2: Here you can learn Ruby.
Line 3: Along with other members.
STRING
puts s
age = 979_000_000 / (60 * 60 * 24 * 365.0)
puts "%.2f" % age