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

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

Prepare for next release cycle.

Prepare for next release cycle.


(defproject hawk "0.2.0-SNAPSHOT"
  :description "Watch files with clojure (in the manner of a hawk)"
  :url "https://github.com/wkf/hawk"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :test-paths ["src/test"]
  :source-paths ["src/main"]
  :java-source-paths ["vendor/barbarywatchservice/src"]
  :aot [hawk.watcher]
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [net.java.dev.jna/jna "3.2.3"]]
  :profiles {:dev {:dependencies [[org.clojure/core.async "0.1.346.0-17112a-alpha"]]}})

(defproject hawk "0.2.0-SNAPSHOT"
  :description "Watch files with clojure (in the manner of a hawk)"
  :test-paths ["src/test"]
  :source-paths ["src/main"]
  :java-source-paths ["vendor/barbarywatchservice/src"]
  :aot [hawk.watcher]
  :dependencies [[org.clojure/clojure _]
                 [net.java.dev.jna/jna "3.2.3"]]
  :plugins [[lein-shell "0.4.0"]
            [lein-modules "0.3.10"]]
  :profiles {:dev {:dependencies [[org.clojure/core.async "0.1.346.0-17112a-alpha"]]}}
  :modules {:subprocess false
            :versions {hawk :version
                       org.clojure/clojure "1.6.0"
                       org.clojure/clojurescript "0.0-2850"}
            :inherited {:url "https://github.com/wkf/hawk"
                        :scm {:name "git"
                              :url "https://github.com/wkf/hawk"}
                        :license {:name "Eclipse Public License"
                                  :url "http://www.eclipse.org/legal/epl-v10.html"}}}
  :aliases {"export-gh-pages" ["modules" "export"]
            "deploy-gh-pages"
            ["do"
             ["shell" "git" "branch" "-D" "gh-pages"]
             ["shell" "git" "subtree" "split" "--prefix" "hawk_www/resources/public" "--branch" "gh-pages"]
             ["vcs" "push" "origin" "gh-pages" "--force"]]}
  :release-tasks [["vcs" "assert-committed"]
                  ["test"]
                  ["modules" "change" "version" "leiningen.release/bump-version" "release"]
                  ["change" "version" "leiningen.release/bump-version" "release"]
                  ["export-gh-pages"]
                  ["vcs" "commit"]
                  ["vcs" "tag"]
                  ["deploy-gh-pages"]
                  ["deploy" "clojars"]
                  ["modules" "change" "version" "leiningen.release/bump-version"]
                  ["change" "version" "leiningen.release/bump-version"]
                  ["vcs" "commit"]
                  ["vcs" "push"]])

Add release tasks for gh-pages site.

Add release tasks for gh-pages site.


(defproject cascade "0.2-SNAPSHOT"
  :description "Simple, fast, easy web applications in idiomatic Clojure"
  :url "http://github.com/hlship/cascade"
  :source-path "src/main/clojure"
  :resources-path "src/main/resources"
  :test-path "src/test/clojure"
  :dev-resources-path "src/test/resources"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojure/algo.monads "0.1.0"]
                 [compojure "0.6.5"]]
  :dev-dependencies [[ring/ring-jetty-adapter "0.3.11"]
                     [swank-coljure "1.3.1"]
                     [midje "1.1.1"]])

(defproject cascade "0.2-SNAPSHOT"
  :description "Simple, fast, easy web applications in idiomatic Clojure"
  :url "http://github.com/hlship/cascade"
  :source-path "src/main/clojure"
  :resources-path "src/main/resources"
  :test-path "src/test/clojure"
  :dev-resources-path "src/test/resources"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojure/algo.monads "0.1.0"]
                 [compojure "0.6.5"]]
  :dev-dependencies [[ring/ring-jetty-adapter "0.3.11"]
                     [swank-clojure "1.3.1"]
                     [midje "1.1.1"]])

Correct a typo in a dependency name

Correct a typo in a dependency name


(defproject manners "0.1.0-SNAPSHOT"
  :description "A validation library built on using predicates properly."
  :url "https://github.com/RyanMcG/manners"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [speclj "2.5.0"]]
  :plugins [[speclj "2.5.0"]]
  :test-paths ["spec/"])

(defproject manners "0.1.0-SNAPSHOT"
  :description "A validation library built on using predicates properly."
  :url "https://github.com/RyanMcG/manners"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]]
  :profiles {:dev {:dependencies [[speclj "2.5.0"]]}}
  :plugins [[speclj "2.5.0"]]
  :test-paths ["spec/"])

Move speclj to dev dependencies.

Move speclj to dev dependencies.


(defproject org.platypope/parenskit "0.1.1-SNAPSHOT"
  :description "Clojure integration library for the LensKit framework."
  :url "http://github.com/llasram/parenskit"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :global-vars {*warn-on-reflection* true}
  :source-paths ["src/clojure"]
  :java-source-paths ["src/java"]
  :javac-options ["-target" "1.6" "-source" "1.6"]
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.grouplens.lenskit/lenskit-core "2.0.2"]
                 [org.platypope/esfj "0.2.0"]]
  :profiles {:dev
             {:dependencies
              [[com.google.code.findbugs/annotations "2.0.2"]]}
             :java6
             {:dependencies
              [[org.codehaus.jsr166-mirror/jsr166y "1.7.0"]]}})

(defproject org.platypope/parenskit "0.1.1-SNAPSHOT"
  :description "Clojure integration library for the LensKit framework."
  :url "http://github.com/llasram/parenskit"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :global-vars {*warn-on-reflection* true}
  :source-paths ["src/clojure"]
  :java-source-paths ["src/java"]
  :javac-options ["-target" "1.6" "-source" "1.6"]
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.grouplens.lenskit/lenskit-core "2.0.2"]
                 [org.platypope/esfj "0.2.0"]]
  :profiles {:default [:base :system :user :provided :java6 :dev]
             :java6 {:dependencies
                     [[org.codehaus.jsr166-mirror/jsr166y "1.7.0"]]}
             :dev {:dependencies
                   [[com.google.code.findbugs/annotations "2.0.2"]]}})

Include :java6 in :default profile.

Include :java6 in :default profile.


(defproject chestnut/lein-template "0.9.0"
  :description "A Leiningen template for a ClojureScript setup with Figwheel, Austin, Om."
  :url "https://github.com/plexus/chestnut"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :eval-in-leiningen true

  :dependencies [[clj-jgit "0.8.8"]]

  :profiles { :test { :dependencies [[org.clojure/core.async "0.1.346.0-17112a-alpha"]
                                     [com.github.jnr/jnr-process "1.0-SNAPSHOT"]
                                     [clj-webdriver "0.7.0-SNAPSHOT"]]}}

  :aliases {"test" ["with-profile" "+test" "run" "-m" "chestnut.test.integration"] })

(defproject chestnut/lein-template "0.9.0-SNAPSHOT"
  :description "A Leiningen template for a ClojureScript setup with Figwheel, Om."
  :url "https://github.com/plexus/chestnut"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :eval-in-leiningen true

  :dependencies [[clj-jgit "0.8.8"]]

  :profiles { :test { :dependencies [[org.clojure/core.async "0.1.346.0-17112a-alpha"]
                                     [com.github.jnr/jnr-process "1.0-SNAPSHOT"]
                                     [clj-webdriver "0.7.0-SNAPSHOT"]]}}

  :aliases {"test" ["with-profile" "+test" "run" "-m" "chestnut.test.integration"] })

Set version to 0.9.0-SNAPSHOT and release


(defproject org.onyxplatform/onyx-datomic "0.10.0.0-beta4"
  :description "Onyx plugin for Datomic"
  :url "https://github.com/onyx-platform/onyx-datomic"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.10.0-beta4"]]
  :test-selectors {:default (complement :ci)
                   :ci :ci
                   :all (constantly true)}
  :profiles {:dev {:dependencies [[com.datomic/datomic-free "0.9.5544"]
                                  [aero "0.2.0"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]
                   :resource-paths ["test-resources/"]}
             :circle-ci {:jvm-opts ["-Xmx4g"]}})

(defproject org.onyxplatform/onyx-datomic "0.10.0.0-SNAPSHOT"
  :description "Onyx plugin for Datomic"
  :url "https://github.com/onyx-platform/onyx-datomic"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.10.0-beta4"]]
  :test-selectors {:default (complement :ci)
                   :ci :ci
                   :all (constantly true)}
  :profiles {:dev {:dependencies [[com.datomic/datomic-free "0.9.5544"]
                                  [aero "0.2.0"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]
                   :resource-paths ["test-resources/"]}
             :circle-ci {:jvm-opts ["-Xmx4g"]}})

Prepare for next release cycle.

Prepare for next release cycle.


(defproject tile-game "1.0.0-SNAPSHOT"
  :description "A Tile Puzzle Game and Solver"
  :min-lein-version "2.0.0"
  :main tile-game.core
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/clojurescript "1.9.494"]
                 [reagent "0.6.1"]]
  :plugins [[lein-figwheel "0.5.9"]]
  :sources-paths ["src"]
  :clean-targets ^{:protect false}
  ["resources/public/js/out"
   "resources/public/js/tile-game.js"
   :target-path]
  :cljsbuild
  { :builds [{:id "tile-game"
              :source-paths ["src"]
              :figwheel true
              :compiler {:main "tile-game.grid"
                         :asset-path "js/out"
                         :output-to "resources/public/js/tile-game.js"
                         :output-dir "resources/public/js/out"
                         :source-map-timestamp true}}]}
  :figwheel { :css-dirs ["resources/public/css"]
              :open-file-command "emacsclient" })

(defproject tile-game "1.0.0-SNAPSHOT"
  :description "A Tile Puzzle Game and Solver"
  :min-lein-version "2.0.0"
  :main tile-game.core
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/clojurescript "1.9.494"]
                 [reagent "0.6.1"]]
  :plugins [[lein-figwheel "0.5.9"]
            [lein-cljsbuild "1.1.5"]]
  :sources-paths ["src"]
  :clean-targets ^{:protect false}
  ["resources/public/js/out"
   "resources/public/js/release"
   "resources/public/js/tile-game.js"
   :target-path]
  :cljsbuild
  { :builds [{:id "dev"
              :source-paths ["src"]
              :figwheel true
              :compiler {:main tile-game.grid
                         :asset-path "js/out"
                         :output-to "resources/public/js/tile-game.js"
                         :output-dir "resources/public/js/out"
                         :source-map-timestamp true}}
             {:id "release"
              :source-paths ["src"]
              :compiler {:main tile-game.grid
                         :output-to "resources/public/js/tile-game.js"
                         :output-dir "resources/public/js/release"
                         :optimizations :advanced
                         :source-map "resources/public/js/tile-game.js.map"}}]}
  :figwheel { :css-dirs ["resources/public/css"]
              :open-file-command "emacsclient" })

Add basic cljsbuild release build

Add basic cljsbuild release build


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

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

Revert back to snapshot version.

Revert back to snapshot version.


(defproject org.clojure-grimoire/lib-grimoire "0.9.0"
  :description "A shared library for Grimoire infrastructure"
  :url "http://github.com/clojure-grimoire/lib-grimoire"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [version-clj "0.1.0"
                  :exclusions [org.clojure/clojure]]
                 [me.arrdem/detritus "0.2.2"
                  :exclusions [org.clojure/clojure]]
                 [com.cemerick/url "0.1.1"
                  :exclusions [org.clojure/clojure]]]
  :profiles {:dev {:dependencies [[org.clojure/test.check "0.6.1"
                                   :exclusions [org.clojure/clojure]]]}})

(defproject org.clojure-grimoire/lib-grimoire "0.9.0"
  :description "A shared library for Grimoire infrastructure"
  :url "http://github.com/clojure-grimoire/lib-grimoire"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [version-clj "0.1.0"
                  :exclusions [org.clojure/clojure]]
                 [me.arrdem/detritus "0.2.2"
                  :exclusions [org.clojure/clojure]]
                 [com.cemerick/url "0.1.1"
                  :exclusions [com.cemerick/clojurescript.test
                               org.clojure/clojure]]]
  :profiles {:dev {:dependencies [[org.clojure/test.check "0.6.1"
                                   :exclusions [org.clojure/clojure]]]}})

Exclude some unused deps for size

Exclude some unused deps for size


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

(defproject onyx-app/lein-template "0.11.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 strava-activity-graphs "0.1.0-SNAPSHOT"
  :description "Generate statistical charts for Strava activities"
  :url "https://github.com/nicokosi/strava-activity-graphs"
  :license {:name "Creative Commons Attribution 4.0"
            :url  "https://creativecommons.org/licenses/by/4.0/"}
  :dependencies [[org.clojure/clojure "1.10.3"]
                 [incanter/incanter-core "1.9.3"]
                 [incanter/incanter-charts "1.9.3"]
                 [incanter/incanter-io "1.9.3"]
                 [org.clojure/data.json "2.3.0"]
                 [clj-http "3.12.1"]
                 [slingshot "0.12.2"]]
  :plugins [[lein-cljfmt "0.7.0"]]
  :main ^:skip-aot strava-activity-graphs.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

(defproject strava-activity-graphs "0.1.0-SNAPSHOT"
  :description "Generate statistical charts for Strava activities"
  :url "https://github.com/nicokosi/strava-activity-graphs"
  :license {:name "Creative Commons Attribution 4.0"
            :url  "https://creativecommons.org/licenses/by/4.0/"}
  :dependencies [[org.clojure/clojure "1.10.3"]
                 [incanter/incanter-core "1.9.3"]
                 [incanter/incanter-charts "1.9.3"]
                 [incanter/incanter-io "1.9.3"]
                 [org.clojure/data.json "2.3.0"]
                 [clj-http "3.12.1"]
                 [slingshot "0.12.2"]]
  :plugins [[lein-cljfmt "0.8.0"]]
  :main ^:skip-aot strava-activity-graphs.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

Update dependency lein-cljfmt:lein-cljfmt to v0.8.0


(defproject cctray-clj "0.1.0"
            :description "XML parser for cctray"
            :url "https://github.com/cowley05/cctray-clj"
            :license {:name "Eclipse Public License"
                      :url  "http://www.eclipse.org/legal/epl-v10.html"}
            :dependencies [[org.clojure/data.json "0.2.5"]
                           [clj-time "0.8.0"]]
            :profiles {:dev {:plugins      [[lein-midje "3.1.3"]
                                            [lein-ancient "0.5.5"]]
                             :dependencies [[org.clojure/clojure "1.6.0"]
                                            [midje "1.6.3"]]}})

(defproject clj-cctray "0.1.0"
            :description "Clojure parser for cctray.xml"
            :url "https://github.com/build-canaries/clj-cctray"
            :license {:name "Eclipse Public License"
                      :url  "http://www.eclipse.org/legal/epl-v10.html"}
            :dependencies [[org.clojure/data.json "0.2.5"]
                           [clj-time "0.8.0"]]
            :profiles {:dev {:plugins      [[lein-midje "3.1.3"]
                                            [lein-ancient "0.5.5"]]
                             :dependencies [[org.clojure/clojure "1.6.0"]
                                            [midje "1.6.3"]]}})

Update the name to be more standard with other clojure libs


(defproject clj-gatling "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.5.1"]
                 [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
                 [clojure-csv/clojure-csv "2.0.1"]
                 [clj-time "0.6.0"]
                 [http-kit "2.1.16"]
                 [io.gatling/gatling-charts "2.0.0-M3a"]
                 [io.gatling.highcharts/gatling-charts-highcharts "2.0.0-M3a"]]
  :repositories { "excilys" "http://repository.excilys.com/content/groups/public" }
  :main clj-gatling.core)

(defproject clj-gatling "0.0.1"
  :description ""
  :url "http://github.com/mhjort/clj-gatling"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
                 [clojure-csv/clojure-csv "2.0.1"]
                 [clj-time "0.6.0"]
                 [http-kit "2.1.16"]
                 [io.gatling/gatling-charts "2.0.0-M3a"]
                 [io.gatling.highcharts/gatling-charts-highcharts "2.0.0-M3a"]]
  :repositories { "excilys" "http://repository.excilys.com/content/groups/public" }
  :main clj-gatling.core)

Add proper version number and url

Add proper version number and url


(defproject madouc "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [ring/ring-core "1.5.1"]
                 [org.immutant/web "2.1.6"]]
  :main madouc.core
  :profiles {:uberjar {:aot :all}})

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

Enable logging and server logging via timbre


(ns leftpad.handler
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [compojure.handler :as handler]
            [ring.middleware.json :refer [wrap-json-response]]
            [ring.middleware.params :refer [wrap-params]]
            [ring.util.response :refer [response]]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]))

(defroutes app-routes
  (GET "/" {:keys [params] :as request} (response {:foo (get params :str "none")}))
  (route/not-found "Not Found"))

(def app
  (-> (handler/api app-routes)
             (wrap-params)
             (wrap-json-response)))

(ns leftpad.handler
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [compojure.handler :as handler]
            [ring.middleware.json :refer [wrap-json-response]]
            [ring.middleware.params :refer [wrap-params]]
            [ring.util.response :refer [response]]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]))

(defn leftpad
  [mystr len]
  (if (= len "0") mystr (format (str "%" (str len) "s") mystr)))

(defroutes app-routes
  (GET "/" {:keys [params] :as request} (response {:foo
                                                  (leftpad (get params :str "") (get params :len "0"))}))
  (route/not-found "Not Found"))

(def app
  (-> (handler/api app-routes)
             (wrap-params)
             (wrap-json-response)))

Add initial clojure leftpad implementation


(ns advent-2017.day-08
  (:refer-clojure :exclude [inc dec])
  (:require
   #?(:cljs [planck.core :refer [eval read]])
   [#?(:clj clojure.java.io :cljs planck.io) :as io]
   [clojure.string :as str]
   [clojure.spec.alpha :as s])
  #?(:clj (:import (java.io PushbackReader))))

(def input (->> "advent_2017/day_08/input" io/resource io/reader #?(:clj PushbackReader.)))

(s/def ::instr (s/* (s/cat :tgt symbol? :upd symbol? :val number? :if #{'if} :lhs symbol? :cmp symbol? :rhs number?)))

(def data (->> (repeatedly #(read {:eof nil} input)) (take-while some?) (s/conform ::instr)))

(def inc +)
(def dec -)
(def != not=)

(def register-history
  (reductions (fn [acc {:keys [tgt upd val lhs cmp rhs]}]
                (eval `(cond-> '~acc (~cmp ('~acc '~lhs 0) ~rhs) (update '~tgt (fnil ~upd 0) ~val))))
    {}
    data))

(defn max-register-val [registers]
  (apply max (or (vals registers) [0])))

(defn part-1 []
  (max-register-val (last register-history)))

(defn part-2 []
  (apply max (map max-register-val register-history)))

(ns advent-2017.day-08
  (:refer-clojure :exclude [inc dec])
  (:require
   #?(:cljs [planck.core :refer [eval read]])
   [#?(:clj clojure.java.io :cljs planck.io) :as io]
   [clojure.string :as str]
   [clojure.spec.alpha :as s])
  #?(:clj (:import (java.io PushbackReader))))

(def input (->> "advent_2017/day_08/input" io/resource io/reader #?(:clj PushbackReader.)))

(s/def ::instr (s/* (s/cat :tgt symbol? :upd symbol? :val number? :if #{'if} :lhs symbol? :cmp symbol? :rhs number?)))

(def data (->> (repeatedly #(read {:eof nil} input)) (take-while some?) (s/conform ::instr)))

(def inc +)
(def dec -)
(def != not=)

(def register-history
  (reductions (fn [acc {:keys [tgt upd val lhs cmp rhs]}]
                (eval `(cond-> '~acc (~cmp ('~acc '~lhs 0) ~rhs) (update '~tgt (fnil ~upd 0) ~val))))
    (zipmap (map :lhs data) (repeat 0))
    data))

(defn max-register-val [registers]
  (apply max (or (vals registers) [0])))

(defn part-1 []
  (max-register-val (last register-history)))

(defn part-2 []
  (apply max (map max-register-val register-history)))

Fix bug if all touched registers driven negative


(defproject io.curtis/boilerpipe-clj "0.2.0"
  :description "A simple wrapper around the Boilerpipe library for extracting text from html articles/pages"
  :url "http://curtis.io"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.0"]
                 [org.thnetos/cd-client "0.3.4" :exclusions [org.clojure/clojure cheshire]]
                 [net.sourceforge.nekohtml/nekohtml "1.9.15"]
                 [xerces/xercesImpl "2.9.1"]
                 [de.l3s.boilerpipe/boilerpipe "1.2.0"]]
  :repositories  {"boilerpipe"
                  {:url "http://boilerpipe.googlecode.com/svn/repo/"}})

(defproject io.curtis/boilerpipe-clj "0.2.1-SNAPSHOT"
  :description "A simple wrapper around the Boilerpipe library for extracting text from html articles/pages"
  :url "http://curtis.io"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.thnetos/cd-client "0.3.4" :exclusions [org.clojure/clojure cheshire]]
                 [net.sourceforge.nekohtml/nekohtml "1.9.15"]
                 [xerces/xercesImpl "2.9.1"]
                 [de.l3s.boilerpipe/boilerpipe "1.2.0"]]
  :repositories  {"boilerpipe"
                  {:url "http://boilerpipe.googlecode.com/svn/repo/"}})

Use latest version of clojure

Use latest version of clojure


(defproject reply "0.1.0-SNAPSHOT"
  :description "REPL-y: A fitter, happier, more productive REPL for Clojure."
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojars.trptcolin/jline "2.7-alpha2"]
                 [org.thnetos/cd-client "0.3.4"]
                 [clj-stacktrace "0.2.4"]
                 [org.clojure/tools.nrepl "0.2.0-beta6"]
                 [com.cemerick/drawbridge "0.0.3"]
                 [clojure-complete "0.2.1"]]
  :dev-dependencies [[midje "1.3-alpha4" :exclusions [org.clojure/clojure]]
                     [lein-midje "[1.0.0,)"]]
  :aot [reply.reader.jline.JlineInputReader]
  :source-path "src/clj"
  :java-source-path "src/java"
  :source-paths ["src/clj"]
  :java-source-paths ["src/java"]
  :main ^{:skip-aot true} reply.main)

(defproject reply "0.1.0-SNAPSHOT"
  :description "REPL-y: A fitter, happier, more productive REPL for Clojure."
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojars.trptcolin/jline "2.7-alpha3"]
                 [org.thnetos/cd-client "0.3.4"]
                 [clj-stacktrace "0.2.4"]
                 [org.clojure/tools.nrepl "0.2.0-beta6"]
                 [com.cemerick/drawbridge "0.0.3"]
                 [clojure-complete "0.2.1"]]
  :dev-dependencies [[midje "1.3-alpha4" :exclusions [org.clojure/clojure]]
                     [lein-midje "[1.0.0,)"]]
  :aot [reply.reader.jline.JlineInputReader]
  :source-path "src/clj"
  :java-source-path "src/java"
  :source-paths ["src/clj"]
  :java-source-paths ["src/java"]
  :main ^{:skip-aot true} reply.main)

Bump jline version to get rid of jlinerc message

closes #54


(defproject incise "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.5.1"]
                 [speclj "2.1.2"]
                 [ring "1.2.0"]
                 [hiccup "1.0.2"]
                 [compojure "1.1.5"]
                 [http-kit "2.1.1"]
                 [dieter "0.4.1"]]
  :plugins [[speclj "2.1.2"]]
  :test-paths ["spec/"]
  :main incise.core)

(defproject incise "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.5.1"]
                 [speclj "2.1.2"]
                 [ring "1.2.0"]
                 [hiccup "1.0.2"]
                 [compojure "1.1.5"]
                 [http-kit "2.1.1"]
                 [watchtower "0.1.1"]
                 [markdown-clj "0.9.29"]
                 [org.clojure/java.classpath "0.2.0"]
                 [org.clojure/tools.namespace "0.2.4"]
                 [dieter "0.4.1"]]
  :plugins [[speclj "2.1.2"]]
  :test-paths ["spec/"]
  :main incise.core)

Add watchtower, markdown and namespace deps.


(defproject onyx-app/lein-template "0.10.0.0-beta3"
  :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.


(ns icecap.schema-test
  (:require [icecap.schema :refer :all]
            [clojure.test :refer :all]
            [schema.core :as s]))

(def simple-http-request {:target "http://example.test"})
(def simple-https-request {:target "https://example.test"})
(def simple-ftp-request {:target "ftp://example.test"})

(deftest RequestSpecTests
  (testing "Correct request specs validate"
    (are [example] (s/validate RequestSpec example)
         simple-http-request
         simple-https-request
         #{simple-http-request simple-https-request}))
  (testing "Empty collections don't validate"
    (are [example] (some? (s/check RequestSpec example))
         []
         #{}))
  (testing "Request specs with unknown/unsupported schemes don't validate"
    (are [example reason] (= (s/check RequestSpec example) reason)
         simple-ftp-request {:target (not ("supported-scheme?" "ftp://example.test"))})))

(ns icecap.schema-test
  (:require [icecap.schema :refer :all]
            [clojure.test :refer :all]
            [schema.core :as s]))

(def simple-http-request {:target "http://example.test"})
(def simple-https-request {:target "https://example.test"})
(def simple-ftp-request {:target "ftp://example.test"})

(deftest RequestSpecTests
  (testing "Correct request specs validate"
    (are [example] (s/validate RequestSpec example)
         simple-http-request
         simple-https-request
         #{simple-http-request simple-https-request}))
  (testing "Empty collections don't validate"
    (are [example] (some? (s/check RequestSpec example))
         []
         #{}))
  (testing "Request specs with unknown/unsupported schemes don't validate"
    ;; Comparing string representations isn't great, but it's the best
    ;; easily available tool until maybe one day cddr/integrity's
    ;; humanize function is on Clojars + can humanize these errors :-)
    (are [example reason] (= (pr-str (s/check RequestSpec example))
                             (pr-str reason))
         simple-ftp-request {:target '(not ("supported-scheme?" "ftp://example.test"))})))

Fix the test (in an unfortunate fashion)


(ns circle.backend.test-git
  (:use midje.sweet)
  (:use circle.backend.git)
  (:require [circle.model.project :as project])
  (:require [circle.backend.build.test-utils :as test])
  (:require [circle.backend.github-url :as github])
  (:require fs))

(test/ensure-test-project)

(fact "clone works"
  (let [test-url (-> test/test-project :vcs_url)
        test-git-url (github/->ssh test-url)
        test-repo-path (default-repo-path test-url)
        ssh-key (project/ssh-key-for-url test-url)]
    (fs/deltree test-repo-path)
    (repo-exists? test-repo-path) => false
    (clone test-git-url :ssh-key ssh-key :path test-repo-path)
    (repo-exists? test-repo-path) => true))

(ns circle.backend.test-git
  (:use midje.sweet)
  (:use circle.backend.git)
  (:require [circle.model.project :as project])
  (:require [circle.backend.build.test-utils :as test])
  (:require [circle.backend.github-url :as github])
  (:require fs))

(test/ensure-test-project)

(fact "clone works"
  (let [test-url (-> test/test-project :vcs_url)
        test-git-url (github/->ssh test-url)
        test-repo-path (default-repo-path test-url)
        ssh-key (project/ssh-key-for-url test-url)]
    (fs/deltree test-repo-path)
    (repo-exists? test-repo-path) => false
    (clone test-git-url :ssh-key ssh-key :path test-repo-path)
    (repo-exists? test-repo-path) => true
    (fs/exists? (fs/join test-repo-path "README.md")) => true))

Make the git clone test a little more specific


(defproject website "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://github.com/funcool/catacumba"
  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies [[org.clojure/clojure "1.7.0-RC1"]
                 [funcool/catacumba "0.2.0-SNAPSHOT"]
                 [hiccup "1.0.5"]]
  :main ^:skip-aot website.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

(defproject website "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://github.com/funcool/catacumba"
  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies [[org.clojure/clojure "1.7.0-RC1"]
                 [funcool/catacumba "0.2.0"]
                 [hiccup "1.0.5"]]
  :main ^:skip-aot website.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

Update version of catacumba on website example.


(ns ^{:added "2.0.0" :author "Pedro Santos"}
  obb-rules.logger
  "Specific logger that can be turned on and off"
  (:require [obb-rules.simplifier :as simplify]))

(def ^:dynamic *verbose* false)

(defmacro log
  "Logs the given data"
  [& args]
  `(when *verbose*
    (println ~@args)))

(defn ai-turn
  "Logs ai-turn header"
  [ai-name game]
  (log "## ~~~~~~~~~~~~~~~~~~~~~~")
  (log "## AI Turn:" ai-name)
  (log "Game:")
  (log (simplify/clean-result {:board game})))

(defmacro with-verbose
  "Runs the given code in verbose mode"
  [& body]
  `(binding [*verbose* true]
    ~@body))

(defn ai-option
  "Logs an AI option"
  [option]
  (log (:actions option))
  (log "\tValue:" (:value option)
       "(" (:old-value option) ")"
       "Cost:" (:cost option)))

(ns ^{:added "2.0.0" :author "Pedro Santos"}
  obb-rules.logger
  "Specific logger that can be turned on and off"
  (:require [obb-rules.simplifier :as simplify]))

(def ^:dynamic *verbose* false)

#?(:clj
  (defmacro log
    "Logs the given data"
    [& args]
    `(when *verbose*
      (println ~@args))))

#?(:cljs
  (defn log
    "Logs the given data"
    [& args]
    (when *verbose*
      (apply println args))))

(defn ai-turn
  "Logs ai-turn header"
  [ai-name game]
  (log "## ~~~~~~~~~~~~~~~~~~~~~~")
  (log "## AI Turn:" ai-name)
  (log "Game:")
  (log (simplify/clean-result {:board game})))

(defmacro with-verbose
  "Runs the given code in verbose mode"
  [& body]
  `(binding [*verbose* true]
    ~@body))

(defn ai-option
  "Logs an AI option"
  [option]
  (log (:actions option))
  (log "\tValue:" (:value option)
       "(" (:old-value option) ")"
       "Cost:" (:cost option)))

Use log fn instead of macro on cljs

Use log fn instead of macro on cljs


;; 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.data.core
  "Worker related api and initialization events."
  (:require [beicon.core :as rx]
            [uxbox.rstore :as rs]
            [uxbox.constants :as c]
            [uxbox.util.workers :as uw]))

(defonce worker (uw/init "/js/worker.js"))

;; 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.data.core
  "Worker related api and initialization events."
  (:require [beicon.core :as rx]
            [uxbox.rstore :as rs]
            [uxbox.constants :as c]
            [uxbox.util.workers :as uw]))

;; This excludes webworker instantiation on nodejs where
;; the tests are run.

(when (not= *target* "nodejs")
  (defonce worker (uw/init "/js/worker.js")))

Initialize webworker only on browser environment.


(defproject todomvc-re-frame "0.8.0"
  :dependencies [[org.clojure/clojure        "1.8.0"]
                 [org.clojure/clojurescript  "1.9.89"]
                 [reagent "0.6.0-rc"]
                 [re-frame "0.8.0-SNAPSHOT"]
                 [binaryage/devtools "0.7.0"]
                 [secretary "1.2.3"]
                 [prismatic/schema "1.0.3"]]

  :plugins [[lein-cljsbuild "1.1.3"]
            [lein-figwheel "0.5.4-5"]]

  :hooks [leiningen.cljsbuild]

  :profiles {:dev {:cljsbuild
                   {:builds {:client {:source-paths ["devsrc"]
                                      :compiler     {:main "todomvc.dev"
                                                     :asset-path "js"
                                                     :optimizations :none
                                                     :source-map true
                                                     :source-map-timestamp true}}}}}

             :prod {:cljsbuild
                    {:builds {:client {:compiler    {:optimizations :advanced
                                                     :elide-asserts true
                                                     :pretty-print false}}}}}}

  :figwheel {:server-port 3450
             :repl        true}

  :clean-targets ^{:protect false} ["resources/public/js" "target"]

  :cljsbuild {:builds {:client {:source-paths ["src" "../../src"]
                                :compiler     {:output-dir "resources/public/js"
                                               :output-to  "resources/public/js/client.js"}}}})

(defproject todomvc-re-frame "0.8.0"
  :dependencies [[org.clojure/clojure        "1.8.0"]
                 [org.clojure/clojurescript  "1.9.89"]
                 [reagent "0.6.0-rc"]
                 [re-frame "0.8.0-SNAPSHOT"]
                 [binaryage/devtools "0.7.0"]
                 [secretary "1.2.3"]
                 [prismatic/schema "1.1.2"]]

  :plugins [[lein-cljsbuild "1.1.3"]
            [lein-figwheel "0.5.4-5"]]

  :hooks [leiningen.cljsbuild]

  :profiles {:dev {:cljsbuild
                   {:builds {:client {:source-paths ["devsrc"]
                                      :compiler     {:main "todomvc.dev"
                                                     :asset-path "js"
                                                     :optimizations :none
                                                     :source-map true
                                                     :source-map-timestamp true}}}}}

             :prod {:cljsbuild
                    {:builds {:client {:compiler    {:optimizations :advanced
                                                     :elide-asserts true
                                                     :pretty-print false}}}}}}

  :figwheel {:server-port 3450
             :repl        true}

  :clean-targets ^{:protect false} ["resources/public/js" "target"]

  :cljsbuild {:builds {:client {:source-paths ["src" "../../src"]
                                :compiler     {:output-dir "resources/public/js"
                                               :output-to  "resources/public/js/client.js"}}}})

Update deps for Prismatic Schema in todomvs example


(ns ^:no-doc onyx.messaging.messenger-buffer
  (:require [clojure.core.async :refer [chan >!! <!! thread alts!! close!]]
            [com.stuartsierra.component :as component]
            [taoensso.timbre :as timbre]))

(defrecord MessengerBuffer [opts]
  component/Lifecycle

  (start [component]
    (taoensso.timbre/info "Starting Messenger Buffer")

    (let [inbound-ch (chan (or (:onyx.messenger/inbound-capacity opts) 20000))]
      (assoc component :inbound-ch inbound-ch)))

  (stop [component]
    (taoensso.timbre/info "Stopping Messenger Buffer")

    (close! (:inbound-ch component))

    component))

(defn messenger-buffer [opts]
  (map->MessengerBuffer {:opts opts}))

(ns ^:no-doc onyx.messaging.messenger-buffer
  (:require [clojure.core.async :refer [chan >!! <!! thread alts!! close! sliding-buffer]]
            [com.stuartsierra.component :as component]
            [taoensso.timbre :as timbre]))

(defrecord MessengerBuffer [opts]
  component/Lifecycle

  (start [component]
    (taoensso.timbre/info "Starting Messenger Buffer")

    (let [inbound-ch (chan (sliding-buffer (or (:onyx.messenger/inbound-capacity opts) 20000)))]
      (assoc component :inbound-ch inbound-ch)))

  (stop [component]
    (taoensso.timbre/info "Stopping Messenger Buffer")

    (close! (:inbound-ch component))

    component))

(defn messenger-buffer [opts]
  (map->MessengerBuffer {:opts opts}))

Switch the messenger inbound-ch to a sliding buffer


(ns hyphen-keeper.db
  "Persistence for the hyphenation dictionary"
  (:require [yesql.core :refer [defqueries]]))

(def ^:private db {:name "java:jboss/datasources/old-productions"})

(defqueries "db/queries.sql" {:connection db})

(defn read-words
  "Return a coll of words for given `spelling`"
  [spelling]
  (-> {:spelling spelling} words))

(defn read-words-paginated
  "Return a coll of words for given `spelling` using `max-rows` and `offset` for pagination"
  [spelling offset max-rows]
  (-> {:spelling spelling :max_rows max-rows :offset offset}
      words-paginated))

(defn search-words
  "Return a coll of words for given `spelling` and given `search` term"
  [spelling search]
  (-> {:spelling spelling :search search}
      words-search))

(defn save-word!
  "Persist `word` with given `hyphenation` and `spelling`"
  [word hyphenation spelling]
  (-> {:word word :hyphenation hyphenation :spelling spelling}
      save-word-internal!))

(defn remove-word! [word spelling]
  (-> {:word word :spelling spelling}
      remove-word-internal!))

(ns hyphen-keeper.db
  "Persistence for the hyphenation dictionary"
  (:require [yesql.core :refer [defqueries]]))

(def ^:private db {:name "java:jboss/datasources/hyphenations"})

(defqueries "db/queries.sql" {:connection db})

(defn read-words
  "Return a coll of words for given `spelling`"
  [spelling]
  (-> {:spelling spelling} words))

(defn read-words-paginated
  "Return a coll of words for given `spelling` using `max-rows` and `offset` for pagination"
  [spelling offset max-rows]
  (-> {:spelling spelling :max_rows max-rows :offset offset}
      words-paginated))

(defn search-words
  "Return a coll of words for given `spelling` and given `search` term"
  [spelling search]
  (-> {:spelling spelling :search search}
      words-search))

(defn save-word!
  "Persist `word` with given `hyphenation` and `spelling`"
  [word hyphenation spelling]
  (-> {:word word :hyphenation hyphenation :spelling spelling}
      save-word-internal!))

(defn remove-word! [word spelling]
  (-> {:word word :spelling spelling}
      remove-word-internal!))

Fix the JNDI name for the datasource

Fix the JNDI name for the datasource


(ns lab-notebook.core
  (:require [om.core :as om]
            [om.dom :as dom]))

(defonce appstate (atom {}))

(defn app-container [cursor component]
  (reify
    om/IRender
    (render [this]
      (apply dom/div nil
        (dom/h1 nil "Lab notebook")
        nil
        (for [entry (:entries cursor)]
          (dom/div nil
            (dom/div nil (:summary entry))
            (dom/div nil (:date-time entry))
            (dom/div nil (:notes entry))))))))

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

(ns lab-notebook.core
  (:require [om.core :as om]
            [om.dom :as dom]))

(defonce appstate (atom {}))

(defn item-view [cursor component]
  (reify
    om/IRender
    (render [this]
      (dom/div nil
        (dom/div nil (:summary cursor))
        (dom/div nil (:date-time cursor))
        (dom/div nil (:notes cursor))))))

(defn app-container [cursor component]
  (reify
    om/IRender
    (render [this]
      (apply dom/div nil
        (dom/h1 nil "Lab notebook")
        nil
        (for [entry (:entries cursor)]
          (om/build item-view entry))))))

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

Move item-view into its own component.

Move item-view into its own component.


(ns demo.messaging-test
  (:use clojure.test
        immutant.messaging))

(if (immutant.util/in-immutant?)
  (deftest ^:integration listening
    (start "test.topic")
    (let [expected (promise)
          handler (listen "test.topic" #(deliver expected %))]
      (try
        (publish "test.topic" :success)
        (is (= :success (deref expected 500 :fail)))
        (finally
          @(unlisten handler)
          (stop "test.topic"))))))

(ns demo.messaging-test
  (:use clojure.test
        immutant.messaging))

(when (immutant.util/in-immutant?)
  (deftest ^:integration listening
    (start "test.topic")
    (let [expected (promise)
          handler (listen "test.topic" #(deliver expected %))]
      (try
        (publish "test.topic" :success)
        (is (= :success (deref expected 1000 :fail)))
        (finally
          @(unlisten handler)
          (stop "test.topic"))))))

Allow for the possibility of more than one test


(ns braid.server.search.elasticsearch
  (:require
    [braid.server.conf :refer [config]]
    [braid.server.db :as db]
    [clojure.data.json :as json]
    [org.httpkit.client :as http]))

(defn elasticsearch-enabled? []
  (some? (config :elasticsearch-url)))

(defn search-for
  [{:keys [text group-id user-id]}]
  (some->
    @(http/get (str (config :elasticsearch-url)
                    "/braid-messages/_search")
       {:body (json/write-str {:query {:match {:content text}}})})
    :body
    json/read-str
    (get-in ["hits" "hits"])
    (->>
      (into #{}
            (comp
              (map #(get-in % ["_source" "thread-id"]))
              (map #(java.util.UUID/fromString %))
              (filter #(= group-id (db/thread-group-id %)))
              (map (fn [t-id] [t-id (db/thread-newest-message t-id)])))))
    seq
    set))

(ns braid.server.search.elasticsearch
  (:require
    [braid.server.conf :refer [config]]
    [braid.server.db :as db]
    [clojure.data.json :as json]
    [datomic.api :as d]
    [org.httpkit.client :as http]))

(defn elasticsearch-enabled? []
  (some? (config :elasticsearch-url)))

(defn search-for
  [{:keys [text group-id user-id]}]
  (let [resp (->
               @(http/get (str (config :elasticsearch-url)
                               ; TODO: page results properly
                               "/braid-messages/_search?size=500")
                  {:body (json/write-str {:query {:match {:content text}}})})
               :body
               json/read-str
               (get "hits"))
        more (- (get resp "total") (count (get resp "hits")))]
    (->> (get resp "hits")
         (map #(Long. (get % "_id")))
         (d/pull-many (d/db db/conn) [{:message/thread [:thread/id]}])
         (into #{}
               (comp
                 (map #(get-in % [:message/thread :thread/id]))
                 (filter #(= group-id (db/thread-group-id %)))
                 (map (fn [t-id] [t-id (db/thread-newest-message t-id)]))))
         seq
         set)))

Load message by entity-id from search

Load message by entity-id from search

Instead of having elasticsearch index thread-id, just get the entity id
of the messages & use pull-many to get the thread-ids


(ns circle.backend.build.test-queue
  (:use circle.backend.build.queue)
  (:use circle.backend.build.run)
  (:use circle.backend.build.test-utils)
  (:require [circle.model.build :as build])
  (:use midje.sweet)
  (:use [circle.util.retry :only (wait-for)]))

(fact "queuing builds works"
  (let [builds (take 10 (repeatedly #(minimal-build)))]
    (doall (map enqueue-build builds)) => anything
    (wait-for
     {:sleep 1000
      :tries 30}
     (fn []
       (->> builds
            (map #(build/fetch-build (-> @% :_id)))
            (every? build/successful?)))) => true))

(ns circle.backend.build.test-queue
  (:use circle.backend.build.queue)
  (:use circle.backend.build.run)
  (:use circle.backend.build.test-utils)
  (:require [circle.model.build :as build])
  (:use [circle.backend.build.test-utils])
  (:use midje.sweet)
  (:use [circle.util.retry :only (wait-for)]))

(test-ns-setup)

(fact "queuing builds works"
  (let [builds (take 10 (repeatedly #(minimal-build)))]
    (doall (map enqueue-build builds)) => anything
    (wait-for
     {:sleep 1000
      :tries 30}
     (fn []
       (->> builds
            (map #(build/fetch-build (-> @% :_id)))
            (every? build/successful?)))) => true))

Add test-ns-setup to the new test file

Add test-ns-setup to the new test file


(ns caesium.magicnonce.secretbox-test
  (:require [caesium.magicnonce.secretbox :as s]
            [clojure.test :refer [deftest is]]
            [caesium.util :as u]))

(deftest xor-test
  (let [one (byte-array [1 0 1])
        two (byte-array [0 1 0])
        out (byte-array [0 0 0])]
    (is (identical? (#'s/xor! out one two) out))
    (is (u/array-eq (byte-array [1 1 1]) out)))
  (let [one (byte-array [1 0 1])
        two (byte-array [0 1 0])]
    (is (identical? (#'s/xor-inplace! one two) one))
    (is (u/array-eq (byte-array [1 1 1]) one))))

(ns caesium.magicnonce.secretbox-test
  (:require [caesium.magicnonce.secretbox :as ms]
            [caesium.crypto.secretbox :as s]
            [caesium.crypto.secretbox-test :as st]
            [clojure.test :refer [deftest is]]
            [caesium.util :as u]))

(deftest xor-test
  (let [one (byte-array [1 0 1])
        two (byte-array [0 1 0])
        out (byte-array [0 0 0])]
    (is (identical? (#'ms/xor! out one two) out))
    (is (u/array-eq (byte-array [1 1 1]) out)))
  (let [one (byte-array [1 0 1])
        two (byte-array [0 1 0])]
    (is (identical? (#'ms/xor-inplace! one two) one))
    (is (u/array-eq (byte-array [1 1 1]) one))))

(deftest secretbox-pfx-test
  (let [nonce (byte-array (range s/noncebytes))
        ctext (ms/secretbox-pfx st/ptext nonce st/secret-key)]
    (is (= (+ s/noncebytes
              (alength ^bytes st/ptext)
              s/macbytes)
           (alength ^bytes ctext)))))

Add a test for secretbox-pfx

Add a test for secretbox-pfx


(ns lab-notebook.core
  (:require [om.core :as om]
            [om.dom :as dom]))

(defonce appstate (atom {}))

(defn app-container [cursor component]
  (reify
    om/IRender
    (render [this]
      (dom/div nil
        (dom/h1 nil "Lab notebook")
        (:message cursor)))))

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

(ns lab-notebook.core
  (:require [om.core :as om]
            [om.dom :as dom]))

(defonce appstate (atom {}))

(defn app-container [cursor component]
  (reify
    om/IRender
    (render [this]
      (apply dom/div nil
        (dom/h1 nil "Lab notebook")
        nil
        (for [x (range 10)]
          (str x " "))))))

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

Use apply and a list.

Use apply and a list.


(defproject fulcro-todo "0.0.1"
  :description "Fulcro Todo"
  :dependencies [[org.clojure/clojure "1.9.0-alpha17"]
                 [org.clojure/clojurescript "1.9.908"]
                 [org.omcljs/om "1.0.0-beta1"]
                 [fulcrologic/fulcro "1.0.0-beta10"]]

  :source-paths ["src/main"]
  :resource-paths ["resources"]
  :clean-targets ^{:protect false} ["resources/public/js" "target" "out"]

  :plugins [[lein-cljsbuild "1.1.6"]]

  :cljsbuild {:builds
              [{:id           "dev"
                :source-paths ["src/main" "src/dev"]
                :figwheel     {:on-jsload "cljs.user/refresh"}
                :compiler     {:main                 cljs.user
                               :output-to            "resources/public/js/app.js"
                               :output-dir           "resources/public/js/app"
                               :preloads             [devtools.preload]
                               :asset-path           "js/app"
                               :optimizations        :none}}]}

  :profiles {:dev {:source-paths ["src/dev" "src/main"]
                   :dependencies [[binaryage/devtools "0.9.4"]
                                  [org.clojure/tools.namespace "0.3.0-alpha4"]
                                  [figwheel-sidecar "0.5.13"]]}})

(defproject fulcro-todo "0.0.1"
  :description "Fulcro Todo"
  :dependencies [[org.clojure/clojure "1.9.0-alpha17"]
                 [org.clojure/clojurescript "1.9.908"]
                 [org.omcljs/om "1.0.0-beta1"]
                 [fulcrologic/fulcro "1.0.0-beta10"]]

  :source-paths ["src/main"]
  :resource-paths ["resources"]
  :clean-targets ^{:protect false} ["resources/public/js" "target" "out"]

  :plugins [[lein-cljsbuild "1.1.6"]]

  :cljsbuild {:builds
              [{:id           "dev"
                :source-paths ["src/main" "src/dev"]
                :figwheel     {:on-jsload "cljs.user/refresh"}
                :compiler     {:main                 cljs.user
                               :output-to            "resources/public/js/app.js"
                               :output-dir           "resources/public/js/app"
                               :preloads             [devtools.preload]
                               :asset-path           "js/app"
                               :optimizations        :none}}]}

  :profiles {:dev {:source-paths ["src/dev" "src/main"]
                   :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
                   :dependencies [[binaryage/devtools "0.9.4"]
                                  [com.cemerick/piggieback "0.2.1"]
                                  [org.clojure/tools.namespace "0.3.0-alpha4"]
                                  [figwheel-sidecar "0.5.13"]
                                  [org.clojure/tools.nrepl "0.2.13"]]}})

Add piggieback to local profile

Add piggieback to local profile


(ns immutant.init
  (:require [immutant.messaging :as msg]
            [immutant.web       :as web]))

(msg/start "/topic/gravy")
(msg/start (msg/as-topic "toddball"))

(let [p (promise)
      l (msg/listen "/topic/gravy" (fn [v] (deliver p v)))]
  (try
    (msg/publish "/topic/gravy" :success)
    (let [delivery (deref p 1000 :fail)]
      (if-not (= :success delivery)
        (throw (Exception. (str "Should have received :success, but got " delivery)))))
    (finally
     (msg/unlisten l))))

(msg/start "queue.198")
(msg/start "topic.198")

;;; Topic listeners are additive, not idempotent
(msg/listen "topic.198" #(msg/publish "queue.198" (inc %)))
(msg/listen "topic.198" #(msg/publish "queue.198" (dec %)))

(msg/start "queue.result")
(msg/start "topic.echo")

(let [responder (atom nil)]
  (web/start
   (fn [request]
     (if @responder
       (do
         (msg/unlisten @responder)
         (reset! responder nil))
       (reset! responder (msg/listen "topic.echo" #(msg/publish "queue.result"
                                                                (identity %)))))
     {:status 200
      :body ":success"})))

(ns immutant.init
  (:require [immutant.messaging :as msg]
            [immutant.web       :as web]))

(msg/start "/topic/gravy")
(msg/start (msg/as-topic "toddball"))

(let [p (promise)
      l (msg/listen "/topic/gravy" (fn [v] (deliver p v)))]
  (try
    (msg/publish "/topic/gravy" :success)
    (let [delivery (deref p 1000 :fail)]
      (if-not (= :success delivery)
        (throw (Exception. (str "Should have received :success, but got " delivery)))))
    (finally
     (msg/unlisten l))))

(msg/start "queue.198")
(msg/start "topic.198")

;;; Topic listeners are additive, not idempotent
@(msg/listen "topic.198" #(msg/publish "queue.198" (inc %)))
@(msg/listen "topic.198" #(msg/publish "queue.198" (dec %)))

(msg/start "queue.result")
(msg/start "topic.echo")

(let [responder (atom nil)]
  (web/start
   (fn [request]
     (if @responder
       (do
         (msg/unlisten @responder)
         (reset! responder nil))
       (reset! responder @(msg/listen "topic.echo" #(msg/publish "queue.result"
                                                                 (identity %)))))
     {:status 200
      :body ":success"})))

Synchronize topic listeners to account for slow CI hardware.


{
 :name "STAR",
 :path "STAR",
 ;; instructional data used in /help
 :description  "splice aware utility for aligning reads to reference",
}

{
 :name "STAR",
 :path "STAR",

 :argcard {"--outSAMunmapped"              1 ; include unmapped reads
           "--runThreadN"                  1 ; number of threads
           "--outFileNamePrefix"           1 ; prefix for summary files
           "--outFilterScoreMinOverLread"  1 ; too short fix
           "--outFilterMatchNminOverLread" 1 ; too short fix
           "--outFilterMatchNmin"          1 ; too short fix
           "--outFilterMismatchNmax"       1 ; too short fix
           "--readFilesCommand"            1 ; zcat, others
           }

 :description  "splice aware utility for aligning reads to reference",
}

Add command config argument cardinalities


(defproject ring/ring-jetty-adapter "1.9.4"
  :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.9.4"]
                 [ring/ring-servlet "1.9.4"]
                 [org.eclipse.jetty/jetty-server "9.4.42.v20210604"]]
  :aliases {"test-all" ["with-profile" "default:+1.8:+1.9:+1.10" "test"]}
  :profiles
  {:dev  {:dependencies [[clj-http "3.12.3"]
                         [less-awful-ssl "1.0.6"]]
          :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"]]}
   :1.10 {:dependencies [[org.clojure/clojure "1.10.3"]]}})

(defproject ring/ring-jetty-adapter "1.9.4"
  :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.9.4"]
                 [ring/ring-servlet "1.9.4"]
                 [org.eclipse.jetty/jetty-server "9.4.44.v20210927"]]
  :aliases {"test-all" ["with-profile" "default:+1.8:+1.9:+1.10" "test"]}
  :profiles
  {:dev  {:dependencies [[clj-http "3.12.3"]
                         [less-awful-ssl "1.0.6"]]
          :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"]]}
   :1.10 {:dependencies [[org.clojure/clojure "1.10.3"]]}})

Update Jetty to version 9.4.44

Update Jetty to version 9.4.44

CVE-2021-34429 is fixed in version 9.4.43 but it makes sense to
update to the latest 9.x series release with further fixes.


(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.


(defproject ring/ring-jetty-adapter "1.4.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.5.1"]
                 [ring/ring-core "1.4.0"]
                 [ring/ring-servlet "1.4.0"]
                 [org.eclipse.jetty/jetty-server "9.2.10.v20150310"]]
  :profiles
  {:dev {:dependencies [[clj-http "1.1.2"]]}
   :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
   :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
   :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})

(defproject ring/ring-jetty-adapter "1.4.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.5.1"]
                 [ring/ring-core "1.4.0"]
                 [ring/ring-servlet "1.4.0"]
                 [org.eclipse.jetty/jetty-server "9.2.10.v20150310"]]
  :profiles
  {:dev {:dependencies [[clj-http "2.2.0"]]}
   :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
   :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
   :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})

Update clj-http to fix error with Clojure 1.8


(ns leiningen.bootstrap
  "Bootstrap the project by running lein deps and lein git-deps."
  (:require leiningen.deps
            leiningen.git-deps))

(defn bootstrap
  "Bootstrap the project by running lein deps and lein git-deps."
  [project]
  (leiningen.deps/deps project)
  (leiningen.git-deps/git-deps project))

(ns leiningen.bootstrap
  "Bootstrap the project by running lein deps and lein git-deps."
  (:use [leiningen.git-deps :only [git-deps]]
        [leiningen.core :only [default-repos]]
        [leiningen.deps :only [deps]]
        [leiningen.util.maven :only [container make-remote-artifact
                                     make-remote-repo make-local-repo]])
  (:import (org.apache.maven.artifact.resolver ArtifactResolver)))

;; There is a bug in Leiningen 1.6.2 which requires that you have
;; Clojure 1.2.1 in the local maven repository when you are working on a
;; Clojure 1.3 project. If the first project that someone works on
;; with Leiningen is a Clojure 1.3 based project then they will
;; encounter this problem.

;; A lot of people have run into this with ClojureScript One so we
;; have added a workaround.

;; Leiningen includes an `install` task which, for some unknown reason,
;; takes a long time to run. Below, we have extracted just the part
;; of that task that we need to get a dependency from a maven repository.

(defn- standalone-download
  "Download a dependency from a maven repository."
  [name group version]
  (.resolveAlways (.lookup container ArtifactResolver/ROLE)
                  (make-remote-artifact name group version)
                  (map make-remote-repo default-repos)
                  (make-local-repo)))

(defn bootstrap
  "Bootstrap the project by running lein deps and lein git-deps."
  [project]
  ;; Workarond for Leiningen 1.6.2 bug. Ensure that we have Clojure 1.2.1 in
  ;; the local maven repository.
  (standalone-download "clojure" "org.clojure" "1.2.1")
  (git-deps project)
  (deps project))

Add a workaround for bug in Leiningen 1.6.2.


(set-env!
 :source-paths #{"src/main/java" "src/test/java"}
 :dependencies '[[radicalzephyr/boot-junit "0.1.0" :scope "test"]])

(def +version+ "0.1.0")

(require '[radicalzephyr.boot-junit :refer [junit]])

(task-options!
 pom {:project 'http-server
      :version +version+
      :description "A Java HTTP server."
      :url "https://github.com/RadicalZephyr/http-server"
      :scm {:url "https://github.com/RadicalZephyr/http-server.git"}
      :licens {"MIT" "http://opensource.org/licenses/MIT"}}
 jar {:file "server.jar"}
 junit {:packages '#{net.zephyrizing.http_server}})

(deftask test
  "Compile and run my jUnit tests."
  []
  (comp (javac)
        (junit)))

(deftask build
  "Build my http server."
  []
  (comp (javac)
        (pom)
        (jar)))

(set-env!
 :source-paths #{"src/main/java" "src/test/java"}
 :dependencies '[[radicalzephyr/boot-junit "0.1.0" :scope "test"]])

(def +version+ "0.1.0")

(require '[radicalzephyr.boot-junit :refer [junit]])

(task-options!
 pom {:project 'http-server
      :version +version+
      :description "A Java HTTP server."
      :url "https://github.com/RadicalZephyr/http-server"
      :scm {:url "https://github.com/RadicalZephyr/http-server.git"}
      :licens {"MIT" "http://opensource.org/licenses/MIT"}}
 jar {:file "server.jar"}
 junit {:packages '#{net.zephyrizing.http_server_test}})

(deftask test
  "Compile and run my jUnit tests."
  []
  (comp (javac)
        (junit)))

(deftask build
  "Build my http server."
  []
  (comp (javac)
        (pom)
        (jar)))

Configure junit task with the correct package


(ns braid.ui.styles.body)

(def body
  [:body
   {:margin 0
    :padding 0
    :font-family "\"Open Sans\", Helvetica, Arial, sans-serif"
    :font-size "12px"
    :background "#eee"}
   [:textarea :input
    {:font-family "inherit"
     :font-size "1em"}]])

(ns braid.ui.styles.body)

(def body
  [:body
   {:margin 0
    :padding 0
    :font-family "\"Open Sans\", Helvetica, Arial, sans-serif"
    :font-size "12px"
    :background "#F2F2F2"}
   [:textarea :input
    {:font-family "inherit"
     :font-size "1em"}]])

Make page background a tad lighter

Make page background a tad lighter


(ns word-count.test (:require [clojure.test :refer :all]))
(load-file "word-count.clj")

(deftest count-one-word
  (is (= {"word" 1}
         (phrase/word-count "word"))))

(deftest count-one-of-each
  (is (= {"one" 1 "of" 1 "each" 1}
         (phrase/word-count "one of each"))))

(deftest count-multiple-occurrences
  (is (= {"one" 1 "fish" 4 "two" 1 "red" 1 "blue" 1}
         (phrase/word-count "one fish two fish red fish blue fish"))))

(deftest ignore-punctuation
  (is (= {"car" 1, "carpet" 1 "as" 1 "java" 1 "javascript" 1}
         (phrase/word-count "car : carpet as java : javascript!!&@$%^&"))))

(deftest include-numbers
  (is (= {"testing" 2 "1" 1 "2" 1}
         (phrase/word-count "testing, 1, 2 testing"))))

(deftest normalize-case
  (is (= {"go" 3}
         (phrase/word-count "go Go GO"))))

(run-tests)

(ns word-count.test (:require [clojure.test :refer :all]))
(load-file "word_count.clj")

(deftest count-one-word
  (is (= {"word" 1}
         (word-count/word-count "word"))))

(deftest count-one-of-each
  (is (= {"one" 1 "of" 1 "each" 1}
         (word-count/word-count "one of each"))))

(deftest count-multiple-occurrences
  (is (= {"one" 1 "fish" 4 "two" 1 "red" 1 "blue" 1}
         (word-count/word-count "one fish two fish red fish blue fish"))))

(deftest ignore-punctuation
  (is (= {"car" 1, "carpet" 1 "as" 1 "java" 1 "javascript" 1}
         (word-count/word-count "car : carpet as java : javascript!!&@$%^&"))))

(deftest include-numbers
  (is (= {"testing" 2 "1" 1 "2" 1}
         (word-count/word-count "testing, 1, 2 testing"))))

(deftest normalize-case
  (is (= {"go" 3}
         (word-count/word-count "go Go GO"))))

(run-tests)

Replace hyphen in filename with underscore & rename ns


(defproject {{name}} "0.1.0-SNAPSHOT"
  :description "A bukkure plugin to..."
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [bukkure "0.4.1-SNAPSHOT"]]
  :java-source-paths ["javasrc"])

(defproject {{name}} "0.1.0-SNAPSHOT"
  :description "A bukkure plugin to..."
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [bukkure "0.4.2-SNAPSHOT"]]
  :repositories [["spigot-repo" "https://hub.spigotmc.org/nexus/content/groups/public/"]]
  :profiles {:provided
             {:dependencies [[org.bukkit/bukkit "1.8.8-R0.1-SNAPSHOT"]]}}
  :java-source-paths ["javasrc"])

Bump version, make compatible with provided bukkit (the future tm)


(ns clj-record.test.validation-built-ins-test
  (:use clojure.contrib.test-is)
  (:require [clj-record.validation.built-ins :as vfn]))

(deftest match-creates-a-matching-fn-for-the-given-pattern
  (let [matches-foo? (vfn/match #"foo")]
    (is (matches-foo? "yes foo does"))
    (are (not (matches-foo? _1))
      "no bar doesn't"
      nil)))

(deftest non-match-creates-an-anti-matching-fn-for-the-given-pattern
  (let [non-matches-foo? (vfn/non-match #"foo")]
    (is (not (non-matches-foo? "foo doesn't not")))
    (are (non-matches-foo? _1)
      "bar non-matches"
      nil)))

(ns clj-record.test.validation-built-ins-test
  (:use clojure.contrib.test-is)
  (:require [clj-record.validation.built-ins :as vfn]))

(deftest match-creates-a-matching-fn-for-the-given-pattern
  (let [matches-foo? (vfn/match #"foo")]
    (is (matches-foo? "yes foo does"))
    (are (not (matches-foo? _1))
      "no bar doesn't"
      nil
      123)))

(deftest non-match-creates-an-anti-matching-fn-for-the-given-pattern
  (let [non-matches-foo? (vfn/non-match #"foo")]
    (is (not (non-matches-foo? "foo doesn't not")))
    (are (non-matches-foo? _1)
      "bar non-matches"
      nil
      123)))

Handle nil values in match validations.

Handle nil values in match validations.


(defproject org.onyxplatform/onyx-datomic "0.8.1.0-alpha3"
  :description "Onyx plugin for Datomic"
  :url "https://github.com/MichaelDrogalis/onyx-datomic"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.8.1-alpha3"]]
  :profiles {:dev {:dependencies [[midje "1.7.0"]
                                  [com.datomic/datomic-free "0.9.5153"]]
                   :plugins [[lein-midje "3.1.3"]
                             [lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}
             :circle-ci {:jvm-opts ["-Xmx4g"]}})

(defproject org.onyxplatform/onyx-datomic "0.8.1.0-SNAPSHOT"
  :description "Onyx plugin for Datomic"
  :url "https://github.com/MichaelDrogalis/onyx-datomic"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.8.1-alpha3"]]
  :profiles {:dev {:dependencies [[midje "1.7.0"]
                                  [com.datomic/datomic-free "0.9.5153"]]
                   :plugins [[lein-midje "3.1.3"]
                             [lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}
             :circle-ci {:jvm-opts ["-Xmx4g"]}})

Prepare for next release cycle.

Prepare for next release cycle.


(defproject mvxcvi/puget "0.4.0-SNAPSHOT"
  :description "Colorizing canonical Clojure printer for EDN values."
  :url "https://github.com/greglook/puget"
  :license {:name "Public Domain"
            :url "http://unlicense.org/"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/data.codec "0.1.0"]
                 [fipp "0.4.1"]])

(defproject mvxcvi/puget "0.5.0-SNAPSHOT"
  :description "Colorizing canonical Clojure printer for EDN values."
  :url "https://github.com/greglook/puget"
  :license {:name "Public Domain"
            :url "http://unlicense.org/"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/data.codec "0.1.0"]
                 [fipp "0.4.1"]])

Bump snapshot version and use clojure 1.6.


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

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

Prepare for next release cycle.

Prepare for next release cycle.


;; The Climate Corporation licenses this file to you under under the Apache
;; License, Version 2.0 (the "License"); you may not use this file except in
;; compliance with the License.  You may obtain a copy of the License at
;;
;;   http://www.apache.org/licenses/LICENSE-2.0
;;
;; See the NOTICE file distributed with this work for additional information
;; regarding copyright ownership.  Unless required by applicable law or agreed
;; to in writing, software distributed under the License is distributed on an
;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
;; or implied.  See the License for the specific language governing permissions
;; and limitations under the License.

(defproject com.climate/claypoole
  "0.3.2"
  :description "Claypoole: Threadpool tools for Clojure."
  :url "http://github.com/TheClimateCorporation/claypoole/"
  :license {:name "Apache License Version 2.0"
            :url http://www.apache.org/licenses/LICENSE-2.0
            :distribution :repo}
  :min-lein-version "2.0.0"
  :source-paths ["src/clj"]
  :java-source-paths ["src/java"]
  :pedantic? :warn
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :plugins [[jonase/eastwood "0.1.4"]])

;; The Climate Corporation licenses this file to you under under the Apache
;; License, Version 2.0 (the "License"); you may not use this file except in
;; compliance with the License.  You may obtain a copy of the License at
;;
;;   http://www.apache.org/licenses/LICENSE-2.0
;;
;; See the NOTICE file distributed with this work for additional information
;; regarding copyright ownership.  Unless required by applicable law or agreed
;; to in writing, software distributed under the License is distributed on an
;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
;; or implied.  See the License for the specific language governing permissions
;; and limitations under the License.

(defproject com.climate/claypoole
  "0.3.2-SNAPSHOT"
  :description "Claypoole: Threadpool tools for Clojure."
  :url "http://github.com/TheClimateCorporation/claypoole/"
  :license {:name "Apache License Version 2.0"
            :url http://www.apache.org/licenses/LICENSE-2.0
            :distribution :repo}
  :min-lein-version "2.0.0"
  :source-paths ["src/clj"]
  :java-source-paths ["src/java"]
  :pedantic? :warn
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :plugins [[jonase/eastwood "0.1.4"]])

Change version to snapshot again

Change version to snapshot again


(ns riemann.test.common
  (:use riemann.common)
  (:use clojure.test))

Revert "kill tests for funcs that do not exist anymore"

This reverts commit 70c3caf8b047080f759713cb4085c64af893e0c0.


;; 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.main.repo.projects
  "A main interface for access to remote resources."
  (:require [beicon.core :as rx]
            [uxbox.config :refer (url)]
            [uxbox.main.repo.impl :refer (request send!)]))

(defmethod request :fetch/projects
  [type data]
  (let [url (str url "/projects")]
    (send! {:url url :method :get})))

(defmethod request :create/project
  [_ data]
  (let [params {:url (str url "/projects")
                :method :post
                :body data}]
    (send! params)))

(defmethod request :delete/project
  [_ id]
  (let [url (str url "/projects/" id)]
    (send! {:url url :method :delete})))

;; 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.main.repo.projects
  "A main interface for access to remote resources."
  (:require [beicon.core :as rx]
            [uxbox.config :refer (url)]
            [uxbox.main.repo.impl :refer (request send!)]))

(defmethod request :fetch/projects
  [type data]
  (let [url (str url "/projects")]
    (send! {:url url :method :get})))

(defmethod request :fetch/project
  [_ id]
  (let [url (str url "/projects/" id)]
    (send! {:url url :method :get})))

(defmethod request :fetch/project-by-token
  [_ token]
  (let [url (str url "/projects-by-token/" token)]
    (send! {:url url :method :get})))

(defmethod request :create/project
  [_ data]
  (let [params {:url (str url "/projects")
                :method :post
                :body data}]
    (send! params)))

(defmethod request :delete/project
  [_ id]
  (let [url (str url "/projects/" id)]
    (send! {:url url :method :delete})))

Add fetch project by token repo functions.


(ns cljparse.core
  (:require [instaparse.core :as insta]
            [clojure.java.io :as io]
            [clojure.tools.cli :refer [parse-opts]]
            [cljparse.config.parser :as config])
  (:gen-class))

(def configname "chaincode.conf")

(def cli-options
  ;; An option with a required argument
  [["-p" "--path PATH" "path to project to build" :default "./"]
   ["-h" "--help"]])

(defn exit [status msg]
  (do
    (println msg)
    status))

(defn -main [& args]
  (let [ {:keys [options arguments errors summary]} (parse-opts args cli-options) ]
         (cond (:help options)
               (exit 0 summary)

               (not= errors nil)
               (exit -1 (str "Error: " errors))

               :else (let [ path (:path options)
                           file (io/file path configname) ]
                      (do
                        (cond (not (.isFile file))
                            (exit -1 (str ("Configuration not found at " path)))
                            :else
                            (do
                              (println "Starting cljparse on:" (.getAbsolutePath file) "and errors:" errors)
                              (config/parser file))))))))

(ns cljparse.core
  (:require [instaparse.core :as insta]
            [clojure.java.io :as io]
            [clojure.tools.cli :refer [parse-opts]]
            [cljparse.config.parser :as config])
  (:gen-class))

(def configname "chaincode.conf")

(def cli-options
  ;; An option with a required argument
  [["-p" "--path PATH" "path to project to build" :default "./"]
   ["-h" "--help"]])

(defn exit [status msg & rest]
  (do
    (println msg rest)
    status))

(defn -main [& args]
  (let [ {:keys [options arguments errors summary]} (parse-opts args cli-options) ]
         (cond (:help options)
               (exit 0 summary)

               (not= errors nil)
               (exit -1 "Error: " errors)

               :else (let [ path (:path options)
                           file (io/file path configname) ]
                      (do
                        (cond (not (.isFile file))
                            (exit -1 "Configuration not found at " path)
                            :else
                            (do
                              (println "Starting cljparse on:" (.getAbsolutePath file) "and errors:" errors)
                              (config/parser file))))))))

Fix dumbass mistake in string concat. Do it the easy way

Signed-off-by: Eric Baur <a1c9c5f8609c68027db0779b39e5f932d4cb0053@robeybaur.org>


(ns clj-json
  (:import (clj_json JsonExt)
           (org.codehaus.jackson JsonFactory JsonParser)
           (java.io StringWriter StringReader BufferedReader))
  (:use (clojure.contrib [def :only (defvar-)])))

(defvar- #^JsonFactory factory (JsonFactory.))

(defn generate-string [obj]
  (let [sw        (StringWriter.)
        generator (.createJsonGenerator factory sw)]
    (JsonExt/generate generator obj)
    (.flush generator)
    (.toString sw)))

(defn parse-string [string]
  (JsonExt/parse (.createJsonParser factory (StringReader. string)) true nil))

(defn- parsed-seq* [#^JsonParser parser]
  (let [eof (Object.)]
    (lazy-seq
      (let [elem (JsonExt/parse parser true eof)]
        (if-not (identical? elem eof)
          (cons elem (parsed-seq* parser)))))))

(defn parsed-seq [#^BufferedReader reader]
  (parsed-seq* (.createJsonParser factory reader)))

(ns clj-json
  (:import (clj_json JsonExt)
           (org.codehaus.jackson JsonFactory JsonParser)
           (java.io StringWriter StringReader BufferedReader))
  (:use (clojure.contrib [def :only (defvar-)])))

(defvar- #^JsonFactory factory (JsonFactory.))

(defn generate-string
  {:tag String}
  [obj]
  (let [sw        (StringWriter.)
        generator (.createJsonGenerator factory sw)]
    (JsonExt/generate generator obj)
    (.flush generator)
    (.toString sw)))

(defn parse-string [string]
  (JsonExt/parse (.createJsonParser factory (StringReader. string)) true nil))

(defn- parsed-seq* [#^JsonParser parser]
  (let [eof (Object.)]
    (lazy-seq
      (let [elem (JsonExt/parse parser true eof)]
        (if-not (identical? elem eof)
          (cons elem (parsed-seq* parser)))))))

(defn parsed-seq [#^BufferedReader reader]
  (parsed-seq* (.createJsonParser factory reader)))

Tag generated json as a String.

Tag generated json as a String.


(ns com.wsscode.pathom.book.intro.demo
  (:require [com.wsscode.pathom.core :as p]
            [com.wsscode.pathom.connect :as pc]))

(pc/defresolver answer [_ _]
  {::pc/output [:answer-to-everything]}
  {:answer-to-everything 42})

(pc/defresolver answer-plus-one [_ {:keys [answer-to-everything]}]
  {::pc/input  #{:answer-to-everything}
   ::pc/output [:answer-plus-one]}
  {:answer-plus-one (inc answer-to-everything)})

(def parser
  (p/parallel-parser
    {::p/env     {::p/reader [p/map-reader
                              pc/parallel-reader
                              pc/open-ident-reader
                              p/env-placeholder-reader]
                  ::p/placeholder-prefixes #{">"}}
     ::p/mutate  pc/mutate-async
     ::p/plugins [(pc/connect-plugin {::pc/register [answer answer-plus-one]})
                  p/trace-plugin]}))

(ns com.wsscode.pathom.book.intro.demo
  (:require [com.wsscode.pathom.core :as p]
            [com.wsscode.pathom.connect :as pc]))

(pc/defresolver answer [_ _]
  {::pc/output [:answer-to-everything]}
  {:answer-to-everything 42})

(pc/defresolver answer-plus-one [_ {:keys [answer-to-everything]}]
  {::pc/input  #{:answer-to-everything}
   ::pc/output [:answer-plus-one]}
  {:answer-plus-one (inc answer-to-everything)})

(def parser
  (p/parallel-parser
    {::p/env     {::p/reader [p/map-reader
                              pc/parallel-reader
                              pc/open-ident-reader
                              p/env-placeholder-reader]
                  ::p/placeholder-prefixes #{">"}}
     ::p/mutate  pc/mutate-async
     ::p/plugins [(pc/connect-plugin {::pc/register [answer answer-plus-one]})
                  p/error-handler-plugin
                  p/trace-plugin]}))

Add error handler plugin to intro example


(ns rule110.core
  (:require [rule110.midi :as midi]))

(def grid-size 1024 )
(def max-steps 100)

(def step-rule {
                [1 1 1] 0,
                [1 1 0] 1,
                [1 0 1] 1,
                [1 0 0] 0,
                [0 1 1] 1,
                [0 1 0] 1,
                [0 0 1] 1,
                [0 0 0] 0
                })

(defn step
  "Apply the rule to each cell in the grid and return a new grid"
  [grid]
  (let [torus (concat [(last grid)] grid [(first grid)])]
    (map step-rule (partition 3 1 torus))))

(defn random-grid
  "Generate a random grid of size size with x percent of the cells set to 1"
  [size percent-on]
  (mapv (fn [_] (if (<= (rand-int 100) percent-on)
                  1 0))
        (range size)))

(defn draw-grid
  "Simple drawing of grid to terminal and return grid"
  [grid]
  (doseq [c grid]
    (print (if (= 1 c) "*" " ")))
  (println "")
  grid)

(defn -main
  [& args]
  (reduce (fn [s v] (-> s step draw-grid midi/play-grid))
          (random-grid 100 25)
          (range 250))
  nil)

(ns rule110.core
  (:require [rule110.midi :as midi]))

(def grid-size 1024 )
(def max-steps 100)

(def step-rule {
                [1 1 1] 0,
                [1 1 0] 1,
                [1 0 1] 1,
                [1 0 0] 0,
                [0 1 1] 1,
                [0 1 0] 1,
                [0 0 1] 1,
                [0 0 0] 0
                })

(defn step
  "Apply the rule to each cell in the grid and return a new grid"
  [grid]
  (let [torus (concat [(last grid)] grid [(first grid)])]
    (map step-rule (partition 3 1 torus))))

(defn random-grid
  "Generate a random grid of size size with x percent of the cells set to 1"
  [size percent-on]
  (mapv (fn [_] (if (<= (rand-int 100) percent-on)
                  1 0))
        (range size)))

(defn draw-grid
  "Simple drawing of grid to terminal and return grid"
  [grid]
  (doseq [c grid]
    (print (if (= 1 c) "*" " ")))
  (println "")
  grid)

(defn -main
  [& args]
  (reduce (fn [s v] (-> s step draw-grid midi/play-grid))
          (random-grid 100 25)
          (range 250))
  (midi/stop)
  nil)

Make sure to stop the synth. This prevents it from making some garbage noise at the end of the program.


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

(defonce app-state (atom {:board board/start-position}))

(defn piece [p owner]
  (reify
    om/IRender
    (render [_]
      (dom/div #js {:className (str "piece " (board/colour p) " " (board/pieces p))} nil))))

(defn main []
  (om/root
    (fn [app owner]
      (reify
        om/IRender
        (render [_]
          (apply dom/div #js {:className "board"}
                   (map-indexed
                    (fn [i r] (apply dom/div #js {:className "row"}
                                   (map-indexed (fn [j s] (dom/div #js {:className "square" :id (board/from-board-ks j i)}
                                                         (if s
                                                           (om/build piece s)))) r)))
                    (:board app))))))
    app-state
    {:target (. js/document (getElementById "app"))}))

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

(defonce app-state (atom {:board board/start-position}))

(defn piece-class-name
  [p]
  (str "piece " (board/colour p) " " (board/pieces p)))

(defn piece [p owner]
  (reify
    om/IRender
    (render [_]
      (dom/div #js {:className (piece-class-name p)} nil))))

(defn main []
  (om/root
    (fn [app owner]
      (reify
        om/IRender
        (render [_]
          (apply dom/div #js {:className "board"}
                   (map-indexed
                    (fn [i r] (apply dom/div #js {:className "row"}
                                   (map-indexed (fn [j s] (dom/div #js {:className "square" :id (board/from-board-ks j i)}
                                                         (if s
                                                           (om/build piece s)))) r)))
                    (:board app))))))
    app-state
    {:target (. js/document (getElementById "app"))}))

Break out function for calculating piece css class


(ns baustellen)

(defn distance [p1 p2]
  (Math/sqrt
    (apply +
           (map (fn [c1 c2] (Math/pow (- c1 c2) 2))
                p1 p2))))

(defn cost
  "Returns the cost for transporting cnt units of skill over a dist. The basis
  cost for transporting one unit of skill over one unit of distance is taken
  from skill-costs.

  Currently the cost increases linearly with the distance and squareroot-ly with
  the number of skill-units transported."
  [dist skill cnt skill-costs]
  (* dist (Math/sqrt cnt) (get skill-costs skill)))

(defn sum-allocations
  [skill allocation]
  (apply + (vals (get allocation skill))))

(defn sufficient-allocation?
  "True if the allocated skills meet the demand of the site."
  [{:keys [site allocation]} sites]
  (let [demand (:skills (get sites site))]
    (every?
      (fn [skill]
        (>= (sum-allocations skill allocation) (get demand skill)))
      (keys demand))))

(defn cost-in-coal
  [agent {:keys [site allocation]} sites agents skill-costs]
  (let [skill (:skill (get agents agent))
        cnt (get-in allocation [skill agent])]
    (cost (distance (:location (get sites site))
                    (:location (get agents agent)))
          skill cnt skill-costs)))

(defn total-cost
  [{:keys [site allocation] :as coal} sites agents skill-costs]
  (let [agents-in-coal (mapcat keys (vals allocation))]
    (apply + (map (fn [a] (cost-in-coal a coal sites agents skill-costs))
                  agents-in-coal))))

(defn coalition-value
  [coalition sites agents skill-costs]
  (if (sufficient-allocation? coalition sites)
    (- (:payoff (get sites (:site coalition)))
       (total-cost coalition sites agents skill-costs))
    0))

Add function for calculating value of coalition