Skip to content

Instantly share code, notes, and snippets.

View yayitswei's full-sized avatar

Wei Hsu yayitswei

  • San Francisco, CA
View GitHub Profile
@yayitswei
yayitswei / clj-sse.clj
Created September 22, 2023 06:04 — 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)
@yayitswei
yayitswei / clj-sse.clj
Created September 22, 2023 06:04 — 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)
(ns datomic-helpers
(:require [clojure.java.io :as io]
[clojure.walk :as walk]
[datomic.api :as d :refer (db)]))
;;; Expose Datomic vars here, for convenience
(def tempid d/tempid)
(def connect d/connect)
(def create-database d/create-database)
(ns versaltest.core-test
(:require [cemerick.yonder :as yonder]
[clojure.java.browse :refer (browse-url)]
[compojure.handler :as handler]
[ring.adapter.jetty :as jetty]
[cljs.repl.browser]
[cljs.closure :as closure]
[clojure.tools.nrepl :as nrepl]
(clojure.tools.nrepl [server :as server]))
(:use clojure.test