From 9d7c8f26e4b6454a7f627967467dc9db2c1da1e3 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 15 Nov 2021 12:58:44 -0800 Subject: [PATCH] [bin] add helper for getting Sneath's age --- bin/how-old-is-sneath | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 bin/how-old-is-sneath diff --git a/bin/how-old-is-sneath b/bin/how-old-is-sneath new file mode 100755 index 0000000..273a587 --- /dev/null +++ b/bin/how-old-is-sneath @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby + +require "date" + +birthday = Date.new(2021, 8, 14) +days = (Date.today - birthday).to_i +puts <<~EOF + #{days.to_i} days (#{days / 7} weeks, #{days % 7} days) +EOF