Skip to content

Instantly share code, notes, and snippets.

View kaffein's full-sized avatar
🎯
Focusing

Aina RAZAFIMAHEFA kaffein

🎯
Focusing
  • Yetibot
  • Oslo, Norway
View GitHub Profile
@kaffein
kaffein / .gitignore
Created April 15, 2020 15:38 — forked from DarrenN/.gitignore
Emacs setup for Clojure
shibuya.el
dazza.el
elpa/
places
eshell/
.smex-items
ac-comphist.dat
projectile-bookmarks.eld
@kaffein
kaffein / clj-sse.clj
Created November 14, 2018 17:20 — forked from oliyh/clj-sse.clj
Clojure client for Server Sent Events (SSE)
(require '[clj-http.client :as http])
(require '[clojure.core.async :as a])
(require '[clojure.string :as string])
(require '[clojure.java.io :as io])
(import '[java.io InputStream])
(def event-mask (re-pattern (str "(?s).+?\r\n\r\n")))
(defn- parse-event [raw-event]
(->> (re-seq #"(.*): (.*)\n?" raw-event)