notes app

This commit is contained in:
Michiel Borkent 2020-03-29 14:50:57 +02:00
parent 3fd6dbd1f5
commit 90fe853f15

View file

@ -11,11 +11,11 @@
(.encodeToString (.getBytes (str user ":" password)))))
(def notes-file (io/file (System/getProperty "user.home") ".notes" "notes.txt"))
(io/make-parents notes-file)
(def file-lock (Object.))
(defn write-note! [note]
(locking file-lock
(io/make-parents notes-file)
(spit notes-file (str note "\n") :append true)))
;; hiccup-like