Skip to content

Instantly share code, notes, and snippets.

@devstopfix
Created February 27, 2017 21:42
Show Gist options
  • Save devstopfix/92949751d34f950c80f2fe9b82307732 to your computer and use it in GitHub Desktop.
Save devstopfix/92949751d34f950c80f2fe9b82307732 to your computer and use it in GitHub Desktop.
Generate a non-semantic version number [1 year day-of-year]
#!/usr/local/bin/planck -cp
(ns accrete
(:require [cljs-time.core :as t]
[cljs-time.format :as f]
[clojure.string :refer [join]]))
(def this-year (-> (t/now) (t/year)))
(defn day-of-year []
(->> (t/now) (t/interval (t/date-time this-year)) (t/in-days) (inc)))
(defn ver []
(->> [1 (mod this-year 100) (day-of-year)]
(join ".")))
; planck -c ./accrete.cjs:`find ~/.m2 -name cljs-time*jar` -m accrete
(defn -main [name]
(print (ver)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment