Skip to content

Instantly share code, notes, and snippets.

@erez-rabih
Last active July 8, 2019 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erez-rabih/8066911738039116e31df9e850ccb331 to your computer and use it in GitHub Desktop.
Save erez-rabih/8066911738039116e31df9e850ccb331 to your computer and use it in GitHub Desktop.
(def millis-in-year (* 1000 60 60 24 365))
(defn serve-vodka [user-id]
(let [user (user/find-by-id user-id)
millis-since-born (- (System/currentTimeMillis) (:birthtime user))
years-since-born (/ millis-since-born millis-in-year)]
(if (>= years-since-born 21)
"Here's your vodka!"
"Too Young!")))
@0-admin
Copy link

0-admin commented Apr 15, 2019

31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment