Skip to content

Instantly share code, notes, and snippets.

View eerohele's full-sized avatar
🐺

Eero Helenius eerohele

🐺
View GitHub Profile
@athos
athos / deps.edn
Last active June 2, 2024 08:57
Try on your terminal `clojure -Sdeps '{:deps {hello-clojure/hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :git/sha "099bdf7d565b2c35c1df601abf58514cc5276237"}}}' -M -m hello-clojure`
{:paths ["."]
:deps {clansi/clansi {:mvn/version "1.0.0"}}}
@peterwang
peterwang / my-macros.clj
Last active November 11, 2021 09:48
Clojure Macro-writing Macros step by step.
;;; Clojure Macro-writing Macros step by step.
(ns my.macros)
;; => nil
;;;;;;;; ns and vars
*ns*
;; => #namespace[my.macros]
(def x 3)
;; => #'my.macros/x
@malcolmsparks
malcolmsparks / thoughts-on-yada.adoc
Last active January 22, 2023 19:24
Thoughts on yada

Thoughts on yada

Frameworks

Let’s define a framework as any library that contains one or more functions that accept callbacks.

Web frameworks are great for beginner developers who need to get stuff done. But they ultimately force you into a corner. In most applications, experienced developers need to retain control. Libraries are better.

;;=============== play with flow ==============
(require '[clojure.core.async :as async]
'[clojure.core.async.flow :as flow]
'[clojure.pprint :as pp]
'[clojure.datafy :as d]
'[clojure.walk :as w])
(set! *warn-on-reflection* true)
(defn monitoring [{:keys [report-chan error-chan]}]
(require '[clojure.core.async :as async]
'[clojure.core.async.flow :as flow]
'[clojure.pprint :as pp])
;; Monitoring function to show the built-in reporting and error handling
;; This showcases the centralized monitoring capabilities of the flow system
(defn monitoring [{:keys [report-chan error-chan]}]
(prn "========= monitoring start")
(async/thread
(loop []