Skip to content

Instantly share code, notes, and snippets.

View S4G4R's full-sized avatar
💻
Working Remotely

Sagar Vrajalal S4G4R

💻
Working Remotely
View GitHub Profile
@S4G4R
S4G4R / router.cljc
Last active September 8, 2023 06:30
(def router
(rr/router
[["/" {:name :home
:title "Home"}]
["/blog" {:name :blog
:title "Blog"}]
["/hello" {:name :hello
:title "Hello"}]]))
@S4G4R
S4G4R / macro.clj
Created August 17, 2023 12:06
Macro with side effects
(defonce wallet (atom {:money 5000}))
(declare ^:dynamic *purchasing-fn*)
(defn purchase
[wallet {cost :cost}]
(swap! wallet update :money - cost))
(def items
{:bicycle {:id 1 :cost 50}