Skip to content

Instantly share code, notes, and snippets.

(ns synchro.core)
;; server
(defonce server-list (atom []))
(defonce appender (atom nil))
(defonce appending-fiber (atom nil))
(defonce subscriber (atom identity))
(defn subscribe [f]
(ns synchro.core)
;; server
(defonce server-list (atom []))
(defonce appender (atom nil))
(defonce appending-fiber (atom nil))
(defonce subscriber (atom identity))
(defn subscribe [f]
(ns synchro.core)
;; server
(defonce server-list (atom []))
(defonce appender (atom nil))
(defonce appending-fiber (atom nil))
(defonce subscriber (atom identity))
(defonce synchro-fiber (atom nil))
(ns success.success-examples
(:use expectations erajure.core))
;; mock interaction based testing
(expect-let [r (mock Runnable)]
(interaction (.run r))
(.run r))
(expect (interaction (my-fn anything) :never)
(a-fn-that-shouldnt-call-my-fn))
(expect (interaction (my-fn anything&) :never)
(a-fn-that-shouldnt-call-my-fn))
(expect (interaction (log :warn anything&))
(log :warn "order" 1 "at" (time/now)))
(defun find-java-src ()
(interactive)
(er/mark-word)
(let* ((project-root (locate-dominating-file (file-name-directory (buffer-file-name)) "project.clj"))
(the-str (buffer-substring-no-properties (region-beginning) (region-end))))
(if project-root
(progn
(grep-string-in the-str
(concat project-root "lib/sources"))
(switch-to-grep)
(defun grep-string-in (s project-root)
(interactive (list (read-string "string: ")
(read-directory-name
"Project Root: "
(locate-dominating-file default-directory "project.clj"))))
(message (concat s project-root))
(let* ((cmd (concat "grep -nH -e " s " -R " project-root)))
(setq last-run-grep cmd)
(grep cmd)))
(defun switch-to-grep ()
(interactive)
(switch-to-buffer-other-window "*grep*"))