Skip to content

Instantly share code, notes, and snippets.

View sundbry's full-sized avatar
🔱
summoning the ancient gods

Ryan R Sundberg sundbry

🔱
summoning the ancient gods
View GitHub Profile
@oliyh
oliyh / clj-sse.clj
Last active September 22, 2023 06:04
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)
@Rud5G
Rud5G / gist:5604323
Created May 18, 2013 12:57
Gerrit Code Review - Mass Abandon or Mass Approve
# create alias for cli gerrit requests
alias gerrit='ssh -p 29418 gerrit.yourdomain.com gerrit'
# get tempfile for the ids
tmpfileids=$(tempfile -d /tmp)
# get all commit number ids for the project YOUR_PROJECT_NAME
gerrit query 'status:open project:YOUR_PROJECT_NAME' | egrep '^\ +number' | cut -d' ' -f4- > $tmpfileids
# do mass abandon