(ns todo-repl.core
    #_(:load "/todo-repl/date-parsing")
    (:require [todo-repl.date-parsing :as dp])
    #_(:use todo-repl.date-parsing))

(defn new-task [name due-by due-after context url]
  {:name name
   :due-after due-after
   :due-by due-by
   :context context
   :url url
   :status :incomplete
   :created (str (java.util.Date.))
   })

(defn new-task-better [{:keys [name due-after due-by context url]
                   :or {due-by "never"
                        due-after nil
                        context nil
                        url [{:label "" :url ""}] }}]
  (new-task name
            (dp/nl-to-date due-by)
            (dp/nl-to-date due-after)
            context
            url))

(defn add-new-task-to [new-task tasks]
  (cons (new-task-better new-task) tasks))

(defn filter-tasks [filter-attrib val tasks]
  (filter #(= val (filter-attrib %)) tasks))

(defn complete-task [& xs]
  (map #(assoc % :status :complete)) xs)

(ns todo-repl.core
    #_(:load "/todo-repl/date-parsing")
    (:require [todo-repl.date-parsing :as dp])
    #_(:use todo-repl.date-parsing))

(defn new-task [name due due-after context url]
  {:name name
   :due-after due-after
   :due due
   :context context
   :url url
   :status :incomplete
   :created (str (java.util.Date.))
   })

(defn new-task-better [{:keys [name due-after due context url]
                   :or {due "never"
                        due-after nil
                        context nil
                        url [{:label "" :url ""}] }}]
  (new-task name
            (dp/nl-to-date due)
            (dp/nl-to-date due-after)
            context
            url))

(defn add-new-task-to [new-task tasks]
  (cons (new-task-better new-task) tasks))

(defn filter-tasks [filter-attrib val tasks]
  (filter #(= val (filter-attrib %)) tasks))

(defn complete-task [& xs]
  (map #(assoc % :status :complete)) xs)

Change tasks :due-by to :due.

Change tasks :due-by to :due.


(defn square [x] (* x x))

(meditations
  "One may know what they seek by knowing what they do not seek"
  (= [__ __ __] (let [not-a-symbol? (complement symbol?)]
                  (map not-a-symbol? [:a 'b "c"])))

  "Praise and 'complement' may help you separate the wheat from the chaff"
  (= [:wheat "wheat" 'wheat]
       (let [not-nil? ___]
         (filter not-nil? [nil :wheat nil "wheat" nil 'wheat nil])))

  "Partial functions allow procrastination"
  (= 20 (let [multiply-by-5 (partial * 5)]
          (___ __)))

  "Don't forget: first things first"
  (= [__ __ __ __]
       (let [ab-adder (partial concat [:a :b])]
         (ab-adder [__ __])))

  "Functions can join forces as one 'composed' function"
  (= 25 (let [inc-and-square (comp square inc)]
          (inc-and-square __)))

  "Have a go on a double dec-er"
  (= __ (let [double-dec (comp dec dec)]
          (double-dec 10)))

  "Be careful about the order in which you mix your functions"
  (= 99 (let [square-and-dec ___]
          (square-and-dec 10))))

(defn square [x] (* x x))

(meditations
  "One may know what they seek by knowing what they do not seek"
  (= [true false true] (let [not-a-symbol? (complement symbol?)]
                  (map not-a-symbol? [:a 'b "c"])))

  "Praise and 'complement' may help you separate the wheat from the chaff"
  (= [:wheat "wheat" 'wheat]
       (let [not-nil? (complement nil?)]
         (filter not-nil? [nil :wheat nil "wheat" nil 'wheat nil])))

  "Partial functions allow procrastination"
  (= 20 (let [multiply-by-5 (partial * 5)]
          (multiply-by-5 4)))

  "Don't forget: first things first"
  (= [:a :b :c :d]
       (let [ab-adder (partial concat [:a :b])]
         (ab-adder [:c :d])))

  "Functions can join forces as one 'composed' function"
  (= 25 (let [inc-and-square (comp square inc)]
          (inc-and-square 4)))

  "Have a go on a double dec-er"
  (= 8 (let [double-dec (comp dec dec)]
          (double-dec 10)))

  "Be careful about the order in which you mix your functions"
  (= 99 (let [square-and-dec (comp dec square)]
          (square-and-dec 10))))

Complete creating functions koans test

Complete creating functions koans test


(ns clj-beautify.core
  (:require [clj-beautify.file-handler :as f]
            [clj-beautify.beautify :refer [format-clj]])
  (:gen-class))

(defn format-file
  "Given a file page and a valid mode (`clj`|`edn`) open and use
  `clojure.tools.reader/read-string` to transform the file to a literal so that
  if can be formatted by `clojure.pprint/write`. It then writes back to the same
  file with a formatted string."
  [filename mode]
  (let [input   (f/read-file filename)
        output  (format-clj input mode)]
    (f/write-file filename output)))

(defn -main
  "Entry point of the command line program that takes a file path (or directory)
  and mode (clj|edn). Formats all files to specified mode and rewrites the
  original files."
  [& args]
  (let [arg-cnt (count args)]
    (when (< 2 arg-cnt)
      (throw (Exception. (str "Invalid number of arguements. Expected 2 but "
                              "found " arg-cnt))))
    ;; TODO: do something with the valid args
    (doseq [file (f/list-files (nth args 1))]
      (format-file file (nth args 0)))))

(ns clj-beautify.core
  (:require [clj-beautify.file-handler :as f]
            [clj-beautify.beautify :refer [format-clj]])
  (:gen-class))

(defn format-string
  "Just a function wrapper arond format-clj"
  [input mode]
  (format-clj input mode))

(defn format-file
  "Given a file page and a valid mode (`clj`|`edn`) open and use
  `clojure.tools.reader/read-string` to transform the file to a literal so that
  if can be formatted by `clojure.pprint/write`. It then writes back to the same
  file with a formatted string."
  [filename mode]
  (let [input   (f/read-file filename)
        output  (format-string input mode)]
    (f/write-file filename output)))

(defn -main
  "Entry point of the command line program that takes a file path (or directory)
  and mode (clj|edn). Formats all files to specified mode and rewrites the
  original files."
  [& args]
  (let [arg-cnt (count args)]
    (when (< 2 arg-cnt)
      (throw (Exception. (str "Invalid number of arguements. Expected 2 but "
                              "found " arg-cnt))))
    ;; TODO: do something with the valid args
    (doseq [file (f/list-files (nth args 1))]
      (format-file file (nth args 0)))))

Create a function wrapper for a cleanly exposed API.


(ns app.components.snippet-list
  (:require [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]
            [app.components.snippet :refer [snippet]]))

(defn sort-snippets [snippets]
  (sort-by :uuid
           (fn [id1 id2] (instance? om.tempid/TempId id1))
           snippets))

(defui SnippetList
  Object
  (render [this]
    (let [{:keys [snippets]} (om/props this)
          {:keys [toggle-fn create-fn edit-fn delete-fn update-fn save-fn]}
          (om/get-computed this)]
      (dom/div #js {:className "snippet-list"}
        (dom/h2 #js {:className "snippet-list-title"}
          (dom/span #js {:className "snippet-list-title-text"} "Snippets")
          (dom/span #js {:className "snippet-list-title-buttons"}
            (dom/button #js {:className "snippet-list-title-button"
                             :onClick #(when create-fn (create-fn))}
              "+ Create")))
        (for [sn (sort-snippets (reverse snippets))]
          (snippet (om/computed sn {:toggle-fn toggle-fn
                                    :edit-fn edit-fn
                                    :delete-fn delete-fn
                                    :update-fn update-fn
                                    :save-fn save-fn})))))))

(def snippet-list (om/factory SnippetList))

(ns app.components.snippet-list
  (:require [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]
            [app.components.snippet :refer [snippet]]))

(defn sort-snippets [snippets]
  (sort-by :uuid
           (fn [id1 id2] (instance? om.tempid/TempId id1))
           snippets))

(defui SnippetList
  Object
  (render [this]
    (let [{:keys [snippets]} (om/props this)
          {:keys [toggle-fn create-fn edit-fn delete-fn update-fn save-fn]}
          (om/get-computed this)]
      (dom/div #js {:className "snippet-list"}
        (dom/h2 #js {:className "snippet-list-title"}
          (dom/span #js {:className "snippet-list-title-text"} "Snippets")
          (dom/span #js {:className "snippet-list-title-buttons"}
            (dom/button #js {:className "snippet-list-title-button"
                             :onClick #(when create-fn (create-fn))}
              "+ Create")))
        (for [sn (sort-snippets snippets)]
          (snippet (om/computed sn {:toggle-fn toggle-fn
                                    :edit-fn edit-fn
                                    :delete-fn delete-fn
                                    :update-fn update-fn
                                    :save-fn save-fn})))))))

(def snippet-list (om/factory SnippetList))

Fix sorting snippets so that the most recent shows up at the top


(ns lambdacd.state.protocols
  "Defines protocols that need to be implemented by a state component")

(defprotocol StepResultUpdateConsumer
  "Components implementing this protocol can update the state of the pipeline"
  (consume-step-result-update [self build-number step-id step-result]
    "Tells the component to update the result of a particular step. Is called on every update so it needs to handle lots of requests"))

(defprotocol PipelineStructureConsumer
  "Components implementing this protocol can set the structure a pipeline had for a particular build"
  (consume-pipeline-structure [self build-number pipeline-structure-representation]
    "Tells the component to update the structure of a particular build."))

(defprotocol NextBuildNumberSource
  "Components implementing this protocol provide the LambdaCD execution engine with new build numbers"
  (next-build-number [self]
    "Returns the build number for the next build. Must be comparable and greater than all existing build numbers")) ; TODO: is build number an int?

(defprotocol QueryAllBuildNumbersSource
  "Components implementing this protocol can supply a list of all build numbers present in the datastore"
  (all-build-numbers [self]
    "Returns a sorted list of build numbers present in the datastore"))

(defprotocol QueryStepResultsSource
  "Components implementing this protocol can supply steps results of a build"
  (get-step-results [self build-number]
    "Returns a map of step-id to step results"))

(defprotocol PipelineStructureSource
  "Components implementing this protocol can supply the structure of the pipeline for a particular build"
  (get-pipeline-structure [self build-number]
    "Returns a map describing the pipeline of for a particular build"))

(ns lambdacd.state.protocols
  "Defines protocols that need to be implemented by a state component")

(defprotocol StepResultUpdateConsumer
  "Components implementing this protocol can update the state of the pipeline"
  (consume-step-result-update [self build-number step-id step-result]
    "Tells the component to update the result of a particular step. Is called on every update so it needs to handle lots of requests"))

(defprotocol PipelineStructureConsumer
  "Components implementing this protocol can set the structure a pipeline had for a particular build"
  (consume-pipeline-structure [self build-number pipeline-structure-representation]
    "Tells the component to update the structure of a particular build."))

(defprotocol NextBuildNumberSource
  "Components implementing this protocol provide the LambdaCD execution engine with new build numbers"
  (next-build-number [self]
    "Returns the build number for the next build. Must be an integer and greater than all existing build numbers"))

(defprotocol QueryAllBuildNumbersSource
  "Components implementing this protocol can supply a list of all build numbers present in the datastore"
  (all-build-numbers [self]
    "Returns a sorted list of build numbers present in the datastore"))

(defprotocol QueryStepResultsSource
  "Components implementing this protocol can supply steps results of a build"
  (get-step-results [self build-number]
    "Returns a map of step-id to step results"))

(defprotocol PipelineStructureSource
  "Components implementing this protocol can supply the structure of the pipeline for a particular build"
  (get-pipeline-structure [self build-number]
    "Returns a map describing the pipeline of for a particular build"))

Clarify protocol documentation: LambdaCD expects build numbers to be integers


(ns ^:figwheel-always potoo.core
  (:require [reagent.core :as r]
            [ajax.core :refer [GET POST]]))

(defonce app-state
  (r/atom {:potoos []}))

(defn potoo [p]
  (let [{:keys [text name date]} p]
    [:li
     [:span (str text ", " name ", " date)]]))

(defn potoo-list []
  (fn []
    (GET "/api/potoos" {:keywords? true
                        :response-format :json
                        :handler #(swap! app-state assoc :potoos %)})
    [:div
     [:h1 "Potooooooos!"]
     [:ul
      (for [p (:potoos @app-state)]
        ^{:key p} [potoo p])]]))

(defn ^:export run []
  (r/render
    [potoo-list]
    (js/document.getElementById "app")))

(run)

;; demo

(comment
  (defn cp [text]
    (let [name "Mr. Meeseeks"
          date (str (js/Date.))
          potoo {:key "zxc" :text text :name name :date date}]
      (swap! app-state update-in [:potoos] conj potoo))))

(ns ^:figwheel-always potoo.core
  (:require [reagent.core :as r]
            [ajax.core :refer [GET POST]]))

(defonce app-state
  (r/atom {:potoos []}))

(defn potoo [p]
  (let [{:keys [text name date]} p]
    [:li
     [:span (str text ", " name ", " date)]]))

(defn potoo-list []
  [:div
   [:h1 "Potooooooos!"]
   [:ul
    (for [p (:potoos @app-state)]
      ^{:key p} [potoo p])]])

(def potoo-list-initial
  (with-meta potoo-list
    {:get-initial-state
     (fn [_]
       (GET "/api/potoos" {:keywords? true
                           :response-format :json
                           :handler #(swap! app-state assoc :potoos %)}))}))

(defn ^:export run []
  (r/render
    [potoo-list-initial]
    (js/document.getElementById "app")))

(run)

;; demo

(comment
  (defn cp [text]
    (let [name "Mr. Meeseeks"
          date (str (js/Date.))
          potoo {:key "zxc" :text text :name name :date date}]
      (swap! app-state update-in [:potoos] conj potoo))))

Use react's get-initial-state for potoo list


(ns noir-app.init
  (:require [immutant.web :as web]
            [immutant.util :as util]
            [noir.server :as server]
            [lobos.config]))

(server/load-views-ns 'noir-app.views)
(web/start "/" (server/gen-handler {:mode :dev :ns 'noir-app}))

(ns noir-app.init
  (:require [immutant.web :as web]
            [immutant.util :as util]
            [noir.server :as server]
            [lobos.config]))

;; Use this once the new bultitude and noir 1.3.0 are released
;(server/load-views-ns 'noir-app.views)
(server/load-views (util/app-relative "src/noir_app/views"))
(web/start "/" (server/gen-handler {:mode :dev :ns 'noir-app}))

Use load-views until a new noir is released.


(ns detritus.types)

(defn atom? [x]
  (instance? clojure.lang.Atom x))

(ns detritus.types)

;; Concrete type predicates
;;--------------------------------------------------------------------
(defn atom? [x]
  (instance? clojure.lang.Atom x))

(defn map-entry? [x]
  (or (instance? clojure.lang.MapEntry x)
      (and (vector? x)
           (= 2 (count x)))))

(defn lazy-seq? [x]
  (instance? clojure.lang.LazySeq x))

(defn pattern? [x]
  (instance? java.util.regex.Pattern x))

(defn uuid? [x]
  (instance? java.util.UUID x))

(defn boolean? [x]
  (instance? java.lang.Boolean x))

(defn long? [x]
  (instance? java.lang.Long x))

(defn int? [x]
  (instance? java.lang.Integer x))

(defn big-int? [x]
  (or (instance? java.math.BigInteger x)
      (instance? clojure.lang.BigInt x)))

;; Interface predicates
;;--------------------------------------------------------------------
(defn ref? [x]
  (instance? clojure.lang.IRef x))

(defn deref? [x]
  (instance? clojure.lang.IDeref x))

(defn named? [x]
  (instance? clojure.lang.Named))

(defn throwable? [x]
  (instance? java.lang.Throwable x))

(defn seqable? [x]
  (or (instance? clojure.lang.ISeq x)
      (instance? clojure.lang.Seqable x)
      (instance? Iterable x)
      (instance? CharSequence x)
      (instance? java.util.Map x)
      (nil? x)
      (.. x getClass isArray)))

Add a plethora of type predicates

Add a plethora of type predicates


(ns om-tut.core
  (:require [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]))

(enable-console-print!)

(println "A new developer message. Pay attention, dev guy!")

;; define your app data so that it doesn't get over-written on reload

(defonce app-state (atom {:list ["Lion" "Zebra" "Buffalo" "Antelope"]}))

(om/root
 (fn [data owner]
   (om/component
    (apply dom/ul #js {:className "animals"}
           (map (fn [text] (dom/li nil text)) (:list data)))))
 app-state
 {:target (. js/document (getElementById "app0"))})

(defn on-js-reload []
  ;; optionally touch your app-state to force rerendering depending on
  ;; your application
  ;; (swap! app-state update-in [:__figwheel_counter] inc)
)

(ns om-tut.core
  (:require [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]))

(enable-console-print!)

(println "A new developer message. Pay attention, dev guy!")

;; define your app data so that it doesn't get over-written on reload

(defonce app-state (atom {:list ["Lion" "Zebra" "Buffalo" "Antelope"]}))

(defn stripe [text background-color]
  (let [st #js {:backgroundColor background-color}]
    (dom/li #js {:style st} text)))

(om/root
 (fn [data owner]
   (om/component
    (apply dom/ul #js {:className "animals"}
           (map stripe (:list data) (cycle ["#ff0" "#fff"])))))

 app-state
 {:target (. js/document (getElementById "app0"))})

(defn on-js-reload []
  ;; optionally touch your app-state to force rerendering depending on
  ;; your application
  ;; (swap! app-state update-in [:__figwheel_counter] inc)
)

Implement code for "Life without a..."

Implement code for "Life without a..."

Write the code for the "Life without a templating language" section.
This section demonstrates using functional programming to implement
features that templating languages might provide.


(defproject org.onyxplatform/onyx-metrics "0.8.0.3-SNAPSHOT"
  :description "Instrument Onyx workflows"
  :url "https://github.com/MichaelDrogalis/onyx"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [interval-metrics "1.0.0"]
                 [stylefruits/gniazdo "0.4.0"]]
  :java-opts ^:replace ["-server" "-Xmx3g"]
  :global-vars  {*warn-on-reflection* true
                 *assert* false
                 *unchecked-math* :warn-on-boxed}
  :profiles {:dev {:dependencies [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                                  [org.onyxplatform/onyx "0.8.0.1"]
                                  [riemann-clojure-client "0.4.1"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}})

(defproject org.onyxplatform/onyx-metrics "0.8.0.3-SNAPSHOT"
  :description "Instrument Onyx workflows"
  :url "https://github.com/MichaelDrogalis/onyx"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [interval-metrics "1.0.0"]
                 [stylefruits/gniazdo "0.4.0"]]
  :java-opts ^:replace ["-server" "-Xmx3g"]
  :global-vars  {*warn-on-reflection* true
                 *assert* false
                 *unchecked-math* :warn-on-boxed}
  :profiles {:dev {:dependencies [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                                  [org.onyxplatform/onyx "0.8.0"]
                                  [riemann-clojure-client "0.4.1"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}})

Revert onyx dependency back to release version


(defproject tttclj "0.0.1-SNAPSHOT"
  :description "Cool new project to do things and stuff"
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [http-kit "2.1.16"]
                 [compojure "1.1.8"]]
  :profiles {:dev {:dependencies [[midje "1.5.0"]]}}
  :main tttclj.web)

(defproject tttclj "0.0.1-SNAPSHOT"
  :description "Cool new project to do things and stuff"
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/clojurescript "0.0-2227"]
                 [http-kit "2.1.16"]
                 [compojure "1.1.8"]]
  :profiles {:dev {:dependencies [[midje "1.5.0"]]
                   :plugins [[lein-cljsbuild "1.0.3"]]
                   :cljsbuild {:builds [{:source-paths ["src"]
                                         :compiler {:output-to "target/classes/public/app.js"
                                                    :optimizations :whitespace
                                                    :pretty-print true}}]}}}
  :main tttclj.web)

Upgrade Clojure & add ClojureScript

Upgrade Clojure & add ClojureScript


(defproject org.onyxplatform/onyx-metrics "0.8.0.2"
  :description "Instrument Onyx workflows"
  :url "https://github.com/MichaelDrogalis/onyx"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [interval-metrics "1.0.0"]
                 [stylefruits/gniazdo "0.4.0"]]
  :java-opts ^:replace ["-server" "-Xmx3g"]
  :global-vars  {*warn-on-reflection* true
                 *assert* false
                 *unchecked-math* :warn-on-boxed}
  :profiles {:dev {:dependencies [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                                  [org.onyxplatform/onyx "0.8.0.1"]
                                  [riemann-clojure-client "0.4.1"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}})

(defproject org.onyxplatform/onyx-metrics "0.8.0.3-SNAPSHOT"
  :description "Instrument Onyx workflows"
  :url "https://github.com/MichaelDrogalis/onyx"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [interval-metrics "1.0.0"]
                 [stylefruits/gniazdo "0.4.0"]]
  :java-opts ^:replace ["-server" "-Xmx3g"]
  :global-vars  {*warn-on-reflection* true
                 *assert* false
                 *unchecked-math* :warn-on-boxed}
  :profiles {:dev {:dependencies [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                                  [org.onyxplatform/onyx "0.8.0.1"]
                                  [riemann-clojure-client "0.4.1"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}})

Prepare for next release cycle.

Prepare for next release cycle.


(ns puppeteer.domain.entity.message)

(defrecord Field
  [title value short?])

(defrecord Attachment
  [text color fields])

(defrecord Message
  [channel-id user-id text timestamp attachments for-me?])

(ns puppeteer.domain.entity.message)

(defrecord Field
  [title value short?])

(defrecord Attachment
  [text color fields])

(defrecord Message
  [channel-id user-id text timestamp attachments for-me? from-me?])

Add from-me? key to Message

Add from-me? key to Message


(ns lt.objs.notifos
  (:require [lt.object :as object]
            [lt.objs.statusbar :as statusbar]
            [lt.objs.command :as cmd]
            [lt.util.js :refer [wait]]
            [crate.binding :refer [map-bound bound deref?]])
  (:require-macros [lt.macros :refer [behavior defui]]))

(def standard-timeout 10000)

(defn working [msg]
  (when msg
    (set-msg! msg))
  (statusbar/loader-inc))

(defn done-working
  ([]
   (statusbar/loader-dec))
  ([msg]
   (set-msg! msg)
   (statusbar/loader-dec)))

(defn msg* [m opts]
  (let [m (if (string? m)
            m
            (pr-str m))]
    (object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))

(defn set-msg! [msg opts]
  (msg* msg opts)
  (js/clearTimeout cur-timeout)
  (set! cur-timeout (wait standard-timeout #(msg* ""))))

(cmd/command {:command :reset-working
              :desc "Statusbar: Reset working indicator"
              :exec (fn []
                      (statusbar/loader-set 0)
                      )})

(ns lt.objs.notifos
  (:require [lt.object :as object]
            [lt.objs.statusbar :as statusbar]
            [lt.objs.command :as cmd]
            [lt.util.js :refer [wait]]
            [crate.binding :refer [map-bound bound deref?]])
  (:require-macros [lt.macros :refer [behavior defui]]))

(def standard-timeout 10000)

(defn working [msg]
  (when msg
    (set-msg! msg))
  (statusbar/loader-inc))

(defn done-working
  ([]
   (statusbar/loader-dec))
  ([msg]
   (set-msg! msg)
   (statusbar/loader-dec)))

(defn msg* [m & [opts]]
  (let [m (if (string? m)
            m
            (pr-str m))]
    (object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))

(defn set-msg! [msg opts]
  (msg* msg opts)
  (js/clearTimeout cur-timeout)
  (set! cur-timeout (wait standard-timeout #(msg* ""))))

(cmd/command {:command :reset-working
              :desc "Statusbar: Reset working indicator"
              :exec (fn []
                      (statusbar/loader-set 0)
                      )})

Make msg* opts argument optional

Make msg* opts argument optional

To avoid compiler warnings, change the opts argument of notifos/msg* into an optional one.


(ns route-ccrs.core
  (:require [clojure.tools.logging :as log]
            [route-ccrs.active-routes :as ar]
            [route-ccrs.route-ccr :as ccr]))

(defn calculate-and-record-ccrs!  [sys]
  (let [c {:connection (:db sys)}]
    (log/info "CCR calculation started")
    (->> (into [] ar/transduce-routes (ar/active-routes {} c))
         (map
           (fn [[r o]]
             (ccr/ccr-entry-updates
               r
               (ccr/get-last-known-ccr r c)
               (ccr/select-current-ccr (:db sys) o))))
         (filter seq)
         (reduce
           (fn [c u]
             (let [t (-> u second first)
                   tc (get c t 0)]
               (ccr/update! (:db sys) u)
               (assoc c t (inc tc))))
           {})
         (log/info "calculation complete, updated:"))))

(ns route-ccrs.core
  (:require [clojure.tools.logging :as log]
            [route-ccrs.active-routes :as ar]
            [route-ccrs.route-ccr :as ccr]))

(defmacro with-db-connection
  ^{:private true}
  [sys & body]
  `(let [~'db (:db ~sys)
         ~'c {:connection ~'db}]
     ~@body))

(defn- route-update [sys [route-id operations]]
  (with-db-connection sys
    (ccr/ccr-entry-updates
      route-id
      (ccr/get-last-known-ccr route-id c)
      (ccr/select-current-ccr db operations))))

(defn- reduce-to-updates [sys routes]
  (reduce
    (fn [u route]
      (let [ru (route-update sys route)]
        (if (seq ru)
          (conj u ru)
          u)))
    []
    routes))

(defn- apply-updates! [sys updates]
  (with-db-connection sys
    (reduce
      (fn [totals route-update]
        (let [update-type (-> route-update second first)]
          (ccr/update! db route-update)
          (update-in totals [update-type] #(inc (or % 0)))))
      {}
      updates)))

(defn calculate-and-record-ccrs!  [sys]
  (with-db-connection sys
    (log/info "CCR calculation started")
    (->> (into [] ar/transduce-routes (ar/active-routes {} c))
         (reduce-to-updates sys)
         (apply-updates! sys)
         (log/info "calculation complete, updated:"))))

Break calculate-and-record-ccrs! into discrete functions

For ease of understanding and modification


(ns servisne-info.tasks
  (:use [raven-clj.core :only [capture]]
        [raven-clj.interfaces :only [stacktrace]])
  (:require [environ.core :refer [env]]
            [overtone.at-at :as at-at]
            [taoensso.timbre :as timbre]))

(defmacro deftask [task-name & body]
  `(fn []
     (try
       (do
         (timbre/info ~task-name " starting...")
         ~@body
         (timbre/info ~task-name " done."))
       (catch Exception e#
         (capture (env :sentry-dsn)
                  (-> {:message (.getMessage e#)}
                      (stacktrace e#)))))))

(def tasks-pool (at-at/mk-pool :cpu-count 1))
(def default-period 3600)
(def periodic-tasks (atom []))

(defn add-periodic-task [task]
  (swap! periodic-tasks conj task))

(defn schedule-periodic-tasks []
  (doseq [task @periodic-tasks]
    (at-at/every default-period task tasks-pool :initial-delay (/ default-period 10))))

(ns servisne-info.tasks
  (:use [raven-clj.core :only [capture]]
        [raven-clj.interfaces :only [stacktrace]])
  (:require [environ.core :refer [env]]
            [overtone.at-at :as at-at]
            [taoensso.timbre :as timbre]))

(defmacro deftask [task-name & body]
  `(fn []
     (try
       (do
         (timbre/info ~task-name " starting...")
         ~@body
         (timbre/info ~task-name " done."))
       (catch Exception e#
         (capture (env :sentry-dsn)
                  (-> {:message (.getMessage e#)}
                      (stacktrace e#)))))))

(def tasks-pool (at-at/mk-pool :cpu-count 1))
(def default-period (* 60 60 1000)) ; one hour
(def periodic-tasks (atom []))

(defn add-periodic-task [task]
  (swap! periodic-tasks conj task))

(defn schedule-periodic-tasks []
  (doseq [task @periodic-tasks]
    (at-at/every default-period task tasks-pool :initial-delay (/ default-period 10))))

Set task period to one hour

Set task period to one hour


(ns leiningen.pallet-release.core)

(defn deep-merge
  "Recursively merge maps."
  [& ms]
  (letfn [(f [a b]
            (if (and (map? a) (map? b))
              (deep-merge a b)
              b))]
    (apply merge-with f ms)))

(defn fail
  "Fail with the given message, msg."
  [msg]
  (throw (ex-info msg {:exit-code 1})))

(defn fail-on-error
  "Fail on a shell error"
  [exit]
  (when (and exit (pos? exit))
    (fail "Shell command failed")))

(def push-repo-fmt
  "https://pbors:${GH_TOKEN}@github.com%s.git")

(defn repo-coordinates
  [{:keys [url] :as project}]
  (when-not (or url (-> project :pallet-release :url))
    (fail "No :url available in project.clj"))
  (if-let [release-url (-> project :pallet-release :url)]
    release-url
    (let [u (java.net.URL. url)]
      (if (= "github.com" (.getHost u))
        (format push-repo-fmt (.getPath u))
        (fail (str "Don't know how to create a pushable git url from"
                   url))))))

(defn release-config
  "Return a pallet release configuration map"
  [project]
  {:url (repo-coordinates project)
   :branch (or (-> project :pallet-release :branch)
               "master")})

(ns leiningen.pallet-release.core)

(defn deep-merge
  "Recursively merge maps."
  [& ms]
  (letfn [(f [a b]
            (if (and (map? a) (map? b))
              (deep-merge a b)
              b))]
    (apply merge-with f ms)))

(defn fail
  "Fail with the given message, msg."
  [msg]
  (throw (ex-info msg {:exit-code 1})))

(defn fail-on-error
  "Fail on a shell error"
  [exit]
  (when (and exit (pos? exit))
    (fail "Shell command failed")))

(def push-repo-fmt
  "https://pbors:${GH_TOKEN}@github.com%s.git")

(defn repo-coordinates
  [{:keys [url] :as project}]
  (when-not (or url (-> project :pallet-release :url))
    (fail "No :url available in project.clj"))
  (if-let [release-url (-> project :pallet-release :url)]
    release-url
    (let [u (java.net.URL. url)]
      (if (= "github.com" (.getHost u))
        (format push-repo-fmt (.getPath u))
        (fail (str "Don't know how to create a pushable git url from "
                   url))))))

(defn release-config
  "Return a pallet release configuration map"
  [project]
  {:url (repo-coordinates project)
   :branch (or (-> project :pallet-release :branch)
               "master")})

Add space to unknown repo format message


(ns cruncher.moves.main
  (:require [cruncher.moves.data :as data]))

(defn get-name
  "Return move object from moves-database by the move id."
  [id]
  (:name (get data/all id)))

(defn get-move
  "Return complete move by its id"
  [id]
  (get data/all id))

Add fn to return complete move object

Add fn to return complete move object


; An attempt to use in-place array mutation in Clojure
; Highly non-idiomatic. Should not be used. EXPERIMENTAL.
; Also it is ridiculously slow. Does anyone know why?

(defn generatePermutations [a n]
  (if (zero? n)
    (println (apply str a))
    (doseq [i (range 0 (inc n))]
      (generatePermutations a (dec n))
      (let [j (if (even? n) i 0) oldn (aget a n) oldj (aget a j)]
        (aset a n oldj) (aset a j oldn)))))

(if (not= (count *command-line-args*) 1)
  (do
    (println "Exactly one argument is required")
    (System/exit 1))
  (let [word (-> *command-line-args* first vec to-array)]
    (time (generatePermutations word (dec (count word))))))

; An attempt to use in-place array mutation in Clojure
; Highly non-idiomatic. Should not be used. EXPERIMENTAL.
; Also it is ridiculously slow. Does anyone know why?

(defn generatePermutations [^chars a n]
  (if (zero? n)
    ();(println (apply str a))
    (doseq [i (range 0 (inc n))]
      (generatePermutations a (dec n))
      (let [j (if (even? n) i 0) oldn (aget a n) oldj (aget a j)]
        (aset-char a n oldj) (aset-char a j oldn)))))

(if (not= (count *command-line-args*) 1)
  (do
    (println "Exactly one argument is required")
    (System/exit 1))
  (let [word (-> *command-line-args* first vec char-array)]
    (time (generatePermutations word (dec (count word))))))

Use char arrays and type hints

Use char arrays and type hints


(ns comic-reader.pages.sites
  (:require [comic-reader.session :as session]
            [reagent.core :as reagent :refer [atom]]
            [secretary.core :refer [dispatch!]]))

(defn manga-site [site-data]
  ^{:key (:id site-data)} [:li (:name site-data)])

(defn site-list [sites]
  [:div
   [:h1 "Comic Sources"]
   [:ul (map manga-site sites)]])

(ns comic-reader.pages.sites
  (:require [comic-reader.session :as session]
            [reagent.core :as reagent :refer [atom]]
            [secretary.core :refer [dispatch!]]))

(defn manga-site [site-data]
  ^{:key (:id site-data)}
  [:li
   [:input {:type "button"
            :value (:name site-data)
            :on-click #(.log js/console
                        (str "You clicked the "
                             (:id site-data)
                             " button!"))}]])

(defn site-list [sites]
  [:div
   [:h1 "Comic Sources"]
   [:ul (map manga-site sites)]])

Make the site components contain a button


(ns workflo.macros.spec-test
  (:require #?(:cljs [cljs.test :refer-macros [deftest is]]
               :clj  [clojure.test :refer [deftest is]])
            #?(:cljs [cljs.spec :as s]
               :clj  [clojure.spec :as s])
            #?(:cljs [cljs.spec.test :as st]
               :clj  [clojure.spec.test :as st])
            [workflo.macros.view]
            [workflo.macros.query]
            [workflo.macros.query.util]
            [workflo.macros.command]
            [workflo.macros.command.util]))

#?(:cljs (deftest test-specs
           (doseq [v (s/speced-vars)]
             (println "  Testing" v)
             (let [result (st/check-var v :num-tests 10 :max-size 10)]
               (println "  >" result)
               (and (is (map? result))
                    (is (true? (:result result))))))))

#?(:clj (deftest test-specs
          (doseq [s (st/testable-syms)]
            (println "  Testing" s)
            (let [result (first (st/test s {:clojure.spec.test.check/opts
                                            {:num-tests 10}}))]
              (and (is (map? result))
                   (is (true? (:result result))))))))

(ns workflo.macros.spec-test
  (:require #?(:cljs [cljs.test :refer-macros [deftest is]]
               :clj  [clojure.test :refer [deftest is]])
            #?(:cljs [cljs.spec :as s]
               :clj  [clojure.spec :as s])
            #?(:cljs [cljs.spec.test :as st]
               :clj  [clojure.spec.test :as st])
            [workflo.macros.view]
            [workflo.macros.query]
            [workflo.macros.query.util]
            [workflo.macros.command]
            [workflo.macros.command.util]))

#?(:cljs (deftest test-specs
           (doseq [v (s/speced-vars)]
             (println "  Testing" v)
             (when-not (= #'workflo.macros.query/parse-subquery v)
               (let [result (st/check-var v :num-tests 10 :max-size 10)]
                 (println "  >" result)
                 (and (is (map? result))
                      (is (true? (:result result)))))))))

#?(:clj (deftest test-specs
          (doseq [s (st/testable-syms)]
            (println "  Testing" s)
            (let [result (first (st/test s {:clojure.spec.test.check/opts
                                            {:num-tests 10}}))]
              (and (is (map? result))
                   (is (true? (:result result))))))))

Exclude random test of parse-subquery from being executed in CLJS


(defproject leancloud.data.json "0.1.0-RC2"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :java-source-paths ["src/jvm"]
  :source-paths ["src/clj"]
  :jvm-opts ["-Xmx1g" "-server" "-XX:MaxPermSize=256m" "-XX:+UseConcMarkSweepGC" "-XX:+UseCMSCompactAtFullCollection" "-Dclojure.compiler.elide-meta='[:doc :added]'"]
  :profiles {:dev {:dependencies [[criterium "0.4.3"]
                                  [clj-tuple "0.1.6"]
                                  [org.clojure/data.json "0.2.5"]]}})

(defproject leancloud.data.json "0.1.0-RC3"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :java-source-paths ["src/jvm"]
  :source-paths ["src/clj"]
  :javac-options ["-target" "1.7" "-source" "1.7"]
  :jvm-opts ["-Xmx1g" "-server" "-XX:MaxPermSize=256m" "-XX:+UseConcMarkSweepGC" "-XX:+UseCMSCompactAtFullCollection" "-Dclojure.compiler.elide-meta='[:doc :added]'"]
  :profiles {:dev {:dependencies [[criterium "0.4.3"]
                                  [clj-tuple "0.1.6"]
                                  [org.clojure/data.json "0.2.5"]]}})

Set compile target to 1.7

Set compile target to 1.7


(defproject onyx-app/lein-template "0.9.7.0-alpha1"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.9.7.0-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


;(defproject cli4clj "1.0.0"
(defproject cli4clj "1.0.1-SNAPSHOT"
  :description "Create simple interactive CLIs for Clojure applications."
  :url "https://github.com/ruedigergad/cli4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [clj-assorted-utils "1.11.0"]
                 [jline/jline "2.13"]]
  :global-vars {*warn-on-reflection* true}
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^cli4clj.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/cli4clj/blob/master"
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :main cli4clj.example
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.1.3"] [lein-html5-docs "3.0.3"]])

;(defproject cli4clj "1.0.0"
(defproject cli4clj "1.0.1-SNAPSHOT"
  :description "Create simple interactive CLIs for Clojure applications."
  :url "https://github.com/ruedigergad/cli4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [clj-assorted-utils "1.11.0"]
                 [jline/jline "2.13"]]
  :global-vars {*warn-on-reflection* true}
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^cli4clj.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/cli4clj/blob/master"
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :main cli4clj.example
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.1.3"] [lein-html5-docs "3.0.3"]]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.2" :exclusions  [org.clojure/clojure]]]}}
)

Add eastwood as repl dependency.

Add eastwood as repl dependency.


(defproject madouc "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [ring/ring-core "1.5.1"]
                 [ring-logger "0.7.7"]
                 [ring-logger-timbre "0.7.5"]
                 [com.taoensso/timbre "4.8.0"]
                 [com.fzakaria/slf4j-timbre "0.3.4"]
                 [environ "1.1.0"]
                 [org.immutant/web "2.1.6"
                  :exclusions [ch.qos.logback/logback-classic]]]
  :main madouc.core
  :profiles {:dev {:plugins [[lein-environ "1.1.0"]]}
             :uberjar {:aot :all}})

(defproject madouc "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [ring/ring-core "1.5.1"]
                 [ring-logger "0.7.7"]
                 [ring-logger-timbre "0.7.5"]
                 [com.taoensso/timbre "4.8.0"]
                 [com.fzakaria/slf4j-timbre "0.3.4"]
                 [compojure "1.5.2"]
                 [metosin/compojure-api "1.1.10"]
                 [environ "1.1.0"]
                 [org.immutant/web "2.1.6"
                  :exclusions [ch.qos.logback/logback-classic]]]
  :main madouc.core
  :profiles {:dev {:plugins [[lein-environ "1.1.0"]]}
             :uberjar {:aot :all}})

Add compojure and compojure-api dependencies


(defproject io.aviso/rook "0.1.8-SNAPSHOT"
  :description "Ruby on Rails-style resource mapping for Clojure/Compojure web apps"
  :url "https://github.com/AvisoNovate/rook"
  :license {:name "Apache Sofware License 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0.html"}
  ;; Normally we don't AOT compile; only when tracking down reflection warnings.
  :profiles {:reflection-warnings {:aot         :all
                                   :global-vars {*warn-on-reflection* true}}
             :dev {:dependencies [[ring-mock "0.1.5"]
                                  [io.aviso/pretty "0.1.10"]
                                  [speclj "2.9.1"]
                                  [log4j "1.2.17"]]}}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
                 [org.clojure/tools.logging "0.2.6"]
                 [ring-middleware-format "0.3.2"]
                 [prismatic/schema "0.2.1"]
                 [compojure "1.1.6"]]
  :plugins [[test2junit "1.0.1"]
            [speclj "2.9.1"]]
  :test-paths ["spec"])

(defproject io.aviso/rook "0.1.8-SNAPSHOT"
  :description "Ruby on Rails-style resource mapping for Clojure/Compojure web apps"
  :url "https://github.com/AvisoNovate/rook"
  :license {:name "Apache Sofware License 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0.html"}
  ;; Normally we don't AOT compile; only when tracking down reflection warnings.
  :profiles {:reflection-warnings {:aot         :all
                                   :global-vars {*warn-on-reflection* true}}
             :dev {:dependencies [[ring-mock "0.1.5"]
                                  [io.aviso/pretty "0.1.10"]
                                  [speclj "2.5.0"]
                                  [log4j "1.2.17"]]}}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
                 [org.clojure/tools.logging "0.2.6"]
                 [ring-middleware-format "0.3.2"]
                 [prismatic/schema "0.2.1"]
                 [compojure "1.1.6"]]
  :plugins [[speclj "2.5.0"]]
  :test-paths ["spec"])

Revert to speclj 2.5.0 since later versions don't seem to catch assertions correctly inside should-throw


(defproject funcool/futura "0.2.0-SNAPSHOT"
  :description "A basic building blocks for async programming."
  :url "https://github.com/funcool/futura"
  :license {:name "BSD (2 Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies [[org.clojure/clojure "1.7.0-beta3" :scope "provided"]
                 [cats "0.4.0"]
                 [manifold "0.1.0"]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                 [org.reactivestreams/reactive-streams "1.0.0"]]
  :deploy-repositories {"releases" :clojars
                        "snapshots" :clojars}
  :source-paths ["src"]
  :test-paths ["test"]
  :jar-exclusions [#"\.swp|\.swo|user.clj"]
  :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
  :profiles {:dev {:codeina {:sources ["src"]
                             :language :clojure
                             :output-dir "doc/api"}
                   :plugins [[funcool/codeina "0.1.0-SNAPSHOT"
                              :exclusions [org.clojure/clojure]]]}})

(defproject funcool/futura "0.2.0-SNAPSHOT"
  :description "A basic building blocks for async programming."
  :url "https://github.com/funcool/futura"
  :license {:name "BSD (2 Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies [[org.clojure/clojure "1.7.0-RC1" :scope "provided"]
                 [cats "0.4.0"]
                 [manifold "0.1.0"]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                 [org.reactivestreams/reactive-streams "1.0.0"]]
  :deploy-repositories {"releases" :clojars
                        "snapshots" :clojars}
  :source-paths ["src"]
  :test-paths ["test"]
  :jar-exclusions [#"\.swp|\.swo|user.clj"]
  :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
  :profiles {:dev {:codeina {:sources ["src"]
                             :language :clojure
                             :output-dir "doc/api"}
                   :plugins [[funcool/codeina "0.1.0-SNAPSHOT"
                              :exclusions [org.clojure/clojure]]]}})

Update clojure version to 1.7.0 rc1

Update clojure version to 1.7.0 rc1


(defproject suricatta "0.2.0-SNAPSHOT"
  :description "High level sql toolkit for clojure (backed by jooq library)"
  :url "https://github.com/niwibe/suricatta"

  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}

  :profiles {:dev {:dependencies [[postgresql "9.3-1102.jdbc41"]
                                  [com.h2database/h2 "1.3.176"]
                                  [cheshire "5.3.1"]]
                   ;; :global-vars {*warn-on-reflection* true}
                   }}
  :java-source-paths ["src/java"]
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.jooq/jooq "3.5.0"]
                 [clojure.jdbc "0.3.2"]
                 [cats "0.2.0" :exclusions [org.clojure/clojure]]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]])

(defproject suricatta "0.2.0-SNAPSHOT"
  :description "High level sql toolkit for clojure (backed by jooq library)"
  :url "https://github.com/niwibe/suricatta"

  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}

  :profiles {:dev {:dependencies [[postgresql "9.3-1102.jdbc41"]
                                  [com.h2database/h2 "1.3.176"]
                                  [cheshire "5.3.1"]]
                   ;; :global-vars {*warn-on-reflection* true}
                   }}
  :java-source-paths ["src/java"]
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.jooq/jooq "3.5.1"]
                 [clojure.jdbc "0.3.2"]
                 [cats "0.2.0" :exclusions [org.clojure/clojure]]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]])

Update jooq version to 3.5.1

Update jooq version to 3.5.1


(defproject buddy/buddy-sign "2.0.0"
  :description "High level message signing for Clojure"
  :url "https://github.com/funcool/buddy-sign"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.9.0-alpha17" :scope "provided"]
                 [com.taoensso/nippy "2.13.0" :scope "provided"]
                 [org.clojure/test.check "0.9.0" :scope "test"]
                 [buddy/buddy-core "1.3.0"]
                 [cheshire "5.7.1"]]
  :source-paths ["src"]
  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
  :test-paths ["test"])

(defproject buddy/buddy-sign "2.0.0"
  :description "High level message signing for Clojure"
  :url "https://github.com/funcool/buddy-sign"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.9.0-alpha17" :scope "provided"]
                 [com.taoensso/nippy "2.13.0" :scope "provided"]
                 [org.clojure/test.check "0.9.0" :scope "test"]
                 [buddy/buddy-core "1.3.0"]
                 [cheshire "5.8.0"]]
  :source-paths ["src"]
  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
  :test-paths ["test"])

Update cheshire dependency to 5.8.0

Update cheshire dependency to 5.8.0


(def classifier-version "0.2.3")

(defproject puppetlabs.packages/pe-classifier "0.2.4-SNAPSHOT"
  :description "Release artifacts for classifier"
  :pedantic? :abort
  :dependencies [[puppetlabs/classifier ~classifier-version]]

  :uberjar-name "classifier-release.jar"

  :repositories [["releases" "http://nexus.delivery.puppetlabs.net/content/repositories/releases/"]
                 ["snapshots" "http://nexus.delivery.puppetlabs.net/content/repositories/snapshots/"]]

  :main puppetlabs.trapperkeeper.main

  :ezbake {:user "pe-classifier"
           :group "pe-classifier"
           :build-type "pe"})

(defproject puppetlabs.packages/pe-classifier "0.2.4-SNAPSHOT"
  :description "Release artifacts for classifier"
  :pedantic? :abort
  :dependencies [[puppetlabs/classifier "0.2.3"]]

  :uberjar-name "classifier-release.jar"

  :repositories [["releases" "http://nexus.delivery.puppetlabs.net/content/repositories/releases/"]
                 ["snapshots" "http://nexus.delivery.puppetlabs.net/content/repositories/snapshots/"]]

  :main puppetlabs.trapperkeeper.main

  :ezbake {:user "pe-classifier"
           :group "pe-classifier"
           :build-type "pe"})

Remove version templating from classifier.clj that doesn't work

Using a variable in the defproject macro does not work, so this commit
replaces it with a literal string.


(hash-map

  :layout
  (layout/geodesic
    :radius 3.688
    :pixel-spacing 0.02
    :strut-pixels
    [48 64 64 64]
    :strip-struts
    [[0 6 12 10]
     [2 8 18 16]
     [4 9 17 19]
     [3 7 11 13]
     [1 5 14 15]])

  #_
  (layout/star
    :radius 3.688         ; 12.1'
    :pixel-spacing 0.02   ; 2 cm
    :strip-pixels 240
    :strips 6)

  :event-handler
  (-> state/update-mode
      handler/mode-selector
      (handler/autocycle-modes
        (comp #{:button/press :button/repeat} :type)))

  :web-options
  {:port 8080
   :min-threads 2
   :max-threads 5
   :max-queued 25}

  :modes
  {:rainbow
   (mode/rainbow)

   :strobe
   (mode/strobe
     [(color/rgb 1 0 0)
      (color/rgb 0 1 0)
      (color/rgb 0 0 1)])

   :lantern
   (mode/lantern 0.5)}

  :playlist
  [:rainbow
   :strobe
   :lantern])

(hash-map

  :layout
  #_
  (layout/geodesic
    :radius 3.688
    :pixel-spacing 0.02
    :strut-pixels
    [48 64 64 64]
    :strip-struts
    [[0 6 12 10]
     [2 8 18 16]
     [4 9 17 19]
     [3 7 11 13]
     [1 5 14 15]])

  (layout/star
    :radius 3.688         ; 12.1'
    :pixel-spacing 0.02   ; 2 cm
    :strip-pixels 240
    :strips 6)

  :event-handler
  (-> state/update-mode
      handler/mode-selector
      (handler/autocycle-modes
        (comp #{:button/press :button/repeat} :type)))

  :web-options
  {:port 8080
   :min-threads 2
   :max-threads 5
   :max-queued 25}

  :modes
  {:rainbow
   (mode/rainbow)

   :strobe
   (mode/strobe
     [(color/rgb 1 0 0)
      (color/rgb 0 1 0)
      (color/rgb 0 0 1)])

   :lantern
   (mode/lantern 0.5)}

  :playlist
  [:rainbow
   :strobe
   :lantern])

Switch back to star layout until geodesic stuff is figured out.


{:user {
        :plugins [[cider/cider-nrepl "0.12.0-SNAPSHOT"]
                  [lein-ancient "0.6.8"]
                  [lein-bikeshed "0.3.0"]
                  [lein-kibit "0.1.2"]]

        :dependencies [[org.clojure/clojure "1.7.0"]
                       [org.clojure/tools.reader "1.0.0-alpha3"]
                       [com.cemerick/url "0.1.1"]
                       [datomic-schema-grapher "0.0.1"]
                       [com.datomic/datomic-pro "0.9.5350"]
                       [me.raynes/fs "1.4.6"]
                       [clj-stacktrace "0.2.8"]
                       [acyclic/squiggly-clojure "0.1.5"]
                       ^:replace [org.clojure/tools.nrepl "0.2.12"]
                       ;; Consider using typed? [org.clojure/core.typed "0.3.22"]
                       ]
        }

 ;; VisualVM profiling opts
 :jvm-opts ["-Dcom.sun.management.jmxremote"
            "-Dcom.sun.management.jmxremote.ssl=false"
            "-Dcom.sun.management.jmxremote.authenticate=false"
            "-Dcom.sun.management.jmxremote.port=43210"]}

{:user {
          :dependencies [[cider/cider-nrepl "0.12.0-SNAPSHOT"] ; Emnacs
                       [acyclic/squiggly-clojure "0.1.5"] ; Emacs
                         ^:replace [org.clojure/tools.nrepl "0.2.12"] ; Emacs
                         ]
        :singing {:gpg-key "matthew.russell@wormbase.org"}}
 ;; VisualVM profiling opts
 :jvm-opts ["-Dcom.sun.management.jmxremote"
            "-Dcom.sun.management.jmxremote.ssl=false"
            "-Dcom.sun.management.jmxremote.authenticate=false"
            "-Dcom.sun.management.jmxremote.port=43210"]}

Move dev plugins out of global profile.

Move dev plugins out of global profile.

Emacs-related deps (e.g cider) are the only thing that I'll leave in the
global section.

Development plugins are project specific.


(ns incise.utils
  (:require [clojure.java.io :refer [file]])
  (:import [java.io File]))

(defn remove-prefix-from-path
  "Remove the given prefix from the given path."
  [prefix-file afile]
  (-> afile
      (file)
      (.getCanonicalPath)
      (subs (count (.getCanonicalPath prefix-file)))))

(defn- gitignore-file? [^File file]
  (= (.getName file) ".gitignore"))

(defn delete-recursively
  "Delete a directory tree."
  [^File root]
  (when root
    (when (.isDirectory root)
      (doseq [file (remove gitignore-file? (.listFiles root))]
        (delete-recursively file)))
    (.delete root)))

(ns incise.utils
  (:require [clojure.java.io :refer [file]])
  (:import [java.io File]))

(defn remove-prefix-from-path
  "Remove the given prefix from the given path."
  [prefix-file afile]
  (-> afile
      (file)
      (.getCanonicalPath)
      (subs (inc (count (.getCanonicalPath (file prefix-file)))))))

(defn- gitignore-file? [^File file]
  (= (.getName file) ".gitignore"))

(defn delete-recursively
  "Delete a directory tree."
  [^File root]
  (when root
    (when (.isDirectory root)
      (doseq [file (remove gitignore-file? (.listFiles root))]
        (delete-recursively file)))
    (.delete root)))

Remove one more character in remove-prefix-from-path.

This gets rid of a preceeding '/'


(ns kixi.eventlog.api
  (:require [liberator.core :refer (defresource)]
            [clojure.tools.logging :as log]))

(defn malformed? [ctx]
  (if-let [body (get-in ctx [:request :body])]
    (assoc ctx ::body body)
    true))

(defn handle-created [publish-fn ctx]
  (publish-fn (::body ctx)))

(defresource index-resource [publish-fn]
  :allowed-methods #{:post :get}
  :available-media-types ["application/json"]
  :known-content-type? ["application/json"]
  :malformed? malformed?
  :handle-created (partial handle-created publish-fn))

(ns kixi.eventlog.api
  (:require [liberator.core :refer (defresource)]
            [clojure.tools.logging :as log]))

(defn malformed? [ctx]
  (println (get-in ctx [:request :body]))
  (if-let [body (get-in ctx [:request :body])]
    [false (assoc ctx ::body body)]
    true))

(defn handle-created [publish-fn ctx]
  (publish-fn (::body ctx)))

(defresource index-resource [publish-fn]
  :allowed-methods #{:post :get}
  :available-media-types ["application/json"]
  :known-content-type? ["application/json"]
  :malformed? malformed?
  :handle-created (partial handle-created publish-fn))

Return the correct thing from malformed?.


(ns onyx.messaging.aeron-media-driver
  (:require [clojure.core.async :refer [chan <!!]])
  #_(:import [uk.co.real_logic.aeron Aeron FragmentAssemblyAdapter]
           [uk.co.real_logic.aeron Aeron$Context]
           [uk.co.real_logic.aeron.driver MediaDriver MediaDriver$Context ThreadingMode]))

#_(defn -main [& args]
  (let [ctx (doto (MediaDriver$Context.)
              (.threadingMode ThreadingMode/SHARED)
              ;(.threadingMode ThreadingMode/DEDICATED)
              (.dirsDeleteOnExit true))
        media-driver (MediaDriver/launch ctx)]
    (println "Launched the Media Driver. Blocking forever...")
    (<!! (chan))))

(ns onyx.messaging.aeron-media-driver
  (:require [clojure.core.async :refer [chan <!!]])
  (:import [uk.co.real_logic.aeron Aeron$Context]
           [uk.co.real_logic.aeron.driver MediaDriver MediaDriver$Context ThreadingMode]))

(defn -main [& args]
  (let [ctx (doto (MediaDriver$Context.)
              ;(.threadingMode ThreadingMode/SHARED)
              ;(.threadingMode ThreadingMode/DEDICATED)
              #_(.dirsDeleteOnExit true))
        media-driver (MediaDriver/launch ctx)]
    (println "Launched the Media Driver. Blocking forever...")
    (<!! (chan))))

Fix external media driver for maven aeron release


(ns nth-prime)

(defn sqrt
  "Wrapper around java's sqrt method."
  [number]
  (int (Math/ceil (Math/sqrt number))))

(defn divides?
  "Helper function to decide if a number is evenly divided by divisor."
  [number divisor]
  (zero? (mod number divisor)))

(defn prime? [number]
  (cond
    (= 2 number) true
    (even? number) false
    :else (empty? (for [n (range 3 (inc (sqrt number)) 2) :when (divides? number n)] n))))

(defn next-prime [start]
  (loop [n (inc start)]
    (if (prime? n)
      n
      (recur (inc n)))))

(defn nth-prime [index]
  (when (not (pos? index))
    (throw (IllegalArgumentException. "nth-prime expects a positive integer for an argument")))
  (loop [cur-prime 2
         num-times 1]
    (if (= num-times index)
      cur-prime
      (recur (next-prime cur-prime) (inc num-times)))))

(ns nth-prime)

(defn sqrt
  "Wrapper around java's sqrt method."
  [number]
  (int (Math/ceil (Math/sqrt number))))

(defn divides?
  "Helper function to decide if a number is evenly divided by divisor."
  [number divisor]
  (zero? (mod number divisor)))

(defn- prime-by-trial-division?
  "Simple trial division prime check."
  [number]
  (empty? (for [n (range 3 (inc (sqrt number)) 2) :when (divides? number n)] n)))

(defn prime? [number]
  (cond
    (= 2 number) true
    (even? number) false
    :else (prime-by-trial-division? number)))

(defn next-prime [start]
  (loop [n (inc start)]
    (if (prime? n)
      n
      (recur (inc n)))))

(defn nth-prime [index]
  (when (not (pos? index))
    (throw (IllegalArgumentException. "nth-prime expects a positive integer for an argument")))
  (loop [cur-prime 2
         num-times 1]
    (if (= num-times index)
      cur-prime
      (recur (next-prime cur-prime) (inc num-times)))))

Move trial-division test into helper function in nth-prime


(ns {{project-ns}}.core
  (:require [om.core :as om :include-macros true]{{{core-cljs-requires}}}))

(enable-console-print!)

(defonce app-state (atom {:text "Hello Chestnut!"}))

(defn main []
  (om/root
    (fn [app owner]
      (reify
        om/IRender
        (render [_]
          (dom/h1 {{#not-om-tools?}}nil {{/not-om-tools?}}(:text app)))))
    app-state
    {:target (. js/document (getElementById "app"))}))

(ns {{project-ns}}.core
  (:require [om.core :as om :include-macros true]{{{core-cljs-requires}}}))

(enable-console-print!)

(defonce app-state (atom {:text "Hello Chestnut!"}))

(defn root-component [app owner]
  (reify
    om/IRender
    (render [_]
      (dom/div nil (dom/h1 {{#not-om-tools?}}nil {{/not-om-tools?}}(:text app))))))

(om/root
 root-component
 app-state
 {:target (. js/document (getElementById "app"))})

Make the om root component its own function


(ns circle.env
  (:require midje.semi-sweet)
  (:require clojure.test)
  (:use [circle.sh :only (sh)])
  (:require [clojure.string :as str])
  (:use [clojure.contrib.except :only (throw-if-not)]))

(def env (condp = (System/getenv "CIRCLE_ENV")
           "production" :production
           "staging" :staging
           nil :local))

(def production? (= env :production))
(def staging? (= env :staging))
(def local? (= env :local))
(throw-if-not (= 1 (count (filter true? [production? staging? local?]))))

(when production?
  (alter-var-root (var midje.semi-sweet/*include-midje-checks*) (constantly false))
  (alter-var-root (var clojure.test/*load-tests*) (constantly false)))

(defn username
  "Returns the username that started this JVM"
  []
  (-> (sh "whoami")
      :out
      (str/trim)))

(defn hostname
  "hostname of the box"
  []
  (-> (sh "hostname")
      :out
      (str/trim)))

(ns circle.env
  (:require midje.semi-sweet)
  (:require clojure.test)
  (:use [circle.sh :only (sh)])
  (:require [clojure.string :as str])
  (:use [clojure.contrib.except :only (throw-if-not)]))

(def env (condp = (System/getenv "RAILS_ENV")
           "production" :production
           "staging" :staging
           nil :local))

(def production? (= env :production))
(def staging? (= env :staging))
(def local? (= env :local))
(throw-if-not (= 1 (count (filter true? [production? staging? local?]))))

(when production?
  (alter-var-root (var midje.semi-sweet/*include-midje-checks*) (constantly false))
  (alter-var-root (var clojure.test/*load-tests*) (constantly false)))

(defn username
  "Returns the username that started this JVM"
  []
  (-> (sh "whoami")
      :out
      (str/trim)))

(defn hostname
  "hostname of the box"
  []
  (-> (sh "hostname")
      :out
      (str/trim)))

Make the backend code key off RAILS_ENV rather than CIRCLE_ENV


(ns clj-http.examples.caching-middleware
  (:require
   [clj-http.client :as http]
   [clojure.core.cache :as cache]))

(def http-cache (atom (cache/ttl-cache-factory {} :ttl (* 60 60 1000))))

(defn- cached-response
  ([client req]
   (let [cache-key (str (:server-name req) (:uri req) "?" (:query-string req))]
     (if (cache/has? @http-cache cache-key)
       (do
         (println "CACHE HIT")
         (client req (reset! http-cache (cache/hit @http-cache cache-key)) nil ) )
       (do
         (println "CACHE MISS")
         (let [resp (client req)]
           (if (http/success? resp)
             (do
               (reset! http-cache (cache/miss @http-cache cache-key resp))
               (client req resp nil))
             (do
               (client req resp nil)))))))))

(defn wrap-caching-middleware
  [client]
  (fn
    ([req]
     (cached-response client req))))

(defn example [& uri]
  (http/with-additional-middleware [#'wrap-caching-middleware]
    (http/get (or uri "https://api.github.com"))))

;; Try this out:
;;
;; user> (use '[clj-http.examples.caching-middleware :as mw])
;; nil
;; user> (mw/example)
;; CACHE MISS

(ns clj-http.examples.caching-middleware
  (:require
   [clj-http.client :as http]
   [clojure.core.cache :as cache]))

(def http-cache (atom (cache/ttl-cache-factory {} :ttl (* 60 60 1000))))

(defn- cached-response
  ([client req]
   (let [cache-key (str (:server-name req) (:uri req) "?" (:query-string req))]
     (if (cache/has? @http-cache cache-key)
       (do
         (println "CACHE HIT")
         (client req (reset! http-cache (cache/hit @http-cache cache-key)) nil ) )
       (do
         (println "CACHE MISS")
         (let [resp (client req)]
           (if (http/success? resp)
             (do
               (reset! http-cache (cache/miss @http-cache cache-key resp))
               (client req resp nil))
             (do
               (client req resp nil)))))))))

(defn wrap-caching-middleware
  [client]
  (fn
    ([req]
     (cached-response client req))))

(defn example [& uri]
  (http/with-additional-middleware [#'wrap-caching-middleware]
    (http/get (or uri "https://api.github.com")
              {
               :debug true
               :debug-body true
               :throw-entire-message? true
               })))

;; Try this out:
;;
;; user> (use '[clj-http.examples.caching-middleware :as mw])
;; nil
;; user> (mw/example)
;; CACHE MISS

Add debug to http/get to show request.

Add debug to http/get to show request.


(ns overseer.status
  "Functions for querying the state of jobs in the system"
  (:require [datomic.api :as d]
            [clojure.set :as set]))

(defn jobs-with-status [db status]
  (->> (d/q '[:find ?jid
              :in $ ?status
              :where
              [?e :job/status ?status]
              [?e :job/id ?jid]]
            db
            status)
       (map first)
       (set)))

(defn jobs-failed
  "Find all jobs that have failed."
  [db]
  (jobs-with-status db :failed))

(defn jobs-unfinished
  "Find all jobs that are not yet complete."
  [db]
  (->> (d/q '[:find ?jid
              :where
              [?e :job/status ?s]
              [((comp not contains?) #{:finished :aborted :failed} ?s)]
              [?e :job/id ?jid]]
            db)
       (map first)
       (into #{})))

(defn jobs-started
  "Find all jobs that are currently started."
  [db]
  (jobs-with-status db :started))

(defn jobs-ready
  "Find all jobs that are ready to run.
   Works by finding all jobs that are not yet done, and subtracting the
   jobs who dependencies are not yet ready."
  [db]
  (set/difference
    (jobs-unfinished db)
    (->> (d/q '[:find ?jid
                :where
                [?j :job/dep ?dj]
                [?dj :job/status ?djs]
                [(not= :finished ?djs)]
                [?j :job/id ?jid]]
              db)
         (map first)
         (into #{}))))

(ns overseer.status
  "Functions for querying the state of jobs in the system"
  (:require [datomic.api :as d]
            [clojure.set :as set]))

(defn jobs-with-status [db status]
  (->> (d/q '[:find ?jid
              :in $ ?status
              :where
              [?e :job/status ?status]
              [?e :job/id ?jid]]
            db
            status)
       (map first)
       (set)))

(defn jobs-unfinished
  "Find all jobs that are not yet complete."
  [db]
  (->> (d/q '[:find ?jid
              :where
              [?e :job/status ?s]
              [((comp not contains?) #{:finished :aborted :failed} ?s)]
              [?e :job/id ?jid]]
            db)
       (map first)
       (into #{})))

(defn jobs-ready
  "Find all jobs that are ready to run.
   Works by finding all jobs that are not yet done, and subtracting the
   jobs who dependencies are not yet ready."
  [db]
  (set/difference
    (jobs-unfinished db)
    (->> (d/q '[:find ?jid
                :where
                [?j :job/dep ?dj]
                [?dj :job/status ?djs]
                [(not= :finished ?djs)]
                [?j :job/id ?jid]]
              db)
         (map first)
         (into #{}))))

Remove extraneous jobs-started / jobs-failed


(ns onyx.log.commands.complete-task
  (:require [onyx.extensions :as extensions]))

(defmethod extensions/apply-log-entry :complete-task
  [{:keys [args message-id]} replica]
  (-> replica
      (update-in [:completions (:job args)] conj (:task args))
      (update-in [:completions (:job args)] vec)
      (update-in [:allocations (:job args)] dissoc (:task args))))

(defmethod extensions/replica-diff :complete-task
  [{:keys [args]} old new]
  {:job (:job args)
   :task (:task args)})

(defmethod extensions/reactions :complete-task
  [{:keys [args]} old new diff peer-args]
  (let [allocations (get-in old [:allocations (:job args) (:task args)])]
    (when (some #{(:id peer-args)} (into #{} allocations))
      [{:fn :volunteer-for-task :args {:id (:id peer-args)}}])))

(defmethod extensions/fire-side-effects! :complete-task
  [{:keys [args]} old new diff state]
  state)

(ns onyx.log.commands.complete-task
  (:require [onyx.extensions :as extensions]))

(defmethod extensions/apply-log-entry :complete-task
  [{:keys [args message-id]} replica]
  (let [peers (get-in replica [:allocations (:job args) (:task args)])]
    (-> replica
        (update-in [:completions (:job args)] conj (:task args))
        (update-in [:completions (:job args)] vec)
        (update-in [:allocations (:job args)] dissoc (:task args))
        (merge {:peer-states (into {} (map (fn [p] {p :idle}) peers))}))))

(defmethod extensions/replica-diff :complete-task
  [{:keys [args]} old new]
  {:job (:job args)
   :task (:task args)})

(defmethod extensions/reactions :complete-task
  [{:keys [args]} old new diff peer-args]
  (let [allocations (get-in old [:allocations (:job args) (:task args)])]
    (when (some #{(:id peer-args)} (into #{} allocations))
      [{:fn :volunteer-for-task :args {:id (:id peer-args)}}])))

(defmethod extensions/fire-side-effects! :complete-task
  [{:keys [args]} old new diff state]
  state)

Make all peers idle after task completion.


(ns atom-finder.core
  (:require [atom-finder.classifier :refer :all]
            [atom-finder.count-subtrees :refer :all]
            [atom-finder.constants :refer :all]
            [atom-finder.util :refer :all]
            [atom-finder.classifier-util :refer :all]
            [atom-finder.results-util :refer :all]
            [atom-finder.atoms-in-dir :refer :all]
            [clojure.pprint :refer [pprint]]
            [clojure.data.csv :as csv]
            [clojure.java.io :as io]
            ))

(defn -main
  [& args]

  (print-atoms-in-dir
   (expand-home "~/opt/src/redis")
   (map atom-lookup [:macro-operator-precedence])
   )
)

(->> "macro-operator-precedence_redis_2017-03-10_1.edn"
     read-data
     (take 30)
     (found-atom-source :macro-operator-precedence)
     ;sum-found-atoms
     )

;sum-found-atoms => {:macro-operator-precedence 1760}
;sum-found-atoms => {:macro-operator-precedence  759} # After removing atomic macros (#define M1 123)

(ns atom-finder.core
  (:require [atom-finder.classifier :refer :all]
            [atom-finder.count-subtrees :refer :all]
            [atom-finder.constants :refer :all]
            [atom-finder.util :refer :all]
            [atom-finder.classifier-util :refer :all]
            [atom-finder.results-util :refer :all]
            [atom-finder.atoms-in-dir :refer :all]
            [clojure.pprint :refer [pprint]]
            [clojure.data.csv :as csv]
            [clojure.java.io :as io]
            ))

(defn -main
  [& args]

  (print-atoms-in-dir
   (expand-home "~/opt/src/redis")
   (map atom-lookup [:macro-operator-precedence])
   )
)

;(->> "macro-operator-precedence_redis_2017-03-10_1.edn"
;     read-data
;     (take 30)
;     (found-atom-source :macro-operator-precedence)
;     ;sum-found-atoms
;     )

;sum-found-atoms => {:macro-operator-precedence 1760}
;sum-found-atoms => {:macro-operator-precedence  759} # After removing atomic macros (#define M1 123)

Comment out manual testing code

Comment out manual testing code


(ns word-keeper.core
  (:require [org.httpkit.server :refer [run-server]]
            [compojure.core :refer [defroutes GET]]
            [compojure.handler :refer [site]]
            [compojure.route :refer [files not-found]]
            [clostache.parser :refer [render-resource]]
            [word-keeper.backend  :refer :all]
            [word-keeper.frontend :refer :all]))

<<<<<<>>>>>> FETCH_HEAD
(defroutes routes
  (GET "/" [] action-index)
  (files "/public/")
  (not-found "
404. Not found
"))

(defn -main [& args]
  (run-server (site #'routes) {:port 8080}))

(ns word-keeper.core
  (:require [org.httpkit.server :refer [run-server]]
            [compojure.core :refer [defroutes GET]]
            [compojure.handler :refer [site]]
            [compojure.route :refer [files not-found]]
            [clostache.parser :refer [render-resource]]
            [word-keeper.backend  :refer :all]
            [word-keeper.frontend :refer :all]))

(def consumer-key "5KvZggyamEy8yHD0oACgAkLxH")
(def consumer-secret "3DeEHXQ6LVh7LxSdApivzAOiwBAcGdvRorheKzheCchbPPQF6h")

(defroutes routes
  (GET "/" [] action-index)
  (files "/public/")
  (not-found "
404. Not found
"))

(defn -main [& args]
  (run-server (site #'routes) {:port 8080}))

Clean up after dirty merge

Clean up after dirty merge


(ns incise.parsers.impl.markdown-spec
  (:require [speclj.core :refer :all]
            [clojure.java.io :refer [file resource]]
            (incise [load :refer (load-parsers-and-layouts)]
                    [config :as conf])
            [incise.spec-helpers :refer :all]
            [incise.parsers.html :refer [html-parser]]
            [incise.parsers.impl.markdown :refer :all]
            [me.raynes.cegdown :as md])
  (:import [java.io File]))

(defn parse-markdown []
  (let [markdown-file (file (resource "spec/markdown-options.md"))
        parse (comp slurp first force (html-parser markdown-to-html))]
    (parse markdown-file)))

(describe "parsing markdown"
  (context "parsing with default options"
    (around-with-custom-config :in-dir "resources/spec"
                               :out-dir "/tmp/")
    (with result (parse-markdown))
    (it "parses a markdown file into html"
        (should-contain #"<html>" @result))
    (it "parses without hardwraps"
        (should-contain "First line Second line" @result)))
  (context "parsing with custom options"
    (around-with-custom-config :in-dir "resources/spec"
                               :out-dir "/tmp/"
                               :parsers {:markdown {:extensions [:hardwraps]}})
    (with result (parse-markdown))
    (it "parses with hardwraps"
      (should-contain "First line<br/>Second line" @result))))

(run-specs)

(ns incise.parsers.impl.markdown-spec
  (:require [speclj.core :refer :all]
            [clojure.java.io :refer [file resource]]
            (incise [load :refer (load-parsers-and-layouts)]
                    [config :as conf])
            [incise.spec-helpers :refer :all]
            [incise.parsers.html :refer [html-parser]]
            [incise.parsers.impl.markdown :refer :all]
            [me.raynes.cegdown :as md])
  (:import [java.io File]))

(describe "parsing markdown"
  (before (load-parsers-and-layouts))
  (with markdown-file (file (resource "spec/markdown-options.md")))
  (around-with-custom-config :in-dir "resources/spec"
                             :out-dir "/tmp/")
  (with parse (comp slurp first force (html-parser markdown-to-html)))
  (with result (@parse @markdown-file))
  (context "parsing with default options"
    (it "parses a markdown file into html"
        (should-contain #"<html>" @result))
    (it "parses without hardwraps"
        (should-contain "First line Second line" @result)))
  (context "parsing with custom options"
    (around-with-custom-config :parsers {:markdown {:extensions [:hardwraps]}})
    (it "parses with hardwraps"
      (should-contain "First line<br/>Second line" @result))))

(run-specs)

Load layouts in markdown parsing spec.

Load layouts in markdown parsing spec.

Otherwise it cannot run on its own. Refactor a bit too (DRY it up).


(ns discuss.references.lib
  (:require [discuss.utils.common :as lib]))

(defn save-selected-reference!
  "Saves the currently clicked reference for further processing."
  [ref]
  (lib/update-state-item! :reference-usages :selected-reference (fn [_] ref)))

(defn get-selected-reference
  "Returns the currently selected reference."
  []
  (get-in @lib/app-state [:reference-usages :selected-reference]))

(defn save-selected-statement!
  "Saves the currently selected statement for further processing."
  [statement]
  (lib/update-state-item! :reference-usages :selected-statement (fn [_] statement)))

(defn get-selected-statement
  "Returns the currently selected statement from reference usages."
  []
  (get-in @lib/app-state [:reference-usages :selected-statement]))

(defn get-reference-usages
  "Return list of reference usages, which were previously stored in the app-state.
   TODO: optimize"
  []
  (get-in @lib/app-state [:common :reference-usages]))

(ns discuss.references.lib
  (:require [discuss.utils.common :as lib]))

(defn save-selected-reference!
  "Saves the currently clicked reference for further processing."
  [ref]
  (lib/update-state-item! :reference-usages :selected-reference (fn [_] ref)))

(defn get-selected-reference
  "Returns the currently selected reference."
  []
  (get-in @lib/app-state [:reference-usages :selected-reference]))

(defn save-selected-statement!
  "Saves the currently selected statement for further processing."
  [statement]
  (lib/update-state-item! :reference-usages :selected-statement (fn [_] statement)))

(defn get-selected-statement
  "Returns the currently selected statement from reference usages."
  []
  (get-in @lib/app-state [:reference-usages :selected-statement]))

(defn supportive?
  "Store if a user supports the statement or not."
  ([]
    (get-in @lib/app-state [:reference-usages :supportive?]))
  ([bool]
   (lib/update-state-item! :reference-usages :supportive? (fn [_] bool))))

(defn get-reference-usages
  "Return list of reference usages, which were previously stored in the app-state.
   TODO: optimize"
  []
  (get-in @lib/app-state [:common :reference-usages]))

Add getter / setter for supportive?

Add getter / setter for supportive?


(ns server.systems
  (:require [system.core :refer [defsystem]]
            (system.components
              [http-kit :refer [new-web-server]])
            [clj-consonant.local-store :refer [new-local-store]]
            [server.handler :refer [app-server backend-server]]))

(defsystem development-system
  [:app-server (new-web-server 3000 app-server)
   :backend-server (new-web-server 3001 backend-server)
   :consonant (new-local-store "/home/jannis/tmp/copaste-store.git")])

(defsystem production-system
  [:app-server (new-web-server 3000 app-server)
   :backend-server (new-web-server 3001 backend-server)
   :consonant (new-local-store "/home/jannis/tmp/copaste-store.git")])

(ns server.systems
  (:require [system.core :refer [defsystem]]
            (system.components
              [http-kit :refer [new-web-server]])
            [clj-consonant.local-store :refer [new-local-store]]
            [server.handler :refer [app-server backend-server]]))

(defsystem development-system
  [:app-server (new-web-server 3000 app-server)
   :backend-server (new-web-server 3001 backend-server)
   :consonant (new-local-store "/tmp/copaste-store.git")])

(defsystem production-system
  [:app-server (new-web-server 3000 app-server)
   :backend-server (new-web-server 3001 backend-server)
   :consonant (new-local-store "/tmp/copaste-store.git")])

Use /tmp/copaste-store.git for the data store


(ns dictionator.core
  (:require [com.stuartsierra.component :as component]
            [dictionator.system :as app])
  (:gen-class))

(defn -main
  "starts the Dictionator webservice"
  [& args]
  (let [[port] args]
    (component/start
     (app/prod-system {:web-port 3000}))))

(ns dictionator.core
  (:require [com.stuartsierra.component :as component]
            [dictionator.system :as app])
  (:gen-class))

(defn -main
  "starts the Dictionator webservice"
  [& args]
  (let [[port] args]
    (println (format "Starting Dictionator webservice on port: %s" port))
    (component/start
     (app/prod-system {:web-port 3000}))))

Add info print-line after service starts


(ns {{project-ns}}.dev
  (:require [cemerick.piggieback :as piggieback]
            [weasel.repl.websocket :as weasel]
            [leiningen.core.main :as lein]))

(defn browser-repl []
  (piggieback/cljs-repl :repl-env (weasel/repl-env :ip "0.0.0.0" :port 9001)))

(defn start-figwheel []
  (future
    (print "Starting figwheel.\n")
    (lein/-main ["figwheel"])))

(ns {{project-ns}}.dev
  (:require [cemerick.piggieback :as piggieback]
            [weasel.repl.websocket :as weasel]
            [leiningen.core.main :as lein]))

(defn browser-repl []
  (piggieback/cljs-repl :repl-env (weasel/repl-env :ip "127.0.0.1" :port 9001)))

(defn start-figwheel []
  (future
    (print "Starting figwheel.\n")
    (lein/-main ["figwheel"])))

Change listening host to localhost instead of 0.0.0.0

No reason to listen for connections from the outside.


(ns teach-by-friends.shared.icons)

(defn import-icon [name]
  (js/require (str "./images/" name ".png")))

(def ^:private icons
  {:back (import-icon "back")
   :close (import-icon "close")
   :episodes (import-icon "episodes")
   :favorites (import-icon "favorites")
   :information (import-icon "information")
   :words (import-icon "words_active")})

(defn get-icon [icon]
  (get icons icon))

(ns teach-by-friends.shared.icons)

(def back (js/require "./images/back.png"))
(def close (js/require "./images/close.png"))
(def episodes (js/require "./images/episodes.png"))
(def favorites (js/require "./images/favorites.png"))
(def information (js/require "./images/information.png"))
(def words (js/require "./images/words_active.png"))

(def ^:private icons
  {:back back
   :close close
   :episodes episodes
   :favorites favorites
   :information information
   :words words})

(defn get-icon [icon]
  (get icons icon))

Fix error with dinamic paths to images (remake to static)


(defproject buddy/buddy-sign "0.5.1"
  :description "High level message signing for Clojure"
  :url "https://github.com/funcool/buddy-sign"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"]
                 [com.taoensso/nippy "2.8.0"]
                 [buddy/buddy-core "0.5.0"]
                 [slingshot "0.12.2"]
                 [cats "0.4.0"]
                 [clj-time "0.9.0"]
                 [cheshire "5.4.0"]]
  :source-paths ["src"]
  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
  :test-paths ["test"])

(defproject buddy/buddy-sign "0.5.1"
  :description "High level message signing for Clojure"
  :url "https://github.com/funcool/buddy-sign"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"]
                 [com.taoensso/nippy "2.8.0"]
                 [buddy/buddy-core "0.6.0-SNAPSHOT"]
                 ;; [slingshot "0.12.2"]
                 [cats "0.4.0"]
                 [clj-time "0.9.0"]
                 [cheshire "5.4.0"]]
  :source-paths ["src"]
  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
  :test-paths ["test"])

Update buddy-core dependency and remove slingshot dependency (now is transitive from buddy-core).


(defproject rester "0.2.2-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [org.clojure/data.csv "0.1.3"]
                 [clj-http "3.10.0"]
                 [org.clojure/tools.logging "0.3.1"]
                 [org.clojure/data.json "0.2.6"]
                 [cheshire "5.6.1"]
                 [org.clojure/data.xml "0.0.8"]
                 [json-path "2.0.0"]
                 [dk.ative/docjure "1.10.0"]
                 [io.forward/yaml "1.0.9"]
                 [org.clojure/core.async "0.4.490"]
                 [ch.qos.logback/logback-classic "1.2.3"]
                 [org.clojure/tools.cli "0.4.1"]
                 ;; [org.clojure/core.specs.alpha "0.2.44"]
                 ]
  :main ^:skip-aot rester.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}
             :dev {:dependencies [[org.clojure/test.check "0.10.0-alpha3"]]}}
  :uberjar-name "rester.jar")

(defproject rester "0.2.2-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [org.clojure/data.csv "0.1.3"]
                 [clj-http "3.10.0"]
                 [org.clojure/tools.logging "0.3.1"]
                 [org.clojure/data.json "0.2.6"]
                 [cheshire "5.6.1"]
                 [org.clojure/data.xml "0.0.8"]
                 [json-path "2.0.0"]
                 [dk.ative/docjure "1.10.0"]
                 [io.forward/yaml "1.0.9" :exclusions [org.flatland/ordered]]
                 [org.flatland/ordered "1.5.7"]
                 [org.clojure/core.async "0.4.490"]
                 [ch.qos.logback/logback-classic "1.2.3"]
                 [org.clojure/tools.cli "0.4.1"]
                 ;; [org.clojure/core.specs.alpha "0.2.44"]
                 ]
  :main ^:skip-aot rester.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}
             :dev {:dependencies [[org.clojure/test.check "0.10.0-alpha3"]]}}
  :uberjar-name "rester.jar")

Fix dependency compat java 11

Fix dependency compat java 11


(defproject onyx-app/lein-template "0.11.1.0"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.11.1.1-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(defproject stencil "0.3.0-SNAPSHOT"
  :description "Mustache in Clojure"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [scout "0.1.0"]
                 [quoin "0.1.0-SNAPSHOT"]
                 [slingshot "0.8.0"]
                 [org.clojure/core.cache "0.6.1"]]
  :profiles {:dev {:dependencies [[org.clojure/data.json "0.1.2"]]}
             :clj1.2 {:dependencies [[org.clojure/clojure "1.2.1"]]}
             :clj1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
             :clj1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}}
  :extra-files-to-clean ["test/spec"])

(defproject stencil "0.3.0-SNAPSHOT"
  :description "Mustache in Clojure"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [scout "0.1.0"]
                 [quoin "0.1.0"]
                 [slingshot "0.8.0"]
                 [org.clojure/core.cache "0.6.1"]]
  :profiles {:dev {:dependencies [[org.clojure/data.json "0.1.2"]]}
             :clj1.2 {:dependencies [[org.clojure/clojure "1.2.1"]]}
             :clj1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
             :clj1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}}
  :extra-files-to-clean ["test/spec"])

Change quoin version to 0.1.0.

Change quoin version to 0.1.0.


(set-env!
  :resource-paths #{"resources"}
  :dependencies '[[org.clojure/clojure "1.8.0"]
                  [afrey/boot-asset-fingerprint "1.0.0-SNAPSHOT"]])

(require '[afrey.boot-asset-fingerprint :refer [asset-fingerprint]])

(deftask dev []
  (comp
    (asset-fingerprint)
    (target)))

(set-env!
  :resource-paths #{"resources"}
  :dependencies '[[org.clojure/clojure "1.8.0"]
                  [afrey/boot-asset-fingerprint "1.0.0-SNAPSHOT"]
                  [pandeiro/boot-http "0.7.3" :scope "test"]])

(require
  '[afrey.boot-asset-fingerprint :refer [asset-fingerprint]]
  '[pandeiro.boot-http :refer [serve]])

(deftask dev []
  (comp
    (watch)
    (serve :port 5000 :reload true)
    (asset-fingerprint)
    (target)))

Add boot-http to the example task

Add boot-http to the example task


(ns io.aviso.rook.resources.swagger
  "Exposes a resource used to access the Swagger description for the mapped namespaces (excluding this one, and any other
  endpoints with the :no-swagger metadata."
  {:no-swagger true
   :added      "0.1.27"}
  (:require [ring.util.response :as res]
            [cheshire.core :as json]))

(defn swagger-json
  "Returns the Swagger API description as (pretty) JSON."
  {:route [:get "swagger.json"]}
  [swagger-object]
  ;; It's a bit silly to stream this to JSON on each request; a cache would be nice. Later.
  ;; Don't want to rely on outer layers providing the right middleware, so we do the conversion
  ;; to JSON right here.
  (-> swagger-object
      (json/generate-string {:pretty true})
      res/response
      (res/content-type "application/json")))

(ns io.aviso.rook.resources.swagger
  "Exposes a resource used to access the Swagger description for the mapped namespaces (excluding this one, and any other
  endpoints with the :no-swagger metadata."
  {:no-swagger true
   :added      "0.1.27"}
  (:require [ring.util.response :as res]
            [cheshire.core :as json]))

(defn swagger-json
  "Returns the Swagger API description as (pretty) JSON."
  {:route [:get ["swagger.json"]]}
  [swagger-object]
  ;; It's a bit silly to stream this to JSON on each request; a cache would be nice. Later.
  ;; Don't want to rely on outer layers providing the right middleware, so we do the conversion
  ;; to JSON right here.
  ;; More to do w.r.t. CORS and enabling the client to submit requests.
  (-> swagger-object
      (json/generate-string {:pretty true})
      res/response
      ;; Access-Control-Allow-Origin: *
      ;; Access-Control-Allow-Methods: GET, POST, DELETE, PUT, PATCH, OPTIONS
      ;; Access-Control-Allow-Headers: Content-Type, api_key, Authorization
      (res/header "Access-Control-Allow-Origin" "*")
      (res/header "Access-Control-Allow-Methods" "GET")
      (res/header "Access-Control-Allow-Headers" "Content-Type")
      (res/content-type "application/json")))

Add basic CORS enabling headers

Add basic CORS enabling headers


(defproject org.onyxplatform/onyx-peer-http-query "0.10.0.1-SNAPSHOT"
  :description "An Onyx health and query HTTP server"
  :url "https://github.com/onyx-platform/onyx-peer-http-query"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.10.1-SNAPSHOT"]
                 [ring/ring-core "1.6.2"]
                 [org.clojure/java.jmx "0.3.4"]
                 [ring-jetty-component "0.3.1"]
                 [cheshire "5.7.0"]]
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :profiles {:dev {:dependencies [[clj-http "3.4.1"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}})

(defproject org.onyxplatform/onyx-peer-http-query "0.10.0.1-SNAPSHOT"
  :description "An Onyx health and query HTTP server"
  :url "https://github.com/onyx-platform/onyx-peer-http-query"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.10.1-20170901.165900-21"]
                 [ring/ring-core "1.6.2"]
                 [org.clojure/java.jmx "0.3.4"]
                 [ring-jetty-component "0.3.1"]
                 [cheshire "5.7.0"]]
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :profiles {:dev {:dependencies [[clj-http "3.4.1"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}})

Use latest snapshot so build works on circle.