;; Copyright © 2014-2017, JUXT LTD.

(def VERSION "1.3.0-alpha4")

(defproject yada VERSION
  :description "A complete batteries-included bundle of yada"
  :license {:name "The MIT License"
            :url "https://opensource.org/licenses/MIT"}
  :pedantic? :abort

  :dependencies [[yada/aleph ~VERSION]
                 [yada/async ~VERSION]
                 [yada/bidi ~VERSION]
                 [yada/core ~VERSION]
                 [yada/json ~VERSION]
                 [yada/json-html ~VERSION]
                 [yada/jwt ~VERSION]
                 [yada/multipart ~VERSION]
                 [yada/oauth2 ~VERSION]
                 [yada/swagger ~VERSION]
                 [yada/transit ~VERSION]
                 [yada/webjars ~VERSION]]

  :profiles {:test {:dependencies [[org.clojure/clojure "1.8.0"]
                                   [org.webjars/bootstrap "3.3.6"]]}})

;; Copyright © 2014-2017, JUXT LTD.

(def VERSION "1.3.0-alpha4")

(defproject yada VERSION
  :description "A complete batteries-included bundle of yada"
  :license {:name "The MIT License"
            :url "https://opensource.org/licenses/MIT"}
  :pedantic? :abort

  :dependencies [[yada/aleph ~VERSION]
                 [yada/async ~VERSION]
                 [yada/bidi ~VERSION]
                 [yada/core ~VERSION]
                 [yada/json ~VERSION]
                 [yada/json-html ~VERSION]
                 [yada/jwt ~VERSION]
                 [yada/multipart ~VERSION]
                 [yada/oauth2 ~VERSION]
                 [yada/swagger ~VERSION :exclusions [clj-time]]
                 [yada/transit ~VERSION]
                 [yada/webjars ~VERSION]]

  :profiles {:test {:dependencies [[org.clojure/clojure "1.8.0"]
                                   [org.webjars/bootstrap "3.3.6"]]}})

Fix abort issue due to dependency conflict


(ns com.frereth.server.logging
  (require [com.postspectacular.rotor :as rotor]
           [com.stuartsierra.component :as component]
           [taoensso.timbre :as log
            :refer (trace debug info warn error fatal spy with-log-level)]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Schema

(defrecord Logger []
  component/Lifecycle

  (start
    [this]
    (log/set-config!
     [:appenders :rotor]
     {:doc "Writes to (:path (:rotor :shared-appender-config)) file and creates optional backups"
      :min-level :trace
      :enabled? true
      :async? false
      :max-message-per-msecs nil
      :fn rotor/append})
    (log/set-config!
     [:shared-appender-config :rotor]
     {:path "logs/app.log" :max-size (* 512 1024) :backlog 5})
    (log/warn "FIXME: Log to a database instead")
    this)

  (stop
    [this]
    this))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Public

(defn ctor
  [_]
  (->Logger))

(ns com.frereth.server.logging
  (require [com.stuartsierra.component :as component]
           [taoensso.timbre :as log
            :refer (trace debug info warn error fatal spy with-log-level)]
           [taoensso.timbre.appenders.3rd-party.rotor :as rotor]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Schema

(defrecord Logger []
  component/Lifecycle

  (start
    [this]
    (log/merge-config!
     {:appenders {:rotor (rotor/rotor-appender {:path "logs/app.log"
                                                :max-size (* 512 1024)
                                                :backlog 5})}})
    (log/warn "FIXME: Log to a database instead")
    this)

  (stop
    [this]
    this))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Public

(defn ctor
  [_]
  (->Logger))

Update to new log rotor

Update to new log rotor


(ns oc.storage.resources.reaction)

(defn- reaction-collapse
  "Reducer function that collapses reactions into count and sequence of author based on common reaction unicode."
  [reactions reaction]
  (let [unicode (:reaction reaction)
        author (-> reaction :author :name)
        author-id (-> reaction :author :user-id)]
    (if-let [existing-reaction (reactions unicode)]
      ;; have this unicode already, so add this reaction to it
      (assoc reactions unicode (-> existing-reaction
                                  (update :count inc)
                                  (update :authors #(conj % author))
                                  (update :author-ids #(conj % author-id))))
      ;; haven't seen this reaction unicode before, so init a new one
      (assoc reactions unicode {:reaction unicode :count 1 :authors [author] :author-ids [author-id]}))))

(defn aggregate-reactions
  "
  Given a sequence of individual reaction interactions, collapse it down to a set of distinct reactions
  that include the count of how many times reacted and the list of author names and IDs that reacted.
  "
  [entry-reactions]
  (or (vals (reduce reaction-collapse {} (map #(assoc % :count 1) entry-reactions))) []))

(ns oc.storage.resources.reaction)

(defn- reaction-collapse
  "Reducer function that collapses reactions into count and sequence of author based on common reaction unicode."
  [reactions reaction]
  (let [unicode (:reaction reaction)
        author (-> reaction :author :name)
        author-id (-> reaction :author :user-id)]
    (if-let [existing-reaction (reactions unicode)]
      ;; have this unicode already, so add this reaction to it
      (assoc reactions unicode (-> existing-reaction
                                  (update :count + (:count reaction))
                                  (update :authors #(remove nil? (conj % author)))
                                  (update :author-ids #(remove nil? (conj % author-id)))))
      ;; haven't seen this reaction unicode before, so init a new one
      (assoc reactions unicode {:reaction unicode
                                :count (if author 1 0)
                                :authors (remove nil? [author])
                                :author-ids (remove nil? [author-id])}))))

(defn aggregate-reactions
  "
  Given a sequence of individual reaction interactions, collapse it down to a set of distinct reactions
  that include the count of how many times reacted and the list of author names and IDs that reacted.
  "
  [entry-reactions]
  (let [fixed-entry-reactions (conj (map #(assoc % :count 1) entry-reactions) {:reaction "👍" :count 0})
        collapsed-reactions (vals (reduce reaction-collapse {} fixed-entry-reactions))]
    (or collapsed-reactions [])))

Add default thumbup rection to every entry.


(ns exploud.info
  "## For grabbing information about the things we're dealing with"
  (:require [exploud
             [asgard :as asgard]
             [onix :as onix]
             [tyranitar :as tyr]]))

(defn applications
  "The list of applications Asgard knows about."
  []
  {:names (map :name (asgard/applications))})

(defn application
  "The information about a particular application."
  [region application-name]
  (if-let [full-application (asgard/application region application-name)]
    (merge {:name application-name}
           (select-keys (:app full-application)
                        [:description :email :owner]))))

(defn upsert-application
  "Upserts an application into Onix, Tyranitar and Asgard. This function can be
   run many times, it won't fail if the application is present in any of the
   stores."
  [region application-name details]
  (let [onix-application (onix/upsert-application application-name)
        tyranitar-application (tyr/upsert-application application-name)]
    (asgard/upsert-application application-name details)
    (merge (application region application-name) tyranitar-application)))

(ns exploud.info
  "## For grabbing information about the things we're dealing with"
  (:require [exploud
             [asgard :as asgard]
             [onix :as onix]
             [tyranitar :as tyr]]))

(defn applications
  "The list of applications Onix knows about."
  []
  {:names (map :name (onix/applications))})

(defn application
  "The information about a particular application."
  [region application-name]
  (if-let [full-application (asgard/application region application-name)]
    (merge {:name application-name}
           (select-keys (:app full-application)
                        [:description :email :owner]))))

(defn upsert-application
  "Upserts an application into Onix, Tyranitar and Asgard. This function can be
   run many times, it won't fail if the application is present in any of the
   stores."
  [region application-name details]
  (let [onix-application (onix/upsert-application application-name)
        tyranitar-application (tyr/upsert-application application-name)]
    (asgard/upsert-application application-name details)
    (merge (application region application-name) tyranitar-application)))

Make Exploud list the applications from Onix


(ns discuss.config)

(def project "discuss")

(def user "Q2hyaXN0aWFu")

(def api {:host  "http://localhost:4284/"
          :init  "api/elektroautos"
          :base  "api/"
          :login "api/login"
          :add   {:add-start-statement "api/add/start_statement"
                  :add-start-premise   "api/add/start_premise"
                  :add-justify-premise "api/add/justify_premise"}
          :get   {:references       "api/get/references"
                  :reference-usages "api/get/reference/usages"
                  :statements       "api/get/statements"
                  :statement-url    "api/get/statement/url"}})

(ns discuss.config)

(def project "discuss")

(def user "Q2hyaXN0aWFu")

(def api {:host  "http://localhost:4284/"
          :init  "api/cat-or-dog"
          :base  "api/"
          :login "api/login"
          :add   {:add-start-statement "api/add/start_statement"
                  :add-start-premise   "api/add/start_premise"
                  :add-justify-premise "api/add/justify_premise"}
          :get   {:references       "api/get/references"
                  :reference-usages "api/get/reference/usages"
                  :statements       "api/get/statements"
                  :statement-url    "api/get/statement/url"}})

Set default issue to an english one

Set default issue to an english one


(ns test-fb.handler
  (:require [ring.middleware.defaults :refer (wrap-defaults site-defaults secure-site-defaults)]
            [ring.util.response :refer (not-found response)]
            [taoensso.timbre :as log]
            [clojure.string :refer (trim blank?)]
            [clojure.java.io :as io]
            ))

(defn handler [request]
  (response "hello world"))

(def app
  (-> handler
      (wrap-defaults site-defaults)))

; TODO authentication
#_(def site
  (if-let [location (get-public-files-location)]
    (do
      (log/info "Serves files from" location)
      (-> handler
          (wrap-defaults
            (assoc site-defaults :static {:files (io/as-file (io/as-url location))}))))
    (do
      (log/error public-files-location-str "not specified")
      (System/exit 1))
    ))

(ns test-fb.handler
  (:require [ring.middleware.defaults :refer (wrap-defaults site-defaults secure-site-defaults)]
            [ring.util.response :refer (not-found response content-type)]
            [taoensso.timbre :as log]
            [clojure.string :refer (trim blank?)]
            [clojure.java.io :as io]
            ))

(defn handler [request]
  (->
    (response "hello world")
    (content-type "text/plain")
    ))

(def app
  (-> handler
      (wrap-defaults site-defaults)))

; TODO authentication
#_(def site
  (if-let [location (get-public-files-location)]
    (do
      (log/info "Serves files from" location)
      (-> handler
          (wrap-defaults
            (assoc site-defaults :static {:files (io/as-file (io/as-url location))}))))
    (do
      (log/error public-files-location-str "not specified")
      (System/exit 1))
    ))

Add content type to default route

Add content type to default route


(ns advent-2017.day-06
  (:require
   #?(:cljs [planck.core :refer [slurp read-string]])
   [#?(:clj clojure.java.io :cljs planck.io) :as io]
   [clojure.string :as str]))

(def input (-> "advent_2017/day_06/input" io/resource slurp))

(def data (as-> input x (str/trim x) (str/split x #"\t") (mapv read-string x)))

(defn redistribute [banks]
  (let [max-ndx     (.indexOf banks (apply max banks))
        target-ndxs (map #(mod (+ max-ndx 1 %) (count banks))
                      (range (banks max-ndx)))]
    (merge-with + (assoc banks max-ndx 0) (frequencies target-ndxs))))

(defn solve [banks]
  (reduce (fn [[last-seen banks] steps]
            (if (last-seen banks)
              (reduced [steps (last-seen banks)])
              [(assoc last-seen banks steps) (redistribute banks)]))
    [{} banks]
    (range)))

(defn part-1 []
  (first (solve data)))

(defn part-2 []
  (apply - (solve data)))

(ns advent-2017.day-06
  (:require
   #?(:cljs [planck.core :refer [slurp read-string]])
   [#?(:clj clojure.java.io :cljs planck.io) :as io]
   [clojure.string :as str]))

(def input (-> "advent_2017/day_06/input" io/resource slurp))

(def data (as-> input x (str/trim x) (str/split x #"\t") (mapv read-string x)))

(defn redistribute [banks]
  (let [max-val     (apply max (vals banks))
        max-ndx     (apply min (keep (fn [[k v]] (when (= max-val v) k)) banks))
        target-ndxs (map #(mod (+ max-ndx 1 %) (count banks))
                      (range (banks max-ndx)))]
    (merge-with + (assoc banks max-ndx 0) (frequencies target-ndxs))))

(defn solve [banks]
  (reduce (fn [[last-seen banks] steps]
            (if (last-seen banks)
              (reduced [steps (last-seen banks)])
              [(assoc last-seen banks steps) (redistribute banks)]))
    [{} (zipmap (range) banks)]
    (range)))

(defn part-1 []
  (first (solve data)))

(defn part-2 []
  (apply - (solve data)))

Work in terms of maps so merge-with use is correct


(ns rabbitmq.tutorials.emit-log-direct
  (:require [langohr.core :as lc]
            [langohr.channel :as lch]
            [langohr.exchange :as le]
            [langohr.basic :as lb]
            [clojure.string :as s]))

(def ^{:const true} x "direct_logs")

(defn -main
  [severity & args]
  (with-open [conn (lc/connect)]
    (let [ch      (lch/open conn)
          payload (if (empty? args)
                    "Hello, world!"
                    (s/join " " args))]
      (le/direct ch x :durable false :auto-delete false)
      (lb/publish ch x severity payload)
      (println (format " [x] Sent %s" payload)))))

(ns rabbitmq.tutorials.emit-log-direct
  (:require [langohr.core :as lc]
            [langohr.channel :as lch]
            [langohr.exchange :as le]
            [langohr.basic :as lb]
            [clojure.string :as s]))

(def ^{:const true} x "direct_logs")

(defn -main
  [severity & args]
  (with-open [conn (lc/connect)]
    (let [ch      (lch/open conn)
          severity (or severity "info")
          payload  (if (empty? args)
                     "Hello, world!"
                     (s/join " " args))]
      (le/direct ch x :durable false :auto-delete false)
      (lb/publish ch x severity payload)
      (println (format " [x] Sent %s" payload)))))

Use the same default as Ruby example

Use the same default as Ruby example


(ns github-changelog.util
  (:require [clojure.string :refer [join ends-with?]]))

(defn str-map [f & sqs] (join (apply map f sqs)))

(defn extract-params [query-string]
  (into {} (for [[_ k v] (re-seq #"([^&=]+)=([^&]+)" query-string)]
             [(keyword k) v])))

(defn strip-trailing
  ([s] (strip-trailing s "/"))
  ([s end]
   (if (ends-with? s end)
     (recur (join (butlast s)) end)
     s)))

(ns github-changelog.util
  (:require [clojure.string :refer [join ends-with?]]))

(defn str-map [f & sqs] (join (apply map f sqs)))

(defn extract-params [query-string]
  (into {} (for [[_ k v] (re-seq #"([^&=]+)=([^&]+)" query-string)]
             [(keyword k) v])))

(defn strip-trailing
  ([s] (strip-trailing s "/"))
  ([s end]
   (if (ends-with? s end)
     (recur (join (drop-last s)) end)
     s)))

Use the lazy version instead

Use the lazy version instead


(defproject clstreams "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"]
                 [org.apache.kafka/kafka-clients "0.10.1.0"]
                 [org.apache.kafka/kafka-streams "0.10.1.0"]]

  :main ^:skip-aot clstreams.core
  :target-path "target/%s"

  :profiles {:uberjar {:aot :all}})

(defproject clstreams "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"]
                 [org.clojure/tools.namespace "0.3.0-alpha3"]

                 [org.apache.kafka/kafka-clients "0.10.1.0"]
                 [org.apache.kafka/kafka-streams "0.10.1.0"]]

  :main ^:skip-aot clstreams.core
  :target-path "target/%s"

  :profiles {:uberjar {:aot :all}})

Add tools.namespace to the dependencies.


(ns user
  "A dev namespace that supports Proto-REPL.

  It seems that Proto-REPL doesn't support the flexible approach that lein
  uses: any configurable ns can be the starting ns for a REPL. As such, this
  minimal ns was created for Proto-REPL users, so they too can have an env
  that supports startup and shutdown."
  (:require
   [cheshire.core :as json]
   [clojure.java.io :as io]
   [clojure.pprint :refer [pprint]]
   [clojure.tools.namespace.repl :as repl]
   [clojusc.system-manager.core :refer :all]
   [cmr.opendap.dev :as dev]
   [org.httpkit.client :as httpc]))

(ns user
  "A dev namespace that supports Proto-REPL.

  It seems that Proto-REPL doesn't support the flexible approach that lein
  uses: any configurable ns can be the starting ns for a REPL. As such, this
  minimal ns was created for Proto-REPL users, so they too can have an env
  that supports startup and shutdown."
  (:require
   [cheshire.core :as json]
   [clojure.java.io :as io]
   [clojure.pprint :refer [pprint]]
   [clojure.tools.namespace.repl :as repl]
   [clojusc.system-manager.core :refer :all]
   [clojusc.twig :as logger]
   [cmr.opendap.dev :as dev]
   [org.httpkit.client :as httpc]))

(logger/set-level! '[cmr org.httpkit] :trace logger/no-color-log-formatter)

CMR-5131: Determine OPeNDAP URL based on tag association data for a collection.


;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>

(ns uxbox.repo.projects
  "A main interface for access to remote resources."
  (:refer-clojure :exclude [do])
  (:require [httpurr.client.xhr :as http]
            [httpurr.status :as http.status]
            [promesa.core :as p :include-macros true]
            [beicon.core :as rx]
            [uxbox.repo.core :as urc]
            [uxbox.state :as ust]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Login
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defmethod urc/-do :fetch/projects
  [type data]
  (urc/req! {:url (str urc/+uri+ "/projects") :method :get}))

(defmethod urc/-do :fetch/pages
  [type data]
  (urc/req! {:url (str urc/+uri+ "/pages") :method :get}))

(defmethod urc/-do :create/page
  [type {:keys [id] :as data}]
  (let [params {:url (str urc/+uri+ "/pages")
                :method :post
                :body data}]
    (urc/req! params)))

(defmethod urc/-do :update/page
  [type {:keys [id] :as data}]
  (let [params {:url (str urc/+uri+ "/pages/" id)
                :method :put
                :body data}]
    (urc/req! params)))

Add page create and update repo methods.


(ns pot.core.act
  (:require-macros [cljs.core.async.macros :refer [go alt!]])
  (:require [cljs.reader :refer [read-string]]
            [pot.core.hand :refer [move-handler undo-handler state-watcher history-watcher]]))

(def ^:private msg-handler-map
  {:move      move-handler
   :undo      undo-handler})

(defn- process-msg
  [{action-key :msg :as msg} state history]
  (let [{action-handler action-key} msg-handler-map]
    (action-handler msg state history)))

(defn listen-channels
  [state history {:keys [actions]}]
  (go (while true
        (alt!
          actions ([msg] (process-msg msg state history))))))

(defn watch-changes
  [state history storage]
  (add-watch state :state-watcher (state-watcher state history))
  (add-watch history :history-watcher (history-watcher storage :history)))

(defn restore-state
  [state history storage]
  (when-let [stored-history (.get storage :history)]
    (when-let [restored-history (read-string stored-history)]
      (when-let [restored-state (get-in restored-history [:snapshots (:cursor restored-history)])]
        (reset! state restored-state))
      (reset! history restored-history))))

(ns pot.core.act
  (:require-macros [cljs.core.async.macros :refer [go alt!]])
  (:require [cljs.reader :refer [read-string]]
            [pot.core.hand :refer [move-handler undo-handler state-watcher history-watcher]]))

(def ^:private msg-handler-map
  {:move      move-handler
   :undo      undo-handler})

(defn- process-msg
  [{action-key :msg :as msg} state history]
  (let [{action-handler action-key} msg-handler-map]
    (when action-handler
      (action-handler msg state history))))

(defn listen-channels
  [state history {:keys [actions]}]
  (go (while true
        (alt!
          actions ([msg] (process-msg msg state history))))))

(defn watch-changes
  [state history storage]
  (add-watch state :state-watcher (state-watcher state history))
  (add-watch history :history-watcher (history-watcher storage :history)))

(defn restore-state
  [state history storage]
  (when-let [stored-history (.get storage :history)]
    (when-let [restored-history (read-string stored-history)]
      (when-let [restored-state (get-in restored-history [:snapshots (:cursor restored-history)])]
        (reset! state restored-state))
      (reset! history restored-history))))

Check handler before call it

Check handler before call it


#!/usr/bin/env boot

#tailrecursion.boot.core/version "2.3.1"

(set-env!
  :dependencies  [['tailrecursion/boot.task   "2.1.2"]
                  ['tailrecursion/hoplon      "5.7.0"]
                  ['markdown-clj              "0.9.41"]
                  ['org.clojure/clojurescript "0.0-2156"]]
  :src-paths     #{"src"}
  :out-path      "resources/public")

(add-sync! (get-env :out-path) #{"resources/assets"})

(require
  ['tailrecursion.boot.task   :refer :all]
  ['tailrecursion.hoplon.boot :refer :all])

(deftask dev
  "Build hoplon.io for local development."
  []
  (comp (watch) (hoplon {:pretty-print  true
                         :prerender     false
                         :optimizations :whitespace})))

(deftask prod
  "Build hoplon.io for production deployment."
  []
  (hoplon {:optimizations :advanced}))

#!/usr/bin/env boot

#tailrecursion.boot.core/version "2.3.1"

(set-env!
  :dependencies  '[[tailrecursion/boot.task   "2.1.2"]
                   [tailrecursion/hoplon      "5.7.0"]
                   [markdown-clj              "0.9.41"]
                   [tailrecursion/boot.ring   "0.1.0-SNAPSHOT"]
                   [org.clojure/clojurescript "0.0-2156"]]
  :src-paths     #{"src"}
  :out-path      "resources/public")

(add-sync! (get-env :out-path) #{"resources/assets"})

(require
  '[tailrecursion.boot.task   :refer :all]
  '[tailrecursion.boot.task.ring   :refer [dev-server]]
  '[tailrecursion.hoplon.boot :refer :all])

(deftask dev
  "Build hoplon.io for local development."
  []
  (comp (watch) (hoplon {:pretty-print  true
                         :prerender     false
                         :optimizations :whitespace}) (dev-server)))

(deftask prod
  "Build hoplon.io for production deployment."
  []
  (hoplon {:optimizations :advanced}))

Add dev-server to stop Hyphenator errors


{:user {:dependencies [[clj-stacktrace "0.2.5"]
                       [spyscope "0.1.0"]
                       [limit-break "0.1.0-SNAPSHOT"]]
        :plugins [[lein-difftest "1.3.7"]
                  [lein-drip "0.1.1-SNAPSHOT"]
                  [lein-clojars "0.9.1"]
                  [lein-pprint "1.1.1"]
                  [lein-ring "0.8.0"]
                  [slamhound "1.3.1"]
                  [lein-cljsbuild "0.1.9"]
                  [lein-deps-tree "0.1.2"]
                  [lein-marginalia "0.7.1"]]
        :repl-options {:timeout 120000}
        :injections [(let [orig (ns-resolve (doto 'clojure.stacktrace require)
                                            'print-cause-trace)
                           new (ns-resolve (doto 'clj-stacktrace.repl require)
                                           'pst)]
                       (alter-var-root orig (constantly @new)))]
        :vimclojure-opts {:repl true}}}

{:user {:dependencies [[clj-stacktrace "0.2.5"]
                       [spyscope "0.1.2"]
                       [limit-break "0.1.0-SNAPSHOT"]]
        :plugins [[lein-difftest "1.3.7"]
                  [lein-drip "0.1.1-SNAPSHOT"]
                  [lein-clojars "0.9.1"]
                  [lein-pprint "1.1.1"]
                  [lein-ring "0.8.0"]
                  [slamhound "1.3.1"]
                  [lein-cljsbuild "0.1.9"]
                  [lein-deps-tree "0.1.2"]
                  [lein-marginalia "0.7.1"]]
        :repl-options {:timeout 120000}
        :injections [(require 'spyscope.core)
                     (let [orig (ns-resolve (doto 'clojure.stacktrace require)
                                            'print-cause-trace)
                           new (ns-resolve (doto 'clj-stacktrace.repl require)
                                           'pst)]
                       (alter-var-root orig (constantly @new)))]
        :vimclojure-opts {:repl true}}}

Fix spyscope dependency. Add its injection.


(ns
  ^{:doc

  "Dispatching Input Events of a SimRunner Application."

    :author "Frank Mosebach"}
  fm.simrunner.input
  (:require
    [fm.simrunner.config :as cfg]))

(defmulti on-input {:private true} (fn [id & _] id))

(defmethod on-input :default [id app & args]
  (println (format "on-input{id: %s args: %s}" id args)))

(defn- handle-input? [{app-state :state}]
  (let [{ui :ui} @app-state]
    (and (not (:locked? ui))
         (not (:rendering? ui)))))

(defn dispatch [id app args]
  (when (handle-input? app)
    (apply on-input id app args)))

(ns
  ^{:doc

  "Dispatching Input Events of a SimRunner Application."

    :author "Frank Mosebach"}
  fm.simrunner.input
  (:require
    [fm.simrunner.config :as cfg]))

(defn- value->param [id value]
  (if (= :calc-err id)
    (if value "1" "0")
    (str value)))

(defn- update-values [app-state id value]
  (assoc-in app-state [:ui :model :values id] value))

(defn- update-config [app-state id value]
  (let [config (-> (get-in app-state [:model :config])
                   (cfg/with-value id (value->param id value)))]
    (-> app-state
        (assoc-in [:model :config] config)
        (assoc-in [:model :changed?] true)
        (assoc-in [:model :valid?] (cfg/complete? config)))))

(defn- on-input [id {app-state :state} & [widget value :as args]]
  (println (format "on-input{id: %s value: %s}" id value))
  (swap! app-state
         (fn [app-state]
           (-> app-state
               (update-values id value)
               (update-config id value)))))

(defn- handle-input? [{app-state :state}]
  (let [{ui :ui} @app-state]
    (and (not (:locked? ui))
         (not (:rendering? ui)))))

(defn dispatch [id app args]
  (when (handle-input? app)
    (apply on-input id app args)))

Update the app's model according to incoming events.


;; https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
{:user
 {:plugins
  [[cider/cider-nrepl "0.27.2"]
   [lein-ancient "1.0.0-RC3"]
   [lein-check-namespace-decls "1.0.4"]
   [lein-cljfmt "0.8.0"]
   [lein-nsorg "0.3.0"]
   [nrepl "0.9.0-beta3"]
   [refactor-nrepl "3.0.0-alpha13"]]}
  :dependencies
   [#_[alembic "0.3.2"]
    [clj-kondo "RELEASE"]
    [antq "RELEASE"]
    [vvvvalvalval/scope-capture "0.3.2"]]
  :injections [(require 'sc.api)]
  :aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"]
            "outdated"  ["run" "-m" "antq.core"]}}

;; https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
{:user
 {:plugins
  [[cider/cider-nrepl "0.27.4"]
   [lein-ancient "1.0.0-RC3"]
   [lein-check-namespace-decls "1.0.4"]
   [lein-cljfmt "0.8.0"]
   [lein-nsorg "0.3.0"]
   [nrepl "0.9.0"]
   [refactor-nrepl "3.1.0"]]}
  :dependencies
   [#_[alembic "0.3.2"]
    [clj-kondo "RELEASE"]
    [antq "RELEASE"]
    [vvvvalvalval/scope-capture "0.3.2"]]
  :injections [(require 'sc.api)]
  :aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"]
            "outdated"  ["run" "-m" "antq.core"]}}

Update config for Clojure projects

Update config for Clojure projects


(ns cmr.common.test.cache
  (:require [clojure.test :refer :all]
            [cmr.common.cache :as c]))

(def counter (atom 0))

(defn increment-counter
  "Increments the counter atom and returns it"
  []
  (swap! counter inc))

(deftest cache-test
  (testing "cache hit, miss and reset"
    (let [cache-atom (c/create-cache)]
      (is (= 1 (c/cache-lookup cache-atom "key" increment-counter)))
      ;; look up again will not call the increment-counter function
      (is (= 1 (c/cache-lookup cache-atom "key" increment-counter)))
      (c/reset-cache cache-atom)
      (is (= 2 (c/cache-lookup cache-atom "key" increment-counter)))
      (is (= 2 (c/cache-lookup cache-atom "key" increment-counter))))))

(ns cmr.common.test.cache
  (:require [clojure.test :refer :all]
            [cmr.common.cache :as c]))

(def counter (atom 0))

(defn increment-counter
  "Increments the counter atom and returns it"
  []
  (swap! counter inc))

(deftest cache-test
  (testing "cache hit, miss and reset"
    (let [cache-atom (c/create-cache)]
      (reset! counter 0)
      (is (= 1 (c/cache-lookup cache-atom "key" increment-counter)))
      ;; look up again will not call the increment-counter function
      (is (= 1 (c/cache-lookup cache-atom "key" increment-counter)))
      (c/reset-cache cache-atom)
      (is (= 2 (c/cache-lookup cache-atom "key" increment-counter)))
      (is (= 2 (c/cache-lookup cache-atom "key" increment-counter))))))

Reset counter so the test can be run multiple times in repl.


(ns pro.juxt.edge.doc-site
  (:require
    [integrant.core :as ig]
    [clojure.java.io :as io]
    [edge.asciidoctor :refer [load-doc]]
    [yada.yada :as yada]))

(defn routes [engine]
  [["" (merge
         (yada/redirect ::doc-resource {:route-params {:name "index"}})
         {:id ::doc-index})]
   [[:name ".html"]
    (yada/resource
      {:id ::doc-resource
       :methods
       {:get
        {:produces [{:media-type "text/html;q=0.8" :charset "utf-8"}
                    {:media-type "application/json"}]
         :response (fn [ctx]
                     (let [path (str "doc/sources/" (-> ctx :parameters :path :name) ".adoc")]
                       (try
                         (.convert
                           (load-doc
                             ctx
                             engine
                             (-> ctx :parameters :path :name)
                             (slurp (io/resource path))))
                         (catch Exception e
                           (throw (ex-info (format "Failed to convert %s" path)
                                           {:path path} e))))))}}})]])

(defmethod ig/init-key ::routes [_ {:keys [edge.asciidoctor/engine]}]
  (routes engine))

(ns pro.juxt.edge.doc-site
  (:require
    [integrant.core :as ig]
    [clojure.java.io :as io]
    [edge.asciidoctor :refer [load-doc]]
    [yada.yada :as yada]))

(defn routes [engine]
  [["" (merge
         (yada/redirect ::doc-resource {:route-params {:name "index"}})
         {:id ::doc-index})]
   [[;; regex derived from bidi's default, but adding / to allow directories
     [#"[A-Za-z0-9\\-\\_\\.\/]+" :name] ".html"]
    (yada/resource
      {:id ::doc-resource
       :methods
       {:get
        {:produces [{:media-type "text/html;q=0.8" :charset "utf-8"}
                    {:media-type "application/json"}]
         :response (fn [ctx]
                     (let [path (str "doc/sources/" (-> ctx :parameters :path :name) ".adoc")]
                       (try
                         (.convert
                           (load-doc
                             ctx
                             engine
                             (-> ctx :parameters :path :name)
                             (slurp (io/resource path))))
                         (catch Exception e
                           (throw (ex-info (format "Failed to convert %s" path)
                                           {:path path} e))))))}}})]])

(defmethod ig/init-key ::routes [_ {:keys [edge.asciidoctor/engine]}]
  (routes engine))

Add support for nested directories to doc-site


(ns klangmeister.processing
  (:require
    [klangmeister.eval :as eval]
    [klangmeister.music :as music]
    [klangmeister.instruments :as instrument]
    [klangmeister.actions :as action]
    [klangmeister.framework :as framework]
    [cljs.js :as cljs]))

(extend-protocol framework/Action
  action/Refresh
  (process [{expr-str :text} _ {original-music :music :as state}]
    (let [{:keys [value error]} (eval/uate expr-str)
          music (or value original-music)]
      (-> state
          (assoc :error error)
          (assoc :text expr-str)
          (assoc :music music))))

  action/Stop
  (process [_ handle! state]
    (assoc state :looping? false))

  action/Play
  (process [this handle! state]
    (framework/process (action/->Loop) handle! (assoc state :looping? true)))

  action/Loop
  (process [this handle! {notes :music :as state}]
    (when (:looping? state)
      (music/play-on! instrument/beep! notes)
      (let [duration (->> notes (map :duration) (reduce +) (* 1000))]
        (js/setTimeout #(handle! this) duration)))
    state))

(ns klangmeister.processing
  (:require
    [klangmeister.eval :as eval]
    [klangmeister.music :as music]
    [klangmeister.instruments :as instrument]
    [klangmeister.actions :as action]
    [klangmeister.framework :as framework]
    [cljs.js :as cljs]))

(extend-protocol framework/Action
  action/Refresh
  (process [{expr-str :text} _ {original-music :music :as state}]
    (let [{:keys [value error]} (eval/uate expr-str)
          music (or value original-music)]
      (-> state
          (assoc :error error)
          (assoc :text expr-str)
          (assoc :music music))))

  action/Stop
  (process [_ handle! state]
    (assoc state :looping? false))

  action/Play
  (process [this handle! state]
    (framework/process (action/->Loop) handle! (assoc state :looping? true)))

  action/Loop
  (process [this handle! {notes :music :as state}]
    (when (:looping? state)
      (music/play-on! instrument/beep! notes)
      (let [duration (->> notes
                          (map (fn [{:keys [time duration]}] (+ time duration)))
                          (apply max)
                          (* 1000))]
        (js/setTimeout #(handle! this) duration)))
    state))

Adjust duration calculation for polyphony.


(ns onyx.peer.log-version)

(def version "0.10.0-SNAPSHOT")

(defn check-compatible-log-versions! [cluster-version]
  (when-not (or (re-find #"-SNAPSHOT" version)
                 (= version cluster-version))
    (throw (ex-info "Incompatible versions of the Onyx cluster coordination log.
                     A new, distinct, :onyx/tenancy-id should be supplied when upgrading or downgrading Onyx."
                    {:cluster-version cluster-version
                     :peer-version version}))))

(ns onyx.peer.log-version)

(def version "0.10.0-SNAPSHOT")

(defn check-compatible-log-versions! [cluster-version]
  (when-not (or (re-find #"-" version)
                 (= version cluster-version))
    (throw (ex-info "Incompatible versions of the Onyx cluster coordination log.
                     A new, distinct, :onyx/tenancy-id should be supplied when upgrading or downgrading Onyx."
                    {:cluster-version cluster-version
                     :peer-version version}))))

Revert "Make alpha/beta/etc versions incompatible with each other."

This reverts commit ae9cd69e738069965b2a97784bb7b7fd833be8b6.


(ns scrape-summitpost-data.extract-result-links-test
  (:require [clojure.string :as string]
            [clojure.test :refer [deftest is]]
            [scrape-summitpost-data.extract-result-links :as test-ns]))

(defn- make-test-page
  [url]
  (let [template "

"]
    (string/replace template "{}" url)))

(deftest extract-result-links-test
  (let [page (make-test-page "/test-item-name/12345")]
    (is (= ["/test-item-name/12345"]
           (test-ns/extract-result-links page))
        "extracts link to item from search results table")))

(ns scrape-summitpost-data.extract-result-links-test
  (:require [clojure.string :as string]
            [clojure.test :refer [deftest is]]
            [scrape-summitpost-data.extract-result-links :as test-ns]))

(defn- make-test-page
  [urls]
  (let [header "

"
        row-template "

"
        footer "

"
        rows (mapv #(string/replace row-template "{}" %) urls)
        page (conj (cons header rows) footer)]
    (apply str page)))

(deftest extract-result-links-test
  (let [urls ["/test1"]]
    (is (= urls
           (test-ns/extract-result-links (make-test-page urls)))
        "extracts single link from search results table"))
  (let [urls ["/test1" "/test2" "/test3"]]
    (is (= urls
           (test-ns/extract-result-links (make-test-page urls)))
        "extracts multiple links from search results table")))

Improve make-test-page to allow multiple urls and add multiple url test for extract-result-links.


(ns kanban.components.boards-menu
  (:require [goog.object :as gobj]
            [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]))

(defui BoardMenuItem
  static om/Ident
  (ident [this props]
    [:board/by-id (:id props)])
  static om/IQuery
  (query [this]
    [:id :name])
  Object
  (render [this]
    (dom/li nil
      (let [{:keys [name activate-fn]} (om/props this)]
        (dom/a #js {:onClick #(activate-fn (om/get-ident this))}
          name)))))

(def board-menu-item (om/factory BoardMenuItem {:keyfn :id}))

(defui BoardsMenu
  Object
  (render [this]
    (dom/div #js {:className "header-menu"}
      (dom/a nil "Boards")
      (dom/ul nil
        (let [{:keys [boards activate-fn]} (om/props this)]
          (for [board boards]
            (board-menu-item
              (assoc board :activate-fn activate-fn))))))))

(def boards-menu (om/factory BoardsMenu))

(ns kanban.components.boards-menu
  (:require [goog.object :as gobj]
            [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]))

(defui BoardMenuItem
  static om/Ident
  (ident [this props]
    [:board/by-id (:id props)])
  static om/IQuery
  (query [this]
    [:id :name])
  Object
  (render [this]
    (dom/li nil
      (let [{:keys [name activate-fn]} (om/props this)]
        (dom/a #js {:onClick #(activate-fn (om/get-ident this))}
          name)))))

(def board-menu-item (om/factory BoardMenuItem {:keyfn :id}))

(defui BoardsMenu
  Object
  (render [this]
    (dom/div #js {:className "header-menu"}
      (dom/a nil "▾ Boards")
      (dom/ul nil
        (let [{:keys [boards activate-fn]} (om/props this)]
          (for [board boards]
            (board-menu-item
              (assoc board :activate-fn activate-fn))))))))

(def boards-menu (om/factory BoardsMenu))

Add a triangle symbol to the board menu to make its purpose obvious


(defproject exegesis "0.2.0-SNAPSHOT"
  :description "Simplify reflection of annotations on Java types."
  :url "http://github.com/tobyclemson/exegesis"
  :license {:name "The MIT License"
            :url  "https://opensource.org/licenses/MIT"}
  :dependencies [[org.clojure/clojure "1.8.0"]]
  :source-paths ["src/clojure"]
  :test-paths ["test/clojure"]
  :java-source-paths ["src/java" "test/java"])

(defproject exegesis "0.2.0-SNAPSHOT"
  :description "Simplify reflection of annotations on Java types."
  :url "http://github.com/tobyclemson/exegesis"
  :license {:name "The MIT License"
            :url  "https://opensource.org/licenses/MIT"}
  :dependencies [[org.clojure/clojure "1.8.0"]]
  :source-paths ["src/clojure"]
  :test-paths ["test/clojure"]
  :java-source-paths ["src/java" "test/java"]
  :deploy-repositories [["releases" {:url     "https://clojars.org/repo/"
                                     :creds   :gpg}]])

Use GPG lookup for clojars credentials.

Use GPG lookup for clojars credentials.


(defproject lein-xjc "0.1.0-SNAPSHOT"
  :description "Call xjc from leiningen."
  :url "http://lein-xjc.ferdinandhofherr.de"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :eval-in-leiningen true)

(defproject lein-xjc "0.1.0-SNAPSHOT"
  :description "Call xjc from leiningen."
  :url "http://lein-xjc.ferdinandhofherr.de"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :eval-in-leiningen true
  :profiles {:dev {:source-paths ["dev"]
                   :dependencies [[midje "1.6.0"]
                                  [cljito "0.2.1"]
                                  [org.mockito/mockito-all "1.9.5"]]
                   :plugins [[lein-midje "3.1.3"]]}})

Add dependency to cljito and mockito.

Add dependency to cljito and mockito.


(defproject onyx-app/lein-template "0.10.0.0-beta4"
  :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.10.0.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 inet.data "0.5.0-SNAPSHOT"
  :description "Represent and manipulate various Internet entities as data."
  :url "http://github.com/llasram/inet.data"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [hier-set "1.1.2"]]
  :plugins [[lein-ragel "0.1.0"]]
  :source-paths ["src/clojure"]
  :java-source-paths ["src/java" "target/ragel"]
  :ragel-source-paths ["src/ragel"]
  :javac-options ["-g"]
  :prep-tasks [ragel javac]
  :warn-on-reflection true
  :profiles {:dev {:dependencies [[byteable "0.2.0"]
                                  [criterium "0.2.1"]]}})

(defproject inet.data "0.5.0-SNAPSHOT"
  :description "Represent and manipulate various Internet entities as data."
  :url "http://github.com/llasram/inet.data"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [hier-set "1.1.2"]]
  :plugins [[lein-ragel "0.1.0"]]
  :source-paths ["src/clojure"]
  :java-source-paths ["src/java" "target/ragel"]
  :ragel-source-paths ["src/ragel"]
  :javac-options ["-g"]
  :prep-tasks ["ragel" "javac"]
  :warn-on-reflection true
  :profiles {:dev {:dependencies [[byteable "0.2.0"]
                                  [criterium "0.2.1"]]}})

Update :prep-tasks for most recent lein.


(defproject onyx-app/lein-template "0.8.11.9"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :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}}
  :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.8.11.10-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :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}}
  :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 com.hypirion/bencode "0.1.0-SNAPSHOT"
  :description "Java implementation Bencode."
  :url "https://github.com/hyPiRion/java-bencode"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies []
  :source-paths []
  :java-source-paths ["src"]
  :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
  :scm {:dir ".."}
  :aliases {"javadoc" ["shell" "javadoc" "-d" "javadoc/${:version}"
                       "-sourcepath" "src" "com.hypirion.bencode"
                       "-link" "http://docs.oracle.com/javase/8/docs/api/"]}
  :plugins [[lein-shell "0.5.0"]]
  :profiles {:uberjar {:aot :all}
             :dev {:dependencies [[org.clojure/clojure "1.8.0"]
                                  [org.clojure/test.check "0.9.0"]]}})

(defproject com.hypirion/bencode "0.1.0-SNAPSHOT"
  :description "Java implementation of Bencode."
  :url "https://github.com/hyPiRion/java-bencode"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :deploy-repositories [["releases" :clojars]]
  :dependencies []
  :source-paths []
  :java-source-paths ["src"]
  :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
  :scm {:dir ".."}
  :aliases {"javadoc" ["shell" "javadoc" "-d" "javadoc/${:version}"
                       "-sourcepath" "src" "com.hypirion.bencode"
                       "-link" "http://docs.oracle.com/javase/8/docs/api/"]}
  :plugins [[lein-shell "0.5.0"]]
  :profiles {:uberjar {:aot :all}
             :dev {:dependencies [[org.clojure/clojure "1.8.0"]
                                  [org.clojure/test.check "0.9.0"]]}})

Use Clojars as default deploy repository


(defproject sqls "0.1.0-SNAPSHOT"
  :description "SQLS"
  :url "https://github.com/mpietrzak/sqls"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [
                 [org.clojure/clojure "1.6.0"]
                 [org.clojure/data.json "0.2.4"]
                 [org.clojure/java.jdbc "0.3.3"]
                 [org.clojure/tools.logging "0.2.6"]
                 [org.xerial/sqlite-jdbc "3.7.2"]
                 [seesaw "1.4.4"]
                 ]
  :main sqls.core
  :java-source-paths ["src"]
  :target-path "target/%s"
  :plugins [[codox "0.6.7"]
            [lein-ancient "0.5.5"]]
  :codox {:output-dir "doc/codox"}
  :profiles {:uberjar {:aot :all}}
  :jvm-opts ["-Xms4M" "-Xmx1G" "-XX:-PrintGC"])
  :profiles {:uberjar {:aot :all}
             :dev {:global-vars {*warn-on-reflection* true}}}

(defproject sqls "0.1.0-SNAPSHOT"
  :description "SQLS"
  :url "https://github.com/mpietrzak/sqls"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [
                 [org.clojure/clojure "1.6.0"]
                 [org.clojure/data.json "0.2.5"]
                 [org.clojure/java.jdbc "0.3.4"]
                 [org.clojure/tools.logging "0.3.0"]
                 [org.xerial/sqlite-jdbc "3.7.2"]
                 [seesaw "1.4.4"]
                 ]
  :main sqls.core
  :java-source-paths ["src"]
  :target-path "target/%s"
  :plugins [[codox "0.8.10"]
            [lein-ancient "0.5.5"]]
  :codox {:output-dir "doc/codox"}
  :profiles {:uberjar {:aot :all}
             :dev {:global-vars {*warn-on-reflection* true}
                   :jvm-opts ["-Xms4M" "-Xmx1G" "-XX:+PrintGC" "-XX:+UseG1GC"]}})

Update dependencies and move gc logging options to dev profile


(ns scavenger.core
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]
            [ring.util.response :refer [header content-type response resource-response]])
  (:use [datomic.api :only [db q] :as d]))

(def uri "datomic:free://localhost:4334/items")

(def conn (d/connect uri))

(defn get-all-items []
  (map first (q '[:find (pull ?c [*]) :where [?c item/name]] (db conn))))

(defroutes app-routes
  (GET "/items" []
    (response (str (into [] (get-all-items)))))
  (POST "/items" {body :body}
    (let [tempid (d/tempid :items)
          data (merge (read-string (slurp body)) {:db/id tempid})
          tx @(d/transact conn [data])
          id (d/resolve-tempid (db conn) (:tempids tx) tempid)]
      (response (str (d/touch (d/entity (db conn) id))))))
  (GET "/" []
    (-> (resource-response "index.html" {:root "public"})
        (content-type "text/html")))
  (route/not-found "Page not found"))

(def app
  (wrap-defaults app-routes (assoc site-defaults :security nil)))

(ns scavenger.core
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]
            [ring.util.response :refer [header content-type response resource-response]])
  (:use [datomic.api :only [db q] :as d]))

(def uri "datomic:free://localhost:4334/items")

(def conn (d/connect uri))

(defn get-all-items []
  (map first (q '[:find (pull ?c [*]) :where [?c item/name]] (db conn))))

(defn generate-response [data & [status]]
  {:status (or status 200)
   :headers {"Content-Type" "application/edn"}
   :body (pr-str data)})

(defroutes app-routes
  (GET "/items" []
    (generate-response (into [] (get-all-items))))
  (POST "/items" {body :body}
    (let [tempid (d/tempid :items)
          data (merge (read-string (slurp body)) {:db/id tempid})
          tx @(d/transact conn [data])
          id (d/resolve-tempid (db conn) (:tempids tx) tempid)]
      (generate-response (d/touch (d/entity (db conn) id)))))
  (GET "/" []
    (-> (resource-response "index.html" {:root "public"})
        (content-type "text/html")))
  (route/not-found "Page not found"))

(def app
  (wrap-defaults app-routes (assoc site-defaults :security nil)))

Add helper for generating a server response

Add a helper for generating a server response with the correct
Content-Type and a reasonable status code.


(ns silly-image-store.store
  (:require [clojure.java.io :as io]))

(def exists? #(and % (.exists %)))
(def file? #(.isFile %))
(def filename #(.getName %))

(defn load-image [& paths]
  (let [file (apply io/file paths)]
    (if (exists? file) file nil)))

(defn list-images [& paths]
  (let [image-directory (apply load-image paths)]
    (if (exists? image-directory)
      (->> image-directory
       .listFiles
       (filter file?)
       (map filename))
      nil)))

(defn random-image [basedir]
  (let [random-image-name (rand-nth (list-images basedir))]
    (load-image basedir random-image-name)))

(ns silly-image-store.store
  (:require [clojure.java.io :as io]))

(def exists? #(and % (.exists %)))
(def file? #(.isFile %))
(def filename #(.getName %))

(defn load-image [& paths]
  (let [file (apply io/file paths)]
    (if (exists? file) file)))

(defn list-images [& paths]
  (let [image-directory (apply load-image paths)]
    (if (exists? image-directory)
      (->> image-directory
       .listFiles
       (filter file?)
       (map filename)))))

(defn random-image [basedir]
  (let [random-image-name (rand-nth (list-images basedir))]
    (load-image basedir random-image-name)))

Remove nils as it's redundnnat

Remove nils as it's redundnnat


{:user {
        :plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]
                  [jonase/eastwood "0.2.3"]
                  [lein-kibit "0.1.2"]
                  [lein-typed "0.3.5"]
                  ]
        :dependencies [[org.clojure/clojure "1.8.0"]
                       [com.datomic/datomic-free "0.9.5350"]
                       [me.raynes/fs "1.4.6"]
                       ;; Consider using typed? [org.clojure/core.typed "0.3.22"]
                       ]
        }}

{:user {
        :plugins [[cider/cider-nrepl "0.11.0"]
                  [jonase/eastwood "0.2.3"]
                  [lein-kibit "0.1.2"]
                  [lein-typed "0.3.5"]
                  ]
        :dependencies [[org.clojure/clojure "1.8.0"]
                       [datomic-schema-grapher "0.0.1"]
                       [com.datomic/datomic-pro "0.9.5350"]
                       [me.raynes/fs "1.4.6"]
                       [clj-stacktrace "0.2.8"]
                       ;; Consider using typed? [org.clojure/core.typed "0.3.22"]
                       ]
        }}

Add clj-stacktrace to global lein deps.

Add clj-stacktrace to global lein deps.


Add another interesting transit example

Add another interesting transit example


(ns cmr.search.services.xslt
  "Provides functions for invoking xsl on metadata."
  (:require [clojure.java.io :as io]
            [cmr.common.cache :as cache])
  (:import javax.xml.transform.TransformerFactory
           java.io.StringReader
           java.io.StringWriter
           javax.xml.transform.stream.StreamSource
           javax.xml.transform.stream.StreamResult))

(def xsl-transformer-cache-name
  :xsl-transformers)

(defn context->xsl-transformer-cache
  [context]
  (get-in context [:system :caches xsl-transformer-cache-name]))

(defn- xsl->transformer
  "Returns the xsl transformer for the given xsl file"
  [xsl]
  (let [xsl-resource (new StreamSource (io/file xsl))
        factory (TransformerFactory/newInstance)]
    (.newTransformer factory xsl-resource)))

(defn transform
  "Transforms the given xml by appling the given xsl"
  [context xml xsl]
  (let [transformer (cache/cache-lookup
                      (context->xsl-transformer-cache context) xsl #(xsl->transformer xsl))
        source (new StreamSource (new StringReader xml))
        result (new StreamResult (new StringWriter))]
    (.transform transformer source result)
    (.toString (.getWriter result))))

(ns cmr.search.services.xslt
  "Provides functions for invoking xsl on metadata."
  (:require [clojure.java.io :as io]
            [cmr.common.cache :as cache])
  (:import javax.xml.transform.TransformerFactory
           java.io.StringReader
           java.io.StringWriter
           javax.xml.transform.stream.StreamSource
           javax.xml.transform.stream.StreamResult
           javax.xml.transform.Templates))

(def xsl-transformer-cache-name
  "This is the name of the cache to use for XSLT transformer templates. Templates are thread
  safe but transformer instances are not.
  http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/?page=9"
  :xsl-transformer-templates)

(defn context->xsl-transformer-cache
  [context]
  (get-in context [:system :caches xsl-transformer-cache-name]))

(defn- xsl->transformer-template
  "Returns the xsl transformer template for the given xsl file"
  [xsl]
  (let [xsl-resource (new StreamSource (io/file xsl))
        factory (TransformerFactory/newInstance)]
    (.newTemplates factory xsl-resource)))

(defn transform
  "Transforms the given xml by appling the given xsl"
  [context xml xsl]
  (let [^Templates template (cache/cache-lookup
                              (context->xsl-transformer-cache context)
                              xsl
                              #(xsl->transformer-template xsl))
        transformer (.newTransformer template)
        source (new StreamSource (new StringReader xml))
        result (new StreamResult (new StringWriter))]
    (.transform transformer source result)
    (.toString (.getWriter result))))

Fix concurrency issue when processing XSLT. Saxon XSLT transformers are not thread safe.


(ns icecap.store.mem-test
  (:require [caesium.crypto.util :refer [array-eq]]
            [icecap.store.api :refer :all]
            [icecap.store.mem :refer :all]
            [icecap.store.test-props :refer [store-roundtrip-prop]]
            [clojure.test :refer :all]
            [clojure.core.async :as a :refer [<!!]]
            [clojure.test.check.clojure-test :refer [defspec]]))

(defspec mem-store-roundtrip
  (store-roundtrip-prop (mem-store)))

(ns icecap.store.mem-test
  (:require [caesium.crypto.util :refer [array-eq]]
            [icecap.store.api :refer :all]
            [icecap.store.mem :refer :all]
            [icecap.store.test-props :refer :all]
            [clojure.test :refer :all]
            [clojure.core.async :as a :refer [<!!]]
            [clojure.test.check.clojure-test :refer [defspec]]))

(defspec mem-store-roundtrip
  (store-roundtrip-prop (mem-store)))

(defspec mem-store-delete
  (store-delete-prop (mem-store)))

Add roundtrip test to mem-store

Add roundtrip test to mem-store


(ns cavm.jdbc
  (:import [java.sql PreparedStatement])
  (:require [clojure.java.jdbc :as jdbc]))

(extend-protocol jdbc/ISQLParameter
  clojure.lang.PersistentVector
  (set-parameter [v ^PreparedStatement s ^long i]
    (.setObject s i (to-array v))))

(ns cavm.jdbc
  (:import [java.sql PreparedStatement])
  (:require [clojure.java.jdbc :as jdbc]))

(extend-protocol jdbc/ISQLParameter
  clojure.lang.Seqable
  (set-parameter [v ^PreparedStatement s ^long i]
    (.setObject s i (to-array v))))

Extend array params to all Seqable.

Extend array params to all Seqable.


(ns berry.parsing.scan-literal-test
  (:require [berry.parsing.context-handler :as context]
            [berry.parsing.scan-literal :refer :all]
            berry.parsing.token
            [clojure.test :refer :all])
  (:import [berry.parsing.token Token Location]))

(deftest scan-literal-test

  (testing "With a true literal."

           (let [true-literal (Token. "literal" "true" (Location. 1 1) (Location. 1 4))]

             (is (= true-literal
                    (scan-literal '("t" "r" "u" "e") context/begin)))))

  (testing "With a false literal."

           (let [false-literal (Token. "literal" "false" (Location. 1 1) (Location. 1 5))]

             (is (= false-literal
                    (scan-literal '("f" "a" "l" "s" "e") context/begin)))))

  (testing "With a null literal."

           (let [null-literal (Token. "literal" "null" (Location. 1 1) (Location. 1 4))]

             (is (= null-literal
                    (scan-literal '("n" "u" "l" "l") context/begin)))))

  )

(ns berry.parsing.scan-literal-test
  (:require [berry.parsing.context-handler :as context]
            [berry.parsing.scan-literal :refer :all]
            berry.parsing.token
            [clojure.test :refer :all])
  (:import [berry.parsing.token Token Location]))

(deftest scan-literal-test

  (testing "When a true literal is analyzed."

           (let [true-literal (Token. "literal" "true" (Location. 1 1) (Location. 1 4))]

             (is (= true-literal
                    (scan-literal '("t" "r" "u" "e") context/begin)))))

  (testing "When a false literal is analyzed."

           (let [false-literal (Token. "literal" "false" (Location. 1 1) (Location. 1 5))]

             (is (= false-literal
                    (scan-literal '("f" "a" "l" "s" "e") context/begin)))))

  (testing "When a null literal is analyzed."

           (let [null-literal (Token. "literal" "null" (Location. 1 1) (Location. 1 4))]

             (is (= null-literal
                    (scan-literal '("n" "u" "l" "l") context/begin)))))

  (testing "When an unexpected token is found in the sequence."

           (is (thrown-with-msg? java.text.ParseException #"Unexpected token y at line 1, column 3."
                                 (scan-literal '("t" "r" "y" "e") context/begin)))

           (testing "When the input terminates unexpectedly."

                    (is (thrown-with-msg? java.text.ParseException #"Unexpected end of input at line 1, column 4."

                                          (scan-literal '("f" "a" "l" "s") context/begin))))))

Add unit tests for checking error conditions.


(ns wombats-web-client.components.countdown-timer
  (:require [cljs-time.core :as t]
            [cljs-time.format :as f]
            [reagent.core :as reagent]))

(defn- seconds-until
  [time]
  (t/in-seconds (t/interval (t/now) time)))

(defn- format-time
  [time]
  (let [total-seconds (seconds-until time)
        seconds (mod total-seconds 60)
        minutes (/ (- total-seconds seconds) 60)
        seconds-display (if (< seconds 10) (str "0" seconds) seconds)]
    (str minutes ":" seconds-display)))

(defn countdown-timer
  [start-time]

  (let [cmpnt-state (reagent/atom {:interval-fn nil})]
    (reagent/create-class
     {:component-will-mount
      (fn []
        ;; Force timer to redraw every second
        (swap! cmpnt-state
               assoc
               :interval-fn
               (.setInterval js/window
                             #(reagent/force-update-all)
                             1000)))

      :component-will-unmount
      (fn []
        (.clearInterval js/window
                        (:interval-fn @cmpnt-state)))

      :reagent-render
      (fn []
        [:span {:class-name "countdown-timer"}
         (format-time start-time)])})))

(ns wombats-web-client.components.countdown-timer
  (:require [cljs-time.core :as t]
            [cljs-time.format :as f]
            [reagent.core :as reagent]))

(defn- seconds-until
  [time]
  (t/in-seconds (t/interval (t/now) time)))

(defn- format-time
  [time]
  (let [total-seconds (seconds-until time)
        seconds (mod total-seconds 60)
        minutes (/ (- total-seconds seconds) 60)
        seconds-formatted (if (< seconds 10) (str "0" seconds) seconds)]
    (if (< seconds 0)
      "0:00"
      (str minutes ":" seconds-formatted))))

(defn countdown-timer
  [start-time]

  (let [cmpnt-state (reagent/atom {:interval-fn nil})]
    (reagent/create-class
     {:component-will-mount
      (fn []
        ;; Force timer to redraw every second
        (swap! cmpnt-state
               assoc
               :interval-fn
               (.setInterval js/window
                             #(reagent/force-update-all)
                             1000)))

      :component-will-unmount
      (fn []
        (.clearInterval js/window
                        (:interval-fn @cmpnt-state)))

      :reagent-render
      (fn []
        [:span {:class-name "countdown-timer"}
         (format-time start-time)])})))

Handle less than 0 seconds.

Handle less than 0 seconds.


(ns vip.data-processor.validation.v5.hours-open
  (:require [vip.data-processor.validation.v5.util :as util]))

(defn valid-time-with-zone? [time]
  (re-matches
   #"(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]|(?:24:00:00))(?:Z|[+-](?:(?:0[0-9]|1[0-3]):[0-5][0-9]|14:00))"
   time))

(defn validate-times [{:keys [import-id] :as ctx}]
  (let [hours-open-path "VipObject.0.HoursOpen.*{1}.Schedule.*{1}.Hours.*{1}"
        times (util/select-lquery
               import-id
               (str hours-open-path ".StartTime|EndTime.*{1}"))
        invalid-times (remove (comp valid-time-with-zone? :value) times)]
    (reduce (fn [ctx row]
              (update-in ctx
                         [:errors :hours-open (-> row :path .getValue) :format]
                         conj (:value row)))
            ctx invalid-times)))

(ns vip.data-processor.validation.v5.hours-open
  (:require [vip.data-processor.validation.v5.util :as util]))

(defn valid-time-with-zone? [time]
  (re-matches
   #"\A(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]|(?:24:00:00))(?:Z|[+-](?:(?:0[0-9]|1[0-3]):[0-5][0-9]|14:00))\z"
   time))

(defn validate-times [{:keys [import-id] :as ctx}]
  (let [hours-open-path "VipObject.0.HoursOpen.*{1}.Schedule.*{1}.Hours.*{1}"
        times (util/select-lquery
               import-id
               (str hours-open-path ".StartTime|EndTime.*{1}"))
        invalid-times (remove (comp valid-time-with-zone? :value) times)]
    (reduce (fn [ctx row]
              (update-in ctx
                         [:errors :hours-open (-> row :path .getValue) :format]
                         conj (:value row)))
            ctx invalid-times)))

Add regex anchors to time format regex

Add regex anchors to time format regex

So we will only match full strings, not substrings.


(ns libx.core-test
    (:require [clojure.test :refer [run-tests]]
              [libx.lang-test]
              [libx.deflogical-test]
              [libx.macros-test]
              [libx.tuple-rule-test]
              [libx.util-test]
              [libx.defaction-test]
              [libx.listeners-test]))

(defn run []
  (for [ns
        ['libx.lang-test
         'libx.deflogical-test
         'libx.macros-test
         'libx.tuple-rule-test
         'libx.util-test
         'libx.defaction-test
         [libx.listeners-test]]]
    (dosync (-> ns (in-ns) (run-tests)))))

(run)

(ns libx.core-test
    (:require [clojure.test :refer [run-tests]]
              [libx.lang-test]
              [libx.deflogical-test]
              [libx.macros-test]
              [libx.tuple-rule-test]
              [libx.util-test]
              [libx.defaction-test]
              [libx.listeners-test]))

(defn run []
  (for [ns
        ['libx.lang-test
         'libx.deflogical-test
         'libx.macros-test
         'libx.tuple-rule-test
         'libx.util-test
         'libx.defaction-test
         '[libx.listeners-test]]]
    (dosync (-> ns (in-ns) (run-tests)))))

(run)

Fix missing quote in core-test

Fix missing quote in core-test


(defproject ring/ring-jetty-adapter "1.7.0"
  :description "Ring Jetty adapter."
  :url "https://github.com/ring-clojure/ring"
  :scm {:dir ".."}
  :license {:name "The MIT License"
            :url "http://opensource.org/licenses/MIT"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [ring/ring-core "1.7.0"]
                 [ring/ring-servlet "1.7.0"]
                 [org.eclipse.jetty/jetty-server "9.2.24.v20180105"]]
  :aliases {"test-all" ["with-profile" "default:+1.8:+1.9" "test"]}
  :profiles
  {:dev {:dependencies [[clj-http "2.2.0"]]
         :jvm-opts ["-Dorg.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT=500"]}
   :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
   :1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}})

(defproject ring/ring-jetty-adapter "1.7.0"
  :description "Ring Jetty adapter."
  :url "https://github.com/ring-clojure/ring"
  :scm {:dir ".."}
  :license {:name "The MIT License"
            :url "http://opensource.org/licenses/MIT"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [ring/ring-core "1.7.0"]
                 [ring/ring-servlet "1.7.0"]
                 [org.eclipse.jetty/jetty-server "9.4.12.v20180830"]]
  :aliases {"test-all" ["with-profile" "default:+1.8:+1.9" "test"]}
  :profiles
  {:dev {:dependencies [[clj-http "2.2.0"]]
         :jvm-opts ["-Dorg.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT=500"]}
   :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
   :1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}})

Update Jetty dependency to 9.4.12.v20180830

Jetty 9.2 has reached End of Life. See the announcement:
https://www.eclipse.org/lists/jetty-announce/msg00116.html

Fixes #347.


(defproject onyx-app/lein-template "0.8.11.3"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :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}}
  :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.8.11.4-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :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}}
  :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 org.onyxplatform/onyx-metrics "0.8.1.1"
  :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 [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.8.1"]
                 [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 [[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.1.2-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 [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.8.1"]
                 [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 [[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.


(defproject caesium "0.8.0-SNAPSHOT"
  :description "libsodium for clojure"
  :url "https://github.com/lvh/caesium"
  :deploy-repositories [["releases" :clojars]
                        ["snapshots" :clojars]]
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [com.github.jnr/jnr-ffi "2.0.9"]
                 [commons-codec/commons-codec "1.10"]
                 [byte-streams "0.2.2"]
                 [org.clojure/math.combinatorics "0.1.3"]]
  :main ^:skip-aot caesium.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}
             :dev {:dependencies [[criterium "0.4.4"]]}
             :test {:plugins [[lein-cljfmt "0.3.0"]
                              [lein-kibit "0.1.2"]
                              [jonase/eastwood "0.2.3"]
                              [lein-codox "0.9.4"]
                              [lein-cloverage "1.0.7-SNAPSHOT"]]
                    :test-selectors {:default (complement :benchmark)
                                     :benchmark :benchmark}}}
  :codox {:metadata {:doc/format :markdown}
          :output-path "doc"}
  :global-vars {*warn-on-reflection* true})

(defproject caesium "0.8.0-SNAPSHOT"
  :description "libsodium for clojure"
  :url "https://github.com/lvh/caesium"
  :deploy-repositories [["releases" :clojars]
                        ["snapshots" :clojars]]
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [com.github.jnr/jnr-ffi "2.0.9"]
                 [commons-codec/commons-codec "1.10"]
                 [byte-streams "0.2.2"]
                 [org.clojure/math.combinatorics "0.1.3"]]
  :main ^:skip-aot caesium.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}
             :dev {:dependencies [[criterium "0.4.4"]]}
             :test {:plugins [[lein-cljfmt "0.3.0"]
                              [lein-kibit "0.1.2"]
                              [jonase/eastwood "0.2.3"]
                              [lein-codox "0.9.4"]
                              [lein-cloverage "1.0.7-SNAPSHOT"]]}
             :benchmarks {:test-paths ^:replace ["benchmarks/"]}}
  :codox {:metadata {:doc/format :markdown}
          :output-path "doc"}
  :global-vars {*warn-on-reflection* true}
  :aliases {"benchmark" ["with-profile" "+benchmarks" "test"]})

Add utility for running benchmarks

Add utility for running benchmarks


(defproject superstring "1.0.1"
  :description "String manipulation library for clojure"
  :url "http://github.com/expez/superstring"
  :license {:name "Eclipse Public License 1.0"
            :url "http://www.eclipse.org/legal/epl-v10.html"
            :year 2015
            :key "epl-1.0"}
  :plugins [[codox "0.8.11"]]
  :codox {:src-dir-uri "http://github.com/expez/superstring/blob/master/"
          :src-linenum-anchor-prefix "L"}
  :profiles {:dev {:dependencies [[org.clojure/clojure "1.7.0-RC2"]
                                  [org.clojure/test.check "0.7.0"]]
                   :repl-options {:init-ns superstring.core}}
             :provided {:dependencies [[org.clojure/clojure "1.6.0"]]}
             :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
             :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
             :1.7 {:dependencies [[org.clojure/clojure "1.7.0-RC2"]]}})

(defproject superstring "1.0.1"
  :description "String manipulation library for clojure"
  :url "http://github.com/expez/superstring"
  :license {:name "Eclipse Public License 1.0"
            :url "http://www.eclipse.org/legal/epl-v10.html"
            :year 2015
            :key "epl-1.0"}
  :plugins [[codox "0.8.11"]]
  :codox {:src-dir-uri "http://github.com/expez/superstring/blob/master/"
          :src-linenum-anchor-prefix "L"}
  :profiles {:dev {:dependencies [[org.clojure/clojure "1.7.0"]
                                  [org.clojure/test.check "0.7.0"]]
                   :repl-options {:init-ns superstring.core}}
             :provided {:dependencies [[org.clojure/clojure "1.7.0"]]}
             :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
             :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
             :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}})

Bump clojure version to 1.7

Bump clojure version to 1.7


(defproject compojure "1.3.3"
  :description "A concise routing library for Ring"
  :url "https://github.com/weavejester/compojure"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.macro "0.1.5"]
                 [clout "2.1.2"]
                 [medley "0.5.5"]
                 [ring/ring-core "1.3.2"]
                 [ring/ring-codec "1.0.0"]]
  :plugins [[codox "0.8.10"]]
  :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.3.3/"
          :src-linenum-anchor-prefix "L"}
  :profiles
  {:dev {:jvm-opts ^:replace []
         :dependencies [[ring/ring-mock "0.2.0"]
                        [criterium "0.4.3"]
                        [javax.servlet/servlet-api "2.5"]]}
   :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
   :1.7 {:dependencies [[org.clojure/clojure "1.7.0-beta2"]]}})

(defproject compojure "1.3.3"
  :description "A concise routing library for Ring"
  :url "https://github.com/weavejester/compojure"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.macro "0.1.5"]
                 [clout "2.1.2"]
                 [medley "0.6.0"]
                 [ring/ring-core "1.3.2"]
                 [ring/ring-codec "1.0.0"]]
  :plugins [[codox "0.8.10"]]
  :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.3.3/"
          :src-linenum-anchor-prefix "L"}
  :profiles
  {:dev {:jvm-opts ^:replace []
         :dependencies [[ring/ring-mock "0.2.0"]
                        [criterium "0.4.3"]
                        [javax.servlet/servlet-api "2.5"]]}
   :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
   :1.7 {:dependencies [[org.clojure/clojure "1.7.0-beta2"]]}})

Update Medley dependency to 0.6.0

Update Medley dependency to 0.6.0


;; Copyright (C) 2013 Anders Sundman <anders@4zm.org>
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU Affero General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

(ns spira.core.system
  (:require [spira.dm.garden :as garden]
            [spira.dm.plant-desc :as plant-desc]
            [spira.dm.in-memory-repo :as mem-repo]))

;; A representation of the applications total top level state.
(defrecord SystemState [garden-repo plant-desc-repo])

(defn dev-system []
  "Create a light weight development state"
  (->SystemState
   (mem-repo/memory-garden-repo)
   (mem-repo/memory-plant-description-repo)))

;; Copyright (C) 2013 Anders Sundman <anders@4zm.org>
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU Affero General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

(ns spira.core.system
  (:require [spira.dm.garden :as garden]
            [spira.dm.plant-desc :as plant-desc]
            [spira.dm.in-memory-repo :as mem-repo]
            [spira.datomic-adapter.repo :as da]))

;; A representation of the applications total top level state.
(defrecord SystemState [garden-repo plant-desc-repo])

(defn mem-dev-system []
  "Create a light weight development state"
  (->SystemState
   (mem-repo/memory-garden-repo)
   (mem-repo/memory-plant-description-repo)))

(defn dev-system []
  "Create a light weight development state"
  (let [uri da/test-uri]
    (da/create-test-db uri)
    (->SystemState
     (da/datomic-garden-repo uri)
     (da/datomic-plant-description-repo uri))))

Use in memory datomic db by default

Use in memory datomic db by default


(ns nightmod.manager
  (:require [clojure.java.io :as io]
            [nightmod.utils :as u]
            [play-clj.core :refer :all])
  (:import [com.badlogic.gdx.assets.loaders FileHandleResolver]
           [com.badlogic.gdx.files FileHandle]))

; make all assets load relative to the current project's directory
(def manager (asset-manager*
               (reify FileHandleResolver
                 (resolve [this file-name]
                   (FileHandle. (io/file @u/project-dir file-name))))))
(set-asset-manager! manager)

(defn clear-ns!
  [nspace]
  (doall (map #(ns-unmap nspace %) (keys (ns-interns nspace)))))

(defn clean!
  []
  (clear-ns! u/game-ns)
  (on-gl (asset-manager! manager :clear)))

(ns nightmod.manager
  (:require [clojure.java.io :as io]
            [nightmod.utils :as u]
            [play-clj.core :refer :all])
  (:import [com.badlogic.gdx.assets.loaders FileHandleResolver]
           [com.badlogic.gdx.files FileHandle]))

; make all assets load relative to the current project's directory
(def manager (asset-manager*
               (reify FileHandleResolver
                 (resolve [this file-name]
                   (FileHandle. (io/file @u/project-dir file-name))))))
(set-asset-manager! manager)

; keep a reference to all timers to we can stop them later
(def timers (atom []))
(let [create-and-add-timer! (deref #'play-clj.core/create-and-add-timer!)]
  (intern 'play-clj.core
          'create-and-add-timer!
          (fn [screen id]
            (let [t (create-and-add-timer! screen id)]
              (swap! timers conj t)
              t))))

(defn stop-timers!
  []
  (doseq [t @timers]
    (.stop t))
  (reset! timers []))

(defn clear-ns!
  [nspace]
  (doall (map #(ns-unmap nspace %) (keys (ns-interns nspace)))))

(defn clean!
  []
  (clear-ns! u/game-ns)
  (stop-timers!)
  (on-gl (asset-manager! manager :clear)))

Bring back timer stopping code

Bring back timer stopping code


{:user {
        :aliases {
                  "lint" ["do" ["cljfmt" "check"] "kibit"]
                  "fix" ["do" ["cljfmt" "fix"] ["kibit" "--replace" "--interactive"]]}
        :plugins [
                  [lein-drip "0.1.1-SNAPSHOT"];; faster JVM
                  [venantius/ultra "0.6.0" :exclusions [org.clojure/clojure org.clojure/core.rrb-vector]];; pretty print
                  [lein-auto "0.1.3"];; watch tasks
                  [lein-try "0.4.3"];; REPL experimenting
                  ;; Project Scaffolding
                  [chestnut/lein-template "0.15.2"]
                  ;; Dependency Management
                  [com.livingsocial/lein-dependency-check "0.2.2"]
                  [lein-ancient "0.6.10"]
                  [lein-nvd "0.3.1"];; National Vulnerability Database dependency-checker
                  ;; Code Quality
                  [lein-cljfmt "0.5.7"]
                  [lein-kibit "0.1.5"]
                  [lein-bikeshed "0.4.1"]
                  ;; Testing
                  [lein-cloverage "1.0.9"]]}}

{:user {
        :aliases {
                  "lint" ["do" ["cljfmt" "check"] "kibit"]
                  "fix" ["do" ["cljfmt" "fix"] ["kibit" "--replace" "--interactive"]]}
        :plugins [
                  [lein-drip "0.1.1-SNAPSHOT"];; faster JVM
                  ;; Ultra is awesome, but v0.6.0 has issues with JDK v11
                ;   [venantius/ultra "0.6.0"];; pretty print and stuff
                  [lein-auto "0.1.3"];; watch tasks
                  [lein-try "0.4.3"];; REPL experimenting
                  ;; Project Scaffolding
                  [chestnut/lein-template "0.15.2"]
                  ;; Dependency Management
                  [com.livingsocial/lein-dependency-check "0.2.2"]
                  [lein-ancient "0.6.10"]
                  [lein-nvd "0.3.1"];; National Vulnerability Database dependency-checker
                  ;; Code Quality
                  [lein-cljfmt "0.5.7"]
                  [lein-kibit "0.1.5"]
                  [lein-bikeshed "0.4.1"]
                  ;; Testing
                  [lein-cloverage "1.0.9"]]}}

Comment out ultra until it is fixed

fix: Comment out ultra until it is fixed


(defproject io.aviso/twixt "0.1.0"
  :description "An extensible asset pipeline for Clojure web applications"
  :url "https://github.com/AvisoNovate/twixt"
  :license {:name "Apache Sofware Licencse 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.logging "0.2.6"]
                 [ring/ring-core "1.1.8"]
                 [org.mozilla/rhino "1.7R4"]
                 [com.github.sommeri/less4j "1.0.4"]
                 [de.neuland/jade4j "0.3.12"]]
  :repositories [["jade4j" "https://raw.github.com/neuland/jade4j/master/releases"]]
  :profiles {:dev {:dependencies [[log4j "1.2.17"]]}})

(defproject io.aviso/twixt "0.1.1"
  :description "An extensible asset pipeline for Clojure web applications"
  :url "https://github.com/AvisoNovate/twixt"
  :license {:name "Apache Sofware Licencse 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.logging "0.2.6"]
                 [ring/ring-core "1.1.8"]
                 [org.mozilla/rhino "1.7R4"]
                 [com.github.sommeri/less4j "1.0.4"]
                 [de.neuland/jade4j "0.3.12"]]
  :repositories [["jade4j" "https://raw.github.com/neuland/jade4j/master/releases"]]
  :profiles {:dev {:dependencies [[log4j "1.2.17"]]}})

Advance version number to 0.1.1

Advance version number to 0.1.1


(defproject dsbdp "0.3.0-SNAPSHOT"
;(defproject dsbdp "0.2.0"
  :description "Dynamic Stream and Batch Data Processing (dsbdp)"
  :url "https://github.com/ruedigergad/dsbdp"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/core.async "0.2.374"]
                 [clj-assorted-utils "1.17.1"]
                 [org.clojure/tools.cli "0.3.3"]]
  :global-vars {*warn-on-reflection* true}
  :java-source-paths ["src-java"]
;  :javac-options     ["-target" "1.6" "-source" "1.6"]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.2" :exclusions  [org.clojure/clojure]]]}}
  :plugins [[lein-cloverage "1.0.6"]]
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^dsbdp.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/dsbdp/blob/master"
  :aot :all
  :main dsbdp.main)

;(defproject dsbdp "0.4.0-SNAPSHOT"
(defproject dsbdp "0.3.0"
  :description "Dynamic Stream and Batch Data Processing (dsbdp)"
  :url "https://github.com/ruedigergad/dsbdp"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/core.async "0.2.374"]
                 [clj-assorted-utils "1.17.1"]
                 [org.clojure/tools.cli "0.3.3"]]
  :global-vars {*warn-on-reflection* true}
  :java-source-paths ["src-java"]
;  :javac-options     ["-target" "1.6" "-source" "1.6"]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.2" :exclusions  [org.clojure/clojure]]]}}
  :plugins [[lein-cloverage "1.0.6"]]
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^dsbdp.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/dsbdp/blob/master"
  :aot :all
  :main dsbdp.main)

Update version info and deploy to clojars.


(defproject deraen/less4clj "0.3.4-SNAPSHOT"
  :description "Wrapper for Less4j"
  :url "https://github.com/deraen/less4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"
            :distribution :repo
            :comments "same as Clojure"}
  :dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
                 [com.github.sommeri/less4j "1.15.4"]
                 [com.github.sommeri/less4j-javascript "0.0.1" :exclusions [com.github.sommeri/less4j]]
                 [org.webjars/webjars-locator "0.29"]
                 [org.slf4j/slf4j-nop "1.7.13"]

                 ;; For testing the webjars asset locator implementation
                 [org.webjars/bootstrap "3.3.6" :scope "test"]]
  :profiles {:dev {:resource-paths ["test-resources"]}
             :1.8 {:dependencies [[org.clojure/clojure "1.8.0-RC4"]]}
             :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}}
  :aliases {"all" ["with-profile" "dev:dev,1.6:dev,1.8"]})

(defproject deraen/less4clj "0.3.4-SNAPSHOT"
  :description "Wrapper for Less4j"
  :url "https://github.com/deraen/less4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"
            :distribution :repo
            :comments "same as Clojure"}
  :dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
                 [com.github.sommeri/less4j "1.15.4"]
                 [com.github.sommeri/less4j-javascript "0.0.1" :exclusions [com.github.sommeri/less4j]]
                 [org.webjars/webjars-locator "0.29"]
                 ;; FIXME: Will this cause problems if there is another
                 ;; slf4j implementation already present?
                 [org.slf4j/slf4j-nop "1.7.13"]

                 ;; For testing the webjars asset locator implementation
                 [org.webjars/bootstrap "3.3.6" :scope "test"]]
  :profiles {:dev {:resource-paths ["test-resources"]}
             :1.8 {:dependencies [[org.clojure/clojure "1.8.0-RC4"]]}
             :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}}
  :aliases {"all" ["with-profile" "dev:dev,1.6:dev,1.8"]})

Add note about slf4j implementation

Add note about slf4j implementation


(defproject cats "0.5.0-SNAPSHOT"
  :description "Category Theory abstractions for Clojure"
  :url "https://github.com/funcool/cats"
  :license {:name "BSD (2 Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies []
  :deploy-repositories {"releases" :clojars
                        "snapshots" :clojars}

  :source-paths ["src"]
  :test-paths ["test"]

  :cljsbuild {:test-commands {"test" ["node" "output/tests.js"]}
              :builds [{:id "test"
                        :source-paths ["src" "test"]
                        :notify-command ["node" "output/tests.js"]
                        :compiler {:output-to "output/tests.js"
                                   :output-dir "output"
                                   :source-map true
                                   :static-fns true
                                   :cache-analysis false
                                   :main cats.testrunner
                                   :optimizations :none
                                   :target :nodejs
                                   :pretty-print true}}]}

  :jar-exclusions [#"\.swp|\.swo"]

  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.10"]
                                  [org.clojure/clojure "1.7.0-RC1"]
                                  [org.clojure/clojurescript "0.0-3269"]
                                  [funcool/cljs-testrunners "0.1.0-SNAPSHOT"]]
                   :codeina {:sources ["src"]
                             :output-dir "doc/codeina"}
                   :plugins [[funcool/codeina "0.1.0-SNAPSHOT"
                              :exclusions [org.clojure/clojure]]
                             [lein-cljsbuild "1.0.4"]]}})

(defproject cats "0.5.0-SNAPSHOT"
  :description "Category Theory abstractions for Clojure"
  :url "https://github.com/funcool/cats"
  :license {:name "BSD (2 Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies []
  :deploy-repositories {"releases" :clojars
                        "snapshots" :clojars}

  :source-paths ["src"]
  :test-paths ["test"]

  :cljsbuild {:test-commands {"test" ["node" "output/tests.js"]}
              :builds [{:id "test"
                        :source-paths ["src" "test"]
                        :notify-command ["node" "output/tests.js"]
                        :compiler {:output-to "output/tests.js"
                                   :output-dir "output"
                                   :source-map true
                                   :static-fns true
                                   :cache-analysis false
                                   :main cats.runner
                                   :optimizations :none
                                   :target :nodejs
                                   :pretty-print true}}]}

  :jar-exclusions [#"\.swp|\.swo"]

  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.10"]
                                  [org.clojure/clojure "1.7.0-RC1"]
                                  [org.clojure/clojurescript "0.0-3297"]]
                   :codeina {:sources ["src"]
                             :output-dir "doc/codeina"}
                   :plugins [[funcool/codeina "0.1.0-SNAPSHOT"
                              :exclusions [org.clojure/clojure]]
                             [lein-cljsbuild "1.0.6"]]}})

Update cljsbuild version that properly supports cljc files.


(defproject mars-ogler "1.0.1-SNAPSHOT"
  :description "Holy cow, it's Mars!"
  :url "http://github.com/aperiodic/mars-ogler"
  :license {:name "GNU Affero GPL"
            :url "http://www.gnu.org/licenses/agpl"}
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [org.clojure/tools.cli "0.2.2"]
                 [cheshire "5.2.0"]
                 [clj-http "0.6.3"]
                 [clj-time "0.4.4"]
                 [compojure "1.1.3"]
                 [enlive "1.0.1"]
                 [hiccup "1.0.0"]
                 [ring/ring-core "1.1.6"]
                 [ring/ring-jetty-adapter "1.1.6"]]
  :plugins [[lein-ring "0.7.1"]]
  :main mars-ogler.main
  :uberjar-name "mars-ogler.jar"
  :jvm-opts ["-Xmx850m"
             "-XX:+UseConcMarkSweepGC"
             "-XX:+CMSIncrementalMode"
             "-XX:+UseCompressedOops"]
  :ring {:handler mars-ogler.routes/ogler-handler
         :init mars-ogler.images/setup!})

(defproject mars-ogler "1.0.1-SNAPSHOT"
  :description "Holy cow, it's Mars!"
  :url "http://github.com/aperiodic/mars-ogler"
  :license {:name "GNU Affero GPL"
            :url "http://www.gnu.org/licenses/agpl"}
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [org.clojure/tools.cli "0.2.2"]
                 [cheshire "5.2.0"]
                 [clj-http "0.6.3"]
                 [clj-time "0.4.4"]
                 [compojure "1.1.3"]
                 [enlive "1.0.1"]
                 [hiccup "1.0.0"]
                 [ring/ring-core "1.1.6"]
                 [ring/ring-jetty-adapter "1.1.6"]]
  :plugins [[lein-ring "0.7.1"]]
  :main mars-ogler.main
  :uberjar-name "mars-ogler.jar"
  :jvm-opts ["-Xmx850m"
             "-XX:+UseConcMarkSweepGC"
             "-XX:+CMSConcurrentMTEnabled"
             "-XX:+UseParNewGC"
             "-XX:ConcGCThreads=4"
             "-XX:ParallelGCThreads=4"
             "-XX:+UseCompressedOops"]
  :ring {:handler mars-ogler.routes/ogler-handler
         :init mars-ogler.images/setup!})

Add some GC tuning flags

Add some GC tuning flags