Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add (:gen-class) directive to allow | (ns onyx.messaging.aeron-media-driver
(:require [clojure.core.async :refer [chan <!!]])
(:import [io.aeron Aeron$Context]
[io.aeron.driver MediaDriver MediaDriver$Context ThreadingMode]))
(defn -main [& args]
(let [ctx (MediaDriver$Context.)
media-driver (MediaDriver/launch ctx)]
(println "Launched the Media Driver. Blocking forever...")
(<!! (chan))))
| (ns onyx.messaging.aeron-media-driver
(:gen-class)
(:require [clojure.core.async :refer [chan <!!]])
(:import [io.aeron Aeron$Context]
[io.aeron.driver MediaDriver MediaDriver$Context ThreadingMode]))
(defn -main [& args]
(let [ctx (MediaDriver$Context.)
media-driver (MediaDriver/launch ctx)]
(println "Launched the Media Driver. Blocking forever...")
(<!! (chan))))
|
Add `test-all` alias for test with different clojure versions. | (defproject funcool/beicon "3.3.0"
:description "Reactive Streams for Clojure(Script)"
:url "https://github.com/funcool/beicon"
:license {:name "BSD (2-Clause)"
:url "http://opensource.org/licenses/BSD-2-Clause"}
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.9.521" :scope "provided"]
[io.reactivex.rxjava2/rxjava "2.1.0"]]
:deploy-repositories {"releases" :clojars
"snapshots" :clojars}
:source-paths ["src" "assets"]
:test-paths ["test"]
:jar-exclusions [#"\.swp|\.swo|user.clj"]
:codeina {:sources ["src"]
:reader :clojurescript
:target "doc/dist/latest/api"
:src-uri "http://github.com/funcool/beicon/blob/master/"
:src-uri-prefix "#L"}
:profiles
{:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]
[funcool/promesa "1.8.1"]]
:global-vars {*warn-on-reflection* false}
:plugins [[funcool/codeina "0.5.0"]
[lein-ancient "0.6.10"]]}})
| (defproject funcool/beicon "3.3.0"
:description "Reactive Streams for Clojure(Script)"
:url "https://github.com/funcool/beicon"
:license {:name "BSD (2-Clause)"
:url "http://opensource.org/licenses/BSD-2-Clause"}
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.9.521" :scope "provided"]
[io.reactivex.rxjava2/rxjava "2.1.0"]]
:deploy-repositories {"releases" :clojars
"snapshots" :clojars}
:source-paths ["src" "assets"]
:test-paths ["test"]
:jar-exclusions [#"\.swp|\.swo|user.clj"]
:codeina {:sources ["src"]
:reader :clojurescript
:target "doc/dist/latest/api"
:src-uri "http://github.com/funcool/beicon/blob/master/"
:src-uri-prefix "#L"}
:profiles
{:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]
[funcool/promesa "1.8.1"]]
:aliases {"test-all" ["with-profile" "dev,1.9:dev,1.7:dev" "test"]}
:global-vars {*warn-on-reflection* false}
:plugins [[funcool/codeina "0.5.0"]
[lein-ancient "0.6.10"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha16"]]}
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}})
|
Upgrade Clojure and ClojureScript versions | (defproject visibility-2d "0.1.0"
:description "2D Visibility"
:url "https://toblux.github.io/visibility-2d/"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]]
:plugins [[lein-cljsbuild "1.1.1"]]
:clean-targets ^{:protect false} ["target" "resources/public/js"]
:hooks [leiningen.cljsbuild]
:cljsbuild {:builds [{:id "debug"
:source-paths ["src-cljs"]
:compiler {:output-to "resources/public/js/visibility-2d.js"
:output-dir "resources/public/js/out"
:optimizations :none
:source-map true}}
{:id "release"
:source-paths ["src-cljs"]
:compiler {:elide-asserts true
:pretty-print false
:output-to "resources/public/js/visibility-2d.min.js"
:optimizations :advanced}}]})
| (defproject visibility-2d "0.1.0"
:description "2D Visibility"
:url "https://toblux.github.io/visibility-2d/"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.8.51"]]
:plugins [[lein-cljsbuild "1.1.3"]]
:clean-targets ^{:protect false} ["target" "resources/public/js"]
:hooks [leiningen.cljsbuild]
:cljsbuild {:builds [{:id "debug"
:source-paths ["src-cljs"]
:compiler {:output-to "resources/public/js/visibility-2d.js"
:output-dir "resources/public/js/out"
:optimizations :none
:source-map true}}
{:id "release"
:source-paths ["src-cljs"]
:compiler {:elide-asserts true
:pretty-print false
:output-to "resources/public/js/visibility-2d.min.js"
:optimizations :advanced}}]})
|
Use correct name for jogl: jogl-all. | (defproject quil "2.0.0-SNAPSHOT"
:description "(mix Processing Clojure)"
:url "http://github.com/quil/quil"
:mailing-list {:name "Quil Mailing List"
:archive "https://groups.google.com/forum/?fromgroups#!forum/clj-processing"
:post "clj-processing@googlegroups.com"}
:license {:name "Common Public License - v 1.0"
:url "http://www.opensource.org/licenses/cpl1.0"}
:dependencies [[org.clojure/clojure "1.5.1"]
[quil/processing-core "2.1.2"]
[quil/processing-pdf "2.1.2"]
[quil/processing-dxf "2.1.2"]
[quil/jogl-fat "2.1.5"]
[quil/gluegen-rt-fat "2.1.5"]
[com.lowagie/itext "2.1.7"]]
:aot [quil.helpers.applet-listener quil.applet])
| (defproject quil "2.0.0-SNAPSHOT"
:description "(mix Processing Clojure)"
:url "http://github.com/quil/quil"
:mailing-list {:name "Quil Mailing List"
:archive "https://groups.google.com/forum/?fromgroups#!forum/clj-processing"
:post "clj-processing@googlegroups.com"}
:license {:name "Common Public License - v 1.0"
:url "http://www.opensource.org/licenses/cpl1.0"}
:dependencies [[org.clojure/clojure "1.5.1"]
[quil/processing-core "2.1.2"]
[quil/processing-pdf "2.1.2"]
[quil/processing-dxf "2.1.2"]
[quil/jogl-all-fat "2.1.5"]
[quil/gluegen-rt-fat "2.1.5"]
[com.lowagie/itext "2.1.7"]]
:aot [quil.helpers.applet-listener quil.applet])
|
Exclude some transitive dependencies from Gatling. Those were not needed for generating charts. | (defproject clj-gatling "0.5.3"
: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.6.0"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[clojure-csv/clojure-csv "2.0.1"]
[http-kit "2.1.18"]
[clj-time "0.8.0"]
[io.gatling/gatling-charts "2.0.3"]
[io.gatling.highcharts/gatling-charts-highcharts "2.0.3"]]
:repositories { "excilys" "http://repository.excilys.com/content/groups/public" }
:profiles {:dev {:dependencies [[clj-containment-matchers "0.9.3"]] }})
| (defproject clj-gatling "0.5.3"
: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.6.0"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[clojure-csv/clojure-csv "2.0.1"]
[http-kit "2.1.18"]
[clj-time "0.8.0"]
[io.gatling/gatling-charts "2.0.3"
:exclusions [com.typesafe.akka/akka-actor_2.10
org.jodd/jodd-lagarto
com.fasterxml.jackson.core/jackson-databind
net.sf.saxon/Saxon-HE]]
[io.gatling.highcharts/gatling-charts-highcharts "2.0.3"
:exclusions [io.gatling/gatling-app io.gatling/gatling-recorder]]]
:repositories { "excilys" "http://repository.excilys.com/content/groups/public" }
:profiles {:dev {:dependencies [[clj-containment-matchers "0.9.3"]] }})
|
Update promissum and suricatta versions. | (defproject funcool/continuo "0.1.0-SNAPSHOT"
:description "A continuous transaction log persistence for Clojure."
:url "https://github.com/funcool/continuo"
:license {:name "Apache 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.txt"}
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
:dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
[com.taoensso/nippy "2.10.0"]
[funcool/cats "1.1.0-SNAPSHOT"]
[funcool/cuerdas "0.6.0"]
[funcool/promissum "0.4.0-SNAPSHOT"]
[funcool/suricatta "0.5.0-SNAPSHOT"]
[com.h2database/h2 "1.4.189"]
[org.postgresql/postgresql "9.4-1202-jdbc42"]
[danlentz/clj-uuid "0.1.6"]
[hikari-cp "1.3.1"]
[cheshire "5.5.0"]
[com.github.spullara.mustache.java/compiler "0.9.1"]]
:plugins [[lein-ancient "0.6.7"]])
| (defproject funcool/continuo "0.1.0-SNAPSHOT"
:description "A continuous transaction log persistence for Clojure."
:url "https://github.com/funcool/continuo"
:license {:name "Apache 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.txt"}
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
:dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
[com.taoensso/nippy "2.10.0"]
[funcool/cats "1.1.0-SNAPSHOT"]
[funcool/cuerdas "0.6.0"]
[funcool/promissum "0.3.2"]
[funcool/suricatta "0.5.0"]
[com.h2database/h2 "1.4.189"]
[org.postgresql/postgresql "9.4-1202-jdbc42"]
[danlentz/clj-uuid "0.1.6"]
[hikari-cp "1.3.1"]
[cheshire "5.5.0"]
[com.github.spullara.mustache.java/compiler "0.9.1"]]
:plugins [[lein-ancient "0.6.7"]])
|
Use local repository for ML9 | (defproject uruk "0.3.5"
:description "Clojure wrapper of MarkLogic XML Content Connector For Java (XCC/J)"
:url "https://github.com/daveliepmann/uruk"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[com.marklogic/marklogic-xcc "8.0.6"]
;; required but not included by MarkLogic (e.g. for ContentFactory):
[com.fasterxml.jackson.core/jackson-databind "2.6.3"]
[org.clojure/data.json "0.2.6"]
[org.clojure/data.xml "0.1.0-beta2"]
[slingshot "0.12.2"]]
:checksum :warn
;; TODO remove this workaround -- MarkLogic's Maven repo doesn't have checksums?
:repositories [["MarkLogic-releases" "http://developer.marklogic.com/maven2"]])
| (defproject uruk "0.3.5"
:description "Clojure wrapper of MarkLogic XML Content Connector For Java (XCC/J)"
:url "https://github.com/daveliepmann/uruk"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[com.marklogic/marklogic-xcc "9.0.20170113"]
;; [com.marklogic/marklogic-xcc "8.0.6"]
;; required but not included by MarkLogic (e.g. for ContentFactory):
[com.fasterxml.jackson.core/jackson-databind "2.6.3"]
[org.clojure/data.json "0.2.6"]
[org.clojure/data.xml "0.1.0-beta2"]
[slingshot "0.12.2"]]
:checksum :warn
;; TODO remove this workaround -- MarkLogic's Maven repo doesn't have checksums?
:repositories [["MarkLogic-releases" "http://developer.marklogic.com/maven2"]
["local" "file:jar"]]
:plugins [[lein-localrepo "0.5.3"]])
|
Update clj and cljs compiler versions. | (defproject funcool/beicon "0.5.1"
:description "Reactive Streams for ClojureScript (built on top of RxJS 4.x)"
:url "https://github.com/funcool/beicon"
:license {:name "Public Domain" :url "http://unlicense.org/"}
:dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
[org.clojure/clojurescript "1.7.189" :scope "provided"]
[funcool/promesa "0.7.0" :scope "provided"]
[funcool/cats "1.2.1"]]
:deploy-repositories {"releases" :clojars
"snapshots" :clojars}
:source-paths ["src" "assets"]
:test-paths ["test"]
:jar-exclusions [#"\.swp|\.swo|user.clj"]
:codeina {:sources ["src"]
:reader :clojurescript
:target "doc/dist/latest/api"
:src-uri "http://github.com/funcool/beicon/blob/master/"
:src-uri-prefix "#L"}
:plugins [[funcool/codeina "0.3.0"]])
| (defproject funcool/beicon "0.5.1"
:description "Reactive Streams for ClojureScript (built on top of RxJS 4.x)"
:url "https://github.com/funcool/beicon"
:license {:name "Public Domain" :url "http://unlicense.org/"}
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.7.228" :scope "provided"]
[funcool/promesa "0.7.0" :scope "provided"]
[funcool/cats "1.2.1"]]
:deploy-repositories {"releases" :clojars
"snapshots" :clojars}
:source-paths ["src" "assets"]
:test-paths ["test"]
:jar-exclusions [#"\.swp|\.swo|user.clj"]
:codeina {:sources ["src"]
:reader :clojurescript
:target "doc/dist/latest/api"
:src-uri "http://github.com/funcool/beicon/blob/master/"
:src-uri-prefix "#L"}
:plugins [[funcool/codeina "0.3.0"]])
|
Set compatibility with older JVMs | (defproject naughtmq "0.0.2-SNAPSHOT"
:description "A native-embedding wrapper for jzmq"
:url "https://github.com/gaverhae/naughtmq"
:scm {:name "git"
:url "https://github.com/gaverhae/naughtmq"}
:signing {:gpg-key "gary.verhaegen@gmail.com"}
:deploy-repositories [["clojars" {:creds :gpg}]]
:pom-addition [:developers [:developer
[:name "Gary Verhaegen"]
[:url "https://github.com/gaverhae"]
[:email "gary.verhaegen@gmail.com"]
[:timezone "+1"]]]
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[com.taoensso/timbre "3.1.6"]
[org.zeromq/jzmq "2.2.2"]]
:java-source-paths ["src"])
| (defproject naughtmq "0.0.2-SNAPSHOT"
:description "A native-embedding wrapper for jzmq"
:url "https://github.com/gaverhae/naughtmq"
:scm {:name "git"
:url "https://github.com/gaverhae/naughtmq"}
:signing {:gpg-key "gary.verhaegen@gmail.com"}
:deploy-repositories [["clojars" {:creds :gpg}]]
:pom-addition [:developers [:developer
[:name "Gary Verhaegen"]
[:url "https://github.com/gaverhae"]
[:email "gary.verhaegen@gmail.com"]
[:timezone "+1"]]]
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[com.taoensso/timbre "3.1.6"]
[org.zeromq/jzmq "2.2.2"]]
:javac-options ["-target" "1.6" "-source" "1.6"]
:java-source-paths ["src"])
|
Switch to official ode4j release | (defproject brevis "0.5.3-SNAPSHOT"
:description "A Second-Generation Artificial Life Simulator"
:url "https://github.com/kephale/brevis"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:jvm-opts ["-Xmx2g"]
:resource-paths ["resources"]
:plugins [[lein-marginalia "0.7.1"]]
:java-source-paths ["java"]
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/math.numeric-tower "0.0.2"]
[java3d/vecmath "1.3.1"]
; [kephale/ode4j "0.12.0-j1.4"]
[kephale/ode4j "20130414_001"]
[kephale/penumbra "0.6.7"]
[kephale/slick-util "1.0.1"]
[org.l33tlabs.twl/pngdecoder "1.0"]
[com.nitayjoffe.thirdparty.net.robowiki.knn/knn-benchmark "0.1"]
[clj-random "0.1.5"]
;[com.googlecode.efficient-java-matrix-library/ejml "0.23"]
])
| (defproject brevis "0.5.3-SNAPSHOT"
:description "A Second-Generation Artificial Life Simulator"
:url "https://github.com/kephale/brevis"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:jvm-opts ["-Xmx2g"]
:resource-paths ["resources"]
:plugins [[lein-marginalia "0.7.1"]]
:java-source-paths ["java"]
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/math.numeric-tower "0.0.2"]
[java3d/vecmath "1.3.1"]
; [kephale/ode4j "0.12.0-j1.4"]
;[kephale/ode4j "20130414_001"]
[org.ode4j/core "0.2.7"]
[kephale/penumbra "0.6.7"]
[kephale/slick-util "1.0.1"]
[org.l33tlabs.twl/pngdecoder "1.0"]
[com.nitayjoffe.thirdparty.net.robowiki.knn/knn-benchmark "0.1"]
[clj-random "0.1.5"]
;[com.googlecode.efficient-java-matrix-library/ejml "0.23"]
])
|
Bump to latest beehive version | (defproject beehive-http "0.1.1-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Apache License, Version 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0"}
:java-source-paths ["src/java"]
:dependencies [[org.clojure/clojure "1.6.0"]
[com.ning/async-http-client "1.9.31"]
[net.uncontended/beehive "0.5.5"]])
| (defproject beehive-http "0.1.1-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Apache License, Version 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0"}
:java-source-paths ["src/java"]
:dependencies [[org.clojure/clojure "1.6.0"]
[com.ning/async-http-client "1.9.31"]
[net.uncontended/beehive "0.5.6"]])
|
Update Clojure dev-dependency to 1.5.1 | (defproject reiddraper/simple-check "0.5.3-SNAPSHOT"
:description "A QuickCheck inspired property-based testing library."
:url "http://github.com/reiddraper/simple-check"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies []
:profiles {:dev {:dependencies [[org.clojure/clojure "1.5.0"]
[codox-md "0.2.0" :exclusions [org.clojure/clojure]]]}}
:global-vars {*warn-on-reflection* true}
:codox {:writer codox-md.writer/write-docs}
:plugins [[codox "0.6.4"]])
| (defproject reiddraper/simple-check "0.5.3-SNAPSHOT"
:description "A QuickCheck inspired property-based testing library."
:url "http://github.com/reiddraper/simple-check"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies []
:profiles {:dev {:dependencies [[org.clojure/clojure "1.5.1"]
[codox-md "0.2.0" :exclusions [org.clojure/clojure]]]}}
:global-vars {*warn-on-reflection* true}
:codox {:writer codox-md.writer/write-docs}
:plugins [[codox "0.6.4"]])
|
Make test.check a real dependency | (defproject com.wsscode/pathom "2.0.0-beta2-SNAPSHOT"
:description "A Clojure library designed to provide a collection of helper functions to support Clojure(script) graph parsers using\nom.next graph syntax."
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:source-paths ["src"]
:dependencies [[org.clojure/clojure "1.9.0" :scope "provided"]
[org.clojure/clojurescript "1.9.671" :scope "provided"]
[org.clojure/core.async "0.3.443" :scope "provided"]
[org.clojure/math.combinatorics "0.1.4"]
[com.wsscode/spec-inspec "1.0.0-alpha2"]
[fulcrologic/fulcro "2.1.8" :scope "provided"]
[org.clojure/test.check "0.9.0" :scope "provided"]
[camel-snake-kebab "0.4.0"]]
:profiles {:dev {:source-paths ["src" "doc-examples"]}})
| (defproject com.wsscode/pathom "2.0.0-beta2-SNAPSHOT"
:description "A Clojure library designed to provide a collection of helper functions to support Clojure(script) graph parsers using\nom.next graph syntax."
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:source-paths ["src"]
:dependencies [[org.clojure/clojure "1.9.0" :scope "provided"]
[org.clojure/clojurescript "1.9.671" :scope "provided"]
[org.clojure/core.async "0.3.443" :scope "provided"]
[org.clojure/math.combinatorics "0.1.4"]
[com.wsscode/spec-inspec "1.0.0-alpha2"]
[fulcrologic/fulcro "2.1.8" :scope "provided"]
[org.clojure/test.check "0.9.0"]
[camel-snake-kebab "0.4.0"]]
:profiles {:dev {:source-paths ["src" "doc-examples"]}})
|
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.10.0.0-beta12"
: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)
|
Update dependency org.onyxplatform/onyx to version 0.7.3-20150901_140443-g6e4750b. | (defproject org.onyxplatform/onyx-datomic "0.7.2.0"
: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"}
:dependencies [[org.clojure/clojure "1.7.0"]
^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.7.2"]]
:profiles {:dev {:dependencies [[midje "1.7.0"]
[com.datomic/datomic-free "0.9.5153"]]
:plugins [[lein-midje "3.1.3"]]}
:circle-ci {:jvm-opts ["-Xmx4g"]}})
| (defproject org.onyxplatform/onyx-datomic "0.7.2.0"
: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"}
:dependencies [[org.clojure/clojure "1.7.0"]
^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.7.3-20150901_140443-g6e4750b"]]
:profiles {:dev {:dependencies [[midje "1.7.0"]
[com.datomic/datomic-free "0.9.5153"]]
:plugins [[lein-midje "3.1.3"]]}
:circle-ci {:jvm-opts ["-Xmx4g"]}})
|
Exclude clojure from dep and add ancient plugin | (defproject ring-curl "0.1.0"
:description "Converts ring requests to cURL commands"
:url "https://github.com/GentlemanHal/ring-curl"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[camel-snake-kebab "0.2.2"]
[org.clojure/tools.logging "0.3.0"]]
:profiles {:dev {:plugins [[lein-midje "3.1.3"]]
:dependencies [[org.clojure/clojure "1.6.0"]
[midje "1.6.3"]
[clj-http "1.0.0"]]}})
| (defproject ring-curl "0.1.0"
:description "Converts ring requests to cURL commands"
:url "https://github.com/GentlemanHal/ring-curl"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[camel-snake-kebab "0.2.2" :exclusions [org.clojure/clojure]]
[org.clojure/tools.logging "0.3.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"]
[clj-http "1.0.0"]]}})
|
Update Ring version to 1.6.0-beta7 | (defproject compojure "1.6.0-beta2"
:description "A concise routing library for Ring"
:url "https://github.com/weavejester/compojure"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/tools.macro "0.1.5"]
[clout "2.1.2"]
[medley "0.8.4"]
[ring/ring-core "1.6.0-beta6"]
[ring/ring-codec "1.0.1"]]
:plugins [[lein-codox "0.9.5"]]
:codox
{:output-path "codox"
:metadata {:doc/format :markdown}
:source-uri "http://github.com/weavejester/compojure/blob/{version}/{filepath}#L{line}"}
:aliases
{"test-all" ["with-profile" "default:+1.8" "test"]}
:profiles
{:dev {:jvm-opts ^:replace []
:dependencies [[ring/ring-mock "0.3.0"]
[criterium "0.4.4"]
[javax.servlet/servlet-api "2.5"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
| (defproject compojure "1.6.0-beta2"
:description "A concise routing library for Ring"
:url "https://github.com/weavejester/compojure"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/tools.macro "0.1.5"]
[clout "2.1.2"]
[medley "0.8.4"]
[ring/ring-core "1.6.0-beta7"]
[ring/ring-codec "1.0.1"]]
:plugins [[lein-codox "0.9.5"]]
:codox
{:output-path "codox"
:metadata {:doc/format :markdown}
:source-uri "http://github.com/weavejester/compojure/blob/{version}/{filepath}#L{line}"}
:aliases
{"test-all" ["with-profile" "default:+1.8" "test"]}
:profiles
{:dev {:jvm-opts ^:replace []
:dependencies [[ring/ring-mock "0.3.0"]
[criterium "0.4.4"]
[javax.servlet/servlet-api "2.5"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})
|
Upgrade leiningen to 2.0 and update version to 0.4.2-SNAPSHOT | (defproject control "0.4.1"
:description "A clojure DSL for system admin and deployment with many remote machines"
:url "https://github.com/killme2008/clojure-control"
:author "dennis zhuang(killme2008@gmail.com)"
:dependencies [[org.clojure/clojure "1.3.0"] [org.clojure/tools.cli "0.2.1"]]
:lein-release {:deploy-via :clojars}
:main control.main
:dev-dependencies [[lein-exec "0.1"]
[lein-marginalia "0.7.0"]
[lein-autodoc "0.9.0"]
[codox "0.5.0"]]
:shell-wrapper {:bin "bin/clojure-control"
:main control.main})
| (defproject control/control "0.4.2-SNAPSHOT"
:lein-release {:deploy-via :clojars}
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/tools.cli "0.2.1"]]
:author "dennis zhuang(killme2008@gmail.com)"
:profiles {:dev {:dependencies [[codox "0.5.0"]]}}
:url "https://github.com/killme2008/clojure-control"
:main control.main
:min-lein-version "2.0.0"
:shell-wrapper {:bin "bin/clojure-control", :main control.main}
:plugins [[lein-exec "0.1"]
[lein-marginalia "0.7.0"]
[lein-autodoc "0.9.0"]]
:description "A clojure DSL for system admin and deployment with many remote machines")
|
Use different opts for jepsen orchestrator | (defproject onyx-jepsen "0.1.0-SNAPSHOT"
:description "Jepsen testing Onyx"
:url "github.com/onyx-platform/onyx-jepsen"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.onyxplatform/onyx "0.9.7-SNAPSHOT"]
;[org.onyxplatform/onyx "0.9.6" ;:exclusions [org.slf4j/slf4j-nop]]
[fipp "0.6.4"]
[org.onyxplatform/onyx-metrics "0.9.6.0"]
[org.onyxplatform/onyx-bookkeeper "0.9.6.0"]
[jepsen "0.0.9"]]
;;; NOTE, don't swallow in BK
:test-selectors {:jepsen :jepsen
:test-jepsen-tests :test-jepsen-tests
:all (constantly true)}
:jvm-opts ^:replace ["-server" "-Xmx3g"]
:profiles {:uberjar {:aot [onyx-peers.launcher.aeron-media-driver
onyx-peers.launcher.launch-prod-peers]}
:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
:source-paths ["env/dev" "src"]}})
| (defproject onyx-jepsen "0.1.0-SNAPSHOT"
:description "Jepsen testing Onyx"
:url "github.com/onyx-platform/onyx-jepsen"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.onyxplatform/onyx "0.9.7-SNAPSHOT"]
;[org.onyxplatform/onyx "0.9.6" ;:exclusions [org.slf4j/slf4j-nop]]
[fipp "0.6.4"]
[org.onyxplatform/onyx-metrics "0.9.6.0"]
[org.onyxplatform/onyx-bookkeeper "0.9.6.0"]
[jepsen "0.0.9"]]
;;; NOTE, don't swallow in BK
:test-selectors {:jepsen :jepsen
:test-jepsen-tests :test-jepsen-tests
:all (constantly true)}
:jvm-opts ^:replace ["-server" "-Xmx6g" "-XX:+UseG1GC"]
:profiles {:uberjar {:aot [onyx-peers.launcher.aeron-media-driver
onyx-peers.launcher.launch-prod-peers]}
:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
:source-paths ["env/dev" "src"]}})
|
Upgrade to lein >= 2.0.0. | (defproject mtrx9 "0.1.0"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.5.1"]
[compojure "1.1.5"]
[ring/ring-jetty-adapter "1.1.6"]]
:plugins [[lein-ring "0.8.5"]]
:ring {:handler mtrx9.core/app}
:profiles
{:dev {:dependencies [[ring-mock "0.1.5"]]}}
:main mtrx9.core)
| (defproject mtrx9 "0.1.0"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.5.1"]
[compojure "1.1.5"]
[ring/ring-jetty-adapter "1.1.6"]]
:plugins [[lein-ring "0.8.5"]]
:ring {:handler mtrx9.core/app}
:profiles
{:dev {:dependencies [[ring-mock "0.1.5"]]}}
:main mtrx9.core)
|
Add the ring mock lib | (defproject doctopus "0.1.0-SNAPSHOT"
:description "An un-opinionated framework for docs on the wobs"
:url "http://github.com/Gastove/doctopus"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[joda-time/joda-time "2.6"]
[markdown-clj "0.9.63"]
[me.raynes/fs "1.4.6"]
[http-kit "2.1.16"]
[jarohen/nomad "0.7.0"]
[com.taoensso/timbre "3.4.0"]
[ring/ring-defaults "0.1.4"]
[ring/ring-core "1.3.2"]
[ring/ring-devel "1.3.2"]
[bidi "1.18.10"]
[enlive "1.1.5"]]
:plugins [[lein-marginalia "0.8.0"]]
:main ^:skip-aot doctopus.web
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
| (defproject doctopus "0.1.0-SNAPSHOT"
:description "An un-opinionated framework for docs on the wobs"
:url "http://github.com/Gastove/doctopus"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[joda-time/joda-time "2.6"]
[markdown-clj "0.9.63"]
[me.raynes/fs "1.4.6"]
[http-kit "2.1.16"]
[jarohen/nomad "0.7.0"]
[com.taoensso/timbre "3.4.0"]
[ring/ring-defaults "0.1.4"]
[ring/ring-core "1.3.2"]
[ring/ring-devel "1.3.2"]
[bidi "1.18.10"]
[enlive "1.1.5"]
[ring/ring-mock "0.2.0"]]
:plugins [[lein-marginalia "0.8.0"]]
:main ^:skip-aot doctopus.web
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
|
Update to clojure 1.6.0, fix version range message. | ;;;; This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
;;;;
;;;; gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
(defproject gorilla-repl "0.3.3-SNAPSHOT"
:description "A rich REPL for Clojure in the notebook style."
:url "https://github.com/JonyEpsilon/gorilla-repl"
:license {:name "MIT"}
:dependencies [[org.clojure/clojure "1.5.1"]
[http-kit "2.1.16"]
[ring/ring-json "0.2.0"]
[cheshire "5.0.2"]
[compojure "1.1.6"]
[org.slf4j/slf4j-api "1.7.5"]
[ch.qos.logback/logback-classic "1.0.13"]
[clojure-complete "0.2.3"]
[gorilla-renderable "1.0.0"]
[org.clojure/data.codec "0.1.0"]
[grimradical/clj-semver "0.2.0"]]
:main ^:skip-aot gorilla-repl.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
| ;;;; This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
;;;;
;;;; gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
(defproject gorilla-repl "0.3.3-SNAPSHOT"
:description "A rich REPL for Clojure in the notebook style."
:url "https://github.com/JonyEpsilon/gorilla-repl"
:license {:name "MIT"}
:dependencies [[org.clojure/clojure "1.6.0"]
[http-kit "2.1.16"]
[ring/ring-json "0.2.0"]
[cheshire "5.0.2"]
[compojure "1.1.6"]
[org.slf4j/slf4j-api "1.7.5"]
[ch.qos.logback/logback-classic "1.0.13"]
[clojure-complete "0.2.3"]
[gorilla-renderable "1.0.0"]
[org.clojure/data.codec "0.1.0"]
[grimradical/clj-semver "0.2.0" :exclusions [org.clojure/clojure]]]
:main ^:skip-aot gorilla-repl.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
|
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.10.0.0-beta1"
: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)
|
Bump cheshire dependency to 5.10.1 | (defproject buddy/buddy-core "1.10.1"
:description "Cryptographic Api for Clojure."
:url "https://github.com/funcool/buddy-core"
:license {:name "Apache 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0"}
:dependencies [[org.clojure/clojure "1.10.3" :scope "provided"]
[org.clojure/test.check "1.1.0" :scope "test"]
[commons-codec/commons-codec "1.15"]
[cheshire "5.10.0"]
[org.bouncycastle/bcprov-jdk15on "1.68"]
[org.bouncycastle/bcpkix-jdk15on "1.68"]]
:jar-name "buddy-core.jar"
:source-paths ["src"]
:java-source-paths ["src"]
:test-paths ["test"]
:global-vars {*warn-on-reflection* true}
:jar-exclusions [#"\.cljx|\.swp|\.swo|user.clj"]
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"])
| (defproject buddy/buddy-core "1.10.1"
:description "Cryptographic Api for Clojure."
:url "https://github.com/funcool/buddy-core"
:license {:name "Apache 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0"}
:dependencies [[org.clojure/clojure "1.10.3" :scope "provided"]
[org.clojure/test.check "1.1.0" :scope "test"]
[commons-codec/commons-codec "1.15"]
[cheshire "5.10.1"]
[org.bouncycastle/bcprov-jdk15on "1.68"]
[org.bouncycastle/bcpkix-jdk15on "1.68"]]
:jar-name "buddy-core.jar"
:source-paths ["src"]
:java-source-paths ["src"]
:test-paths ["test"]
:global-vars {*warn-on-reflection* true}
:jar-exclusions [#"\.cljx|\.swp|\.swo|user.clj"]
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"])
|
Prepare for next development iteration (0.1.1-SNAPSHOT) | (defproject jungerer "0.1.0"
:description "Clojure network/graph library wrapping JUNG"
:url "https://github.com/totakke/jungerer"
:license {:name "The BSD 3-Clause License"
:url "https://opensource.org/licenses/BSD-3-Clause"}
:dependencies [[org.clojure/clojure "1.8.0"]
[net.sf.jung/jung-algorithms "2.1"]
[net.sf.jung/jung-api "2.1"]
[net.sf.jung/jung-graph-impl "2.1"]
[net.sf.jung/jung-visualization "2.1"]]
:profiles {:dev {:global-vars {*warn-on-reflection* true}}
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}})
| (defproject jungerer "0.1.1-SNAPSHOT"
:description "Clojure network/graph library wrapping JUNG"
:url "https://github.com/totakke/jungerer"
:license {:name "The BSD 3-Clause License"
:url "https://opensource.org/licenses/BSD-3-Clause"}
:dependencies [[org.clojure/clojure "1.8.0"]
[net.sf.jung/jung-algorithms "2.1"]
[net.sf.jung/jung-api "2.1"]
[net.sf.jung/jung-graph-impl "2.1"]
[net.sf.jung/jung-visualization "2.1"]]
:profiles {:dev {:global-vars {*warn-on-reflection* true}}
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}})
|
Set newest versions of Clojure and Midje | (defproject theatralia "0.0.1-SNAPSHOT"
:description "Cool new project to do things and stuff"
:dependencies [[org.clojure/clojure "1.4.0"]]
:profiles {:dev {:dependencies [[midje "1.5.0"]]}})
| (defproject theatralia "0.0.1-SNAPSHOT"
:description "Cool new project to do things and stuff"
:dependencies [[org.clojure/clojure "1.6.0"]]
:profiles {:dev {:dependencies [[midje "1.6.3"]]}})
|
Add dependency hiccup and update ring to 0.8.7 | (defproject mvMusic "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.5.1"]
[compojure "1.1.5"]]
:plugins [[lein-ring "0.8.5"]]
:ring {:handler mvMusic.handler/app}
:profiles
{:dev {:dependencies [[ring-mock "0.1.5"]]}})
| (defproject mvMusic "0.1.0-SNAPSHOT"
:description "A server application for converting and downloading music with a web front end"
:url "https://github.com/DanPallas/mvMusic.git"
:dependencies [[org.clojure/clojure "1.5.1"]
[compojure "1.1.5"]
[hiccup "1.0.4"]]
:plugins [[lein-ring "0.8.7"]]
:ring {:handler mvMusic.handler/app}
:profiles
{:dev {:dependencies [[ring-mock "0.1.5"]]}})
|
Add io.aviso:pretty as a dependency | (defproject io.aviso/twixt "0.1.3"
:description "An extensible asset pipeline for Clojure web applications"
:url "https://github.com/AvisoNovate/twixt"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.logging "0.2.6"]
[ring/ring-core "1.2.0"]
[org.mozilla/rhino "1.7R4"]
[com.github.sommeri/less4j "1.1.2"]
[de.neuland/jade4j "0.3.15"]
[hiccup "1.0.4"]]
:repositories [["jade4j" "https://raw.github.com/neuland/jade4j/master/releases"]]
:repl-options {
:init-ns io.aviso.launch
:port 4001}
;; The Sublime Text nREPL plugin is out of date, so...
:repl-port 4001
:profiles {:dev {:dependencies [[log4j "1.2.17"]
[ring/ring-jetty-adapter "1.2.0"]]}})
| (defproject io.aviso/twixt "0.1.3"
:description "An extensible asset pipeline for Clojure web applications"
:url "https://github.com/AvisoNovate/twixt"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.logging "0.2.6"]
[ring/ring-core "1.2.0"]
[org.mozilla/rhino "1.7R4"]
[com.github.sommeri/less4j "1.1.2"]
[de.neuland/jade4j "0.3.15"]
[io.aviso/pretty "0.1.3"]
[hiccup "1.0.4"]]
:repositories [["jade4j" "https://raw.github.com/neuland/jade4j/master/releases"]]
:repl-options {
:init-ns io.aviso.launch
:port 4001}
;; The Sublime Text nREPL plugin is out of date, so...
:repl-port 4001
:profiles {:dev {:dependencies [[log4j "1.2.17"]
[ring/ring-jetty-adapter "1.2.0"]]}})
|
Remove old containers on startup | (ns replme.components.docker
(:require [com.stuartsierra.component :as component]
[docker.core :as docker]
[clojure.tools.logging :as log]))
(defrecord Docker [url client]
component/Lifecycle
(start [component]
(if (:client component)
component
(do (log/info (str "Connecting to docker server at " url))
(assoc component :client (docker/make-client url)))))
(stop [component]
(if-not (:client component)
component
(do (log/info "Disconnected from Docker")
(dissoc component :client)))))
(defn new-docker
[url]
(map->Docker {:url url}))
| (ns replme.components.docker
(:require [com.stuartsierra.component :as component]
[docker.core :as docker]
[docker.container :as container]
[clojure.tools.logging :as log]))
(defrecord Docker [url client]
component/Lifecycle
(start [component]
(if (:client component)
component
(do (log/info (str "Connecting to docker server at " url))
(let [client (docker/make-client url)]
(doseq [old-container (map :Id (container/show-all client))]
(container/remove client old-container :force true))
(assoc component :client client)))))
(stop [component]
(if-not (:client component)
component
(do (log/info "Disconnected from Docker")
(dissoc component :client)))))
(defn new-docker
[url]
(map->Docker {:url url}))
|
Make it a map, easier to look at. | (defproject brute "0.4.0-SNAPSHOT"
:description "A simple and lightweight Entity Component System library for writing games with Clojure"
:url "http://www.github.com/markmandel/brute"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[org.clojure/math.numeric-tower "0.0.4"]]
:plugins [[lein-codox "0.9.0"]
[lein-cljsbuild "1.1.1"]]
:cljsbuild {:builds
[{:id "src"
:source-paths ["src"]
:compiler {:output-to "target/js/src/brute.js"
:output-dir "target/js/src"
:source-map true
:optimizations :none
:pretty-print true}}
{:id "test"
:source-paths ["src" "test"]
:compiler {:output-to "target/js/test/brute.js"
:output-dir "target/js/test"
:source-map true
:optimizations :none
:pretty-print true}}]}
:profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.10"]]
:source-paths ["dev"]
:repl-options {:init-ns user}
:codox {:output-dir "doc/codox"}}}) | (defproject brute "0.4.0-SNAPSHOT"
:description "A simple and lightweight Entity Component System library for writing games with Clojure"
:url "http://www.github.com/markmandel/brute"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[org.clojure/math.numeric-tower "0.0.4"]]
:plugins [[lein-codox "0.9.0"]
[lein-cljsbuild "1.1.1"]]
:cljsbuild {:builds {:src {:source-paths ["src"]
:compiler {:output-to "target/js/src/brute.js"
:output-dir "target/js/src"
:source-map true
:optimizations :none
:pretty-print true}}
:test {:source-paths ["src" "test"]
:compiler {:output-to "target/js/test/brute.js"
:output-dir "target/js/test"
:source-map true
:optimizations :none
:pretty-print true}}}}
:profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.10"]]
:source-paths ["dev"]
:repl-options {:init-ns user}
:codox {:output-dir "doc/codox"}}}) |
Add lein-cljsbuild and a "prod" config | (defproject pomo "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[sablono "0.3.6"]]
:plugins [[lein-figwheel "0.5.0-1"]]
:clean-targets [:target-path "out" "resources/public/cljs"]
:cljsbuild {
:builds [{:id "dev"
:source-paths ["src"]
:figwheel {:on-jsload "pomo.core/render!"}
:compiler {:main pomo.core
:asset-path "cljs/out"
:output-to "resources/public/cljs/main.js"
:output-dir "resources/public/cljs/out"}
}]
}
:figwheel {
:css-dirs ["resources/public/css"]
}
)
| (defproject pomo "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[sablono "0.3.6"]]
:plugins [[lein-figwheel "0.5.0-1"]
[lein-cljsbuild "1.1.2"]]
:clean-targets [:target-path "out" "resources/public/cljs"]
:cljsbuild {
:builds [{:id "dev"
:source-paths ["src"]
:figwheel {:on-jsload "pomo.core/render!"}
:compiler {:main pomo.core
:asset-path "cljs/out"
:output-to "resources/public/cljs/main.js"
:output-dir "resources/public/cljs/out"}
}
{:id "prod"
:source-paths ["src"]
:compiler {:asset-path "cljs/out"
:output-to "resources/public/cljs/main.js"
:optimizations :advanced}
}
]
}
:figwheel {
:css-dirs ["resources/public/css"]
}
)
|
Move clojure out of proper deps. | (defproject com.draines/postal "1.10.0"
:repositories {"java.net" "http://download.java.net/maven/2"}
:dependencies [[org.clojure/clojure "1.4.0"]
[commons-codec "1.7"]
[javax.mail/mail "1.4.4"
:exclusions [javax.activation/activation]]])
| (defproject com.draines/postal "1.10.0"
:repositories {"java.net" "http://download.java.net/maven/2"}
:dependencies [[commons-codec "1.7"]
[javax.mail/mail "1.4.4"
:exclusions [javax.activation/activation]]]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.5.1"]]}
:1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}})
|
Add test for writing out assigned value. | (ns isla.test.interpreter
(:use [isla.interpreter])
(:use [isla.parser])
(:use [clojure.test])
(:use [clojure.pprint]))
(deftest integer-assignment
(let [result (interpret (parse "isla is 1"))]
(is (= (get (:ctx result) "isla")
1))))
(deftest test-single-invoke-returns-return-value
(let [result (interpret (parse "write 2"))]
(is (= (:ret result) 2))))
(deftest test-next-expression-overwrites-ret-of-previous
(let [result (interpret (parse "write 2\nwrite 3"))]
(is (= (:ret result) 3))))
(deftest test-second-not-returning-expression-removes-ret-value-of-prev
(let [result (interpret (parse "write 2"))]
(is (= (:ret result) 2)) ;; check first would have ret val
;; run test
(let [result (interpret (parse "write 2\nage is 1"))]
(is (nil? (:ret result))))))
| (ns isla.test.interpreter
(:use [isla.interpreter])
(:use [isla.parser])
(:use [clojure.test])
(:use [clojure.pprint]))
(deftest integer-assignment
(let [result (interpret (parse "isla is 1"))]
(is (= (get (:ctx result) "isla")
1))))
(deftest test-single-invoke-returns-return-value
(let [result (interpret (parse "write 2"))]
(is (= (:ret result) 2))))
(deftest test-next-expression-overwrites-ret-of-previous
(let [result (interpret (parse "write 2\nwrite 3"))]
(is (= (:ret result) 3))))
(deftest test-second-not-returning-expression-removes-ret-value-of-prev
(let [result (interpret (parse "write 2"))]
(is (= (:ret result) 2)) ;; check first would have ret val
;; run test
(let [result (interpret (parse "write 2\nage is 1"))]
(is (nil? (:ret result))))))
(deftest test-write-assigned-value
(let [result (interpret (parse "name is 'mary'\nwrite name"))]
(is (= (:ret result) "mary"))))
|
Update to latest cider version. | {:repl {:plugins [[cider/cider-nrepl "0.18.0-SNAPSHOT"]
[refactor-nrepl "2.4.0-SNAPSHOT"]]
:dependencies
[[acyclic/squiggly-clojure "0.1.9-SNAPSHOT" :exclusions [org.clojure/tools.reader]]
[compliment "0.3.5"]]}
:env {:squiggly
"{:checkers [:eastwood]
:eastwood-exclude-linters [:unlimited-use :no-ns-form-found]}"}}
| {:repl {:plugins [[refactor-nrepl "2.4.0-SNAPSHOT"]
[cider/cider-nrepl "0.20.0"]]
:dependencies
[[org.clojure/tools.nrepl "0.2.13"]
[acyclic/squiggly-clojure "0.1.9-SNAPSHOT" :exclusions [org.clojure/tools.reader]]
[compliment "0.3.5"]]}
:env {:squiggly
"{:checkers [:eastwood]
:eastwood-exclude-linters [:unlimited-use :no-ns-form-found]}"}}
|
Add helper method to reload namespaces after stopping the system | (ns user
(:require [dashboard-clj.system :as s]
[figwheel-sidecar.repl-api :as figwheel]
[com.stuartsierra.component :as component]
[clojure.tools.namespace.repl :as repl-tools]
[environ.core :refer [env]]))
;; Let Clojure warn you when it needs to reflect on types, or when it does math
;; on unboxed numbers. In both cases you should add type annotations to prevent
;; degraded performance.
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(def system)
(defn run [datasources]
(alter-var-root #'system (fn [_]
(s/start (Integer/parseInt (env :http-port)) datasources)))
(figwheel/start-figwheel!))
(defn stop []
(alter-var-root #'system component/stop)
(figwheel/stop-figwheel!))
(def browser-repl figwheel/cljs-repl)
| (ns user
(:require [dashboard-clj.core :as dashboard]
[figwheel-sidecar.repl-api :as figwheel]
[com.stuartsierra.component :as component]
[clojure.tools.namespace.repl :as repl-tools]
[environ.core :refer [env]]))
;; Let Clojure warn you when it needs to reflect on types, or when it does math
;; on unboxed numbers. In both cases you should add type annotations to prevent
;; degraded performance.
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(def system)
(defn run [ds-maps]
(alter-var-root #'system (fn [_]
(dashboard/start ds-maps {:port (Integer/parseInt (env :http-port))})))
(figwheel/start-figwheel!))
(defn stop []
(alter-var-root #'system component/stop)
(figwheel/stop-figwheel!))
(defn reload-namespaces []
(stop)
(repl-tools/refresh))
(def browser-repl figwheel/cljs-repl)
|
Add Eastwood to Clojure plugins | {:user {:dependencies [[slamhound "1.3.1"]
[org.clojure/tools.namespace "0.2.4"]
[clj-stacktrace "0.2.7"]]
:plugins [[lein-pprint "1.1.1"]
[lein-difftest "2.0.0"]
[lein-cloverage "1.0.2"]
[lein-marginalia "0.7.1"]
[lein-swank "1.4.4"]
[lein-kibit "0.0.8"]]
:injections [(let [orig (ns-resolve (doto 'clojure.stacktrace require)
'print-cause-trace)
new (ns-resolve (doto 'clj-stacktrace.repl require)
'pst)]
(alter-var-root orig (constantly (deref new))))]}}
:aliases {"slamhound" ["run" "-m" "slam.hound"]}
:source-paths ["/Users/jcf/.lein/dev"]
:search-page-size 30}}
| {:user {:dependencies [[slamhound "1.3.1"]
[org.clojure/tools.namespace "0.2.4"]
[clj-stacktrace "0.2.7"]]
:plugins [[lein-pprint "1.1.1"]
[lein-difftest "2.0.0"]
[lein-cloverage "1.0.2"]
[lein-marginalia "0.7.1"]
[lein-swank "1.4.4"]
[lein-kibit "0.0.8"]
[jonase/eastwood "0.0.2"]]
:injections [(let [orig (ns-resolve (doto 'clojure.stacktrace require)
'print-cause-trace)
new (ns-resolve (doto 'clj-stacktrace.repl require)
'pst)]
(alter-var-root orig (constantly (deref new))))]}}
:aliases {"slamhound" ["run" "-m" "slam.hound"]}
:source-paths ["/Users/jcf/.lein/dev"]
:search-page-size 30}}
|
Add example usage comment which was tried and tested | ;; Used for CSV-import of a very special file-format
(ns holston.dataimport
(:require [clojure-csv.core :as csv]
[holston.repository :as repo])
(:use [clojure.java.io :only [reader]]))
(defn take-csv [file-name]
(with-open [file (reader file-name)]
(csv/parse-csv (slurp file))))
(defn parse-row [row]
{:name (get row 4) :brewery (get row 5)})
(defn parse-tastings [file-name]
(map parse-row (rest (take-csv file-name))))
(defn import-data [file-name]
(doseq [tasting (parse-tastings file-name)]
(println "Importing" tasting)
(repo/add-tasting tasting)))
| ;; Used for CSV-import of a very special file-format
;; Example usage:
;; lein run -m holston.dataimport/import-data "/Users/auramo/Downloads/olusia.csv"
(ns holston.dataimport
(:require [clojure-csv.core :as csv]
[holston.repository :as repo])
(:use [clojure.java.io :only [reader]]))
(defn take-csv [file-name]
(with-open [file (reader file-name)]
(csv/parse-csv (slurp file))))
(defn parse-row [row]
{:name (get row 4) :brewery (get row 5)})
(defn parse-tastings [file-name]
(map parse-row (rest (take-csv file-name))))
(defn import-data [file-name]
(doseq [tasting (parse-tastings file-name)]
(println "Importing" tasting)
(repo/add-tasting tasting)))
|
Add some failing schema tests | (ns icecap.handlers.http-test
(:require [clojure.core.async :as a]
[manifold.deferred :as d]
[icecap.handlers.core :refer [execute]]
[icecap.schema :refer [check-plan]]
[icecap.handlers.http]
[aleph.http :as h]
[clojure.test :refer :all]))
(def step
{:type :http :url "http://www.example.com"})
(deftest schema-tests
(testing "valid steps"
step)))
(are [s] (nil? (check-plan s))
(def fake-response
{})
(defn fake-request
[_]
(d/success-deferred fake-response))
(deftest execute-tests
(with-redefs
[h/request fake-request]
(is (let [ch (execute step)
[result] (a/<!! (a/into [] ch))]
(= result fake-response)))))
| (ns icecap.handlers.http-test
(:require [clojure.core.async :as a]
[manifold.deferred :as d]
[icecap.handlers.core :refer [execute]]
[icecap.schema :refer [check-plan]]
[icecap.handlers.http]
[aleph.http :as h]
[clojure.test :refer :all]))
(def url
"http://www.example.com")
(def step
{:type :http :url url})
(deftest schema-tests
(testing "valid steps"
(are [s] (nil? (check-plan s))
step))
(testing "invalid steps"
(are [s expected] (= (check-plan (merge {:type :http} s))
expected)
{} '{:url missing-required-key}
{:uri url} '{:uri disallowed-key
:url missing-required-key})))
(def fake-response
{})
(defn fake-request
[_]
(d/success-deferred fake-response))
(deftest execute-tests
(with-redefs
[h/request fake-request]
(is (let [ch (execute step)
[result] (a/<!! (a/into [] ch))]
(= result fake-response)))))
|
Move ajax call to top | (ns cruncher.utils.status
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[cljs.core.async :refer [<!]]
[cruncher.communication.main :as com]
[cruncher.config :as config]
[cruncher.utils.extensions]
[cruncher.utils.views :as vlib]
[cruncher.utils.lib :as lib])
(:require-macros [cljs.core.async.macros :refer [go]]))
(defn success-handler []
(om/transact! lib/reconciler `[(status/niantic {:status true})]))
(defn error-handler []
(om/transact! lib/reconciler `[(status/niantic {:status false})]))
(defui APITest
static om/IQuery
(query [_]
[:api :connected?])
Object
(render [this]
(let [{:keys [connected?]} (om/props this)]
(dom/div nil
(vlib/button (fn [] (com/ajax-get (:api-status config/api) success-handler error-handler false))
true "Test API" "btn-default btn-xs")
(when (nil? connected?)
(com/ajax-get (:api-status config/api) success-handler error-handler false))
(if connected?
(dom/span #js {:className "label label-success"} "API connected")
(dom/span #js {:className "label label-warning"} "API not connected"))))))
(def api-test (om/factory APITest {})) | (ns cruncher.utils.status
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[cljs.core.async :refer [<!]]
[cruncher.communication.main :as com]
[cruncher.config :as config]
[cruncher.utils.extensions]
[cruncher.utils.views :as vlib]
[cruncher.utils.lib :as lib])
(:require-macros [cljs.core.async.macros :refer [go]]))
(defn success-handler []
(om/transact! lib/reconciler `[(status/niantic {:status true})]))
(defn error-handler []
(om/transact! lib/reconciler `[(status/niantic {:status false})]))
(defui APITest
static om/IQuery
(query [_]
[:api :connected?])
Object
(render [this]
(let [{:keys [connected?]} (om/props this)]
(when (nil? connected?)
(com/ajax-get (:api-status config/api) success-handler error-handler false))
(dom/div nil
(vlib/button (fn [] (com/ajax-get (:api-status config/api) success-handler error-handler false))
true "Test API" "btn-default btn-xs")
(if connected?
(dom/span #js {:className "label label-success"} "API connected")
(dom/span #js {:className "label label-warning"} "API not connected"))))))
(def api-test (om/factory APITest {})) |
Create keys that have hash collision | (ns cljs.lean-map.test.core
(:require
[cljs.test :refer-macros [deftest]]
[collection-check.core :as cc]
[clojure.test.check.generators :as gen]
[cljs.lean-map.core :as lean-map.core]))
(def gen-element
(gen/tuple gen/int))
(deftest assert-lean-map-core-map-like
(cc/assert-map-like 100 (.-EMPTY lean-map.core/PersistentHashMap) gen-element gen-element))
| (ns cljs.lean-map.test.core
(:require
[cljs.test :refer-macros [deftest]]
[collection-check.core :as cc]
[clojure.test.check.generators :as gen]
[cljs.lean-map.core :as lean-map.core]))
(defrecord BadHashNumber [num])
(extend-protocol IHash
BadHashNumber
(-hash [_]
1))
(def gen-bad-hash
(gen/fmap (partial apply ->BadHashNumber) (gen/tuple gen/int)))
(def gen-key
(gen/tuple (gen/frequency [[9 gen/int] [1 gen-bad-hash]])))
(def gen-value
(gen/tuple gen/int))
(deftest assert-lean-map-core-map-like
(cc/assert-map-like 100 (.-EMPTY lean-map.core/PersistentHashMap) gen-key gen-value))
|
Add connection to mongohq database | (ns sleuth.handler
(:use compojure.core
ring.middleware.edn
ring.middleware.json
sleuth.util
[ring.adapter.jetty :only [run-jetty]])
(:require [compojure.handler :as handler]
[compojure.route :as route]
[sleuth.auth :as auth]
[sleuth.users :as user]
[sleuth.sites :as sites]
[sleuth.events :as events]
[monger.core :as m]))
(m/connect!)
(m/set-db! (m/get-db "sleuth-dev"))
(defn wrap-dir-index
[handler]
(fn [req]
(handler (update-in req [:uri]
#(if (= "/" %) "/index.html" %)))))
(defroutes app-routes
(context "/events" [] events/event-routes)
(context "/sites" [] sites/site-routes)
(context "/auth" [] auth/auth-routes)
(route/resources "/")
(route/not-found "Not Found"))
(def app (-> app-routes
wrap-dir-index
wrap-edn-params
wrap-json-params
wrap-json-response))
(defn -main
[port]
(run-jetty app {:port (Integer. port)}))
| (ns sleuth.handler
(:use compojure.core
ring.middleware.edn
ring.middleware.json
sleuth.util
[ring.adapter.jetty :only [run-jetty]])
(:require [compojure.handler :as handler]
[compojure.route :as route]
[sleuth.auth :as auth]
[sleuth.users :as user]
[sleuth.sites :as sites]
[sleuth.events :as events]
[monger.core :as m]))
(if-let [mongo-uri (get (System/getenv) "MONGOHQ_URL")]
(m/connect-via-uri! mongo-uri)
(m/connect!))
(m/set-db! (m/get-db "sleuth-dev"))
(defn wrap-dir-index
[handler]
(fn [req]
(handler (update-in req [:uri]
#(if (= "/" %) "/index.html" %)))))
(defroutes app-routes
(context "/events" [] events/event-routes)
(context "/sites" [] sites/site-routes)
(context "/auth" [] auth/auth-routes)
(route/resources "/")
(route/not-found "Not Found"))
(def app (-> app-routes
wrap-dir-index
wrap-edn-params
wrap-json-params
wrap-json-response))
(defn -main
[port]
(run-jetty app {:port (Integer. port)}))
|
Make sure the JSON gets the correct content type | (ns attendance.server
(:require [clojure.java.io :as io]
[compojure.core :refer [GET defroutes]]
[compojure.route :refer [resources]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.middleware.gzip :refer [wrap-gzip]]
[ring.middleware.json :refer [wrap-json-body wrap-json-response]]
[environ.core :refer [env]]
[ring.adapter.jetty :refer [run-jetty]]
[attendance.google.sheets :refer [reflect-spreadsheets]])
(:gen-class))
(defroutes routes
(resources "/")
(GET "/sheets" _ (reflect-spreadsheets)))
(def http-handler
(-> routes
wrap-json-body
wrap-json-response
(wrap-defaults api-defaults)
wrap-gzip))
(defn -main [& [port]]
(let [port (Integer. (or port (env :port) 10555))]
(run-jetty http-handler {:port port :join? false})))
| (ns attendance.server
(:require [clojure.java.io :as io]
[compojure.core :refer [GET defroutes]]
[compojure.route :refer [resources]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.middleware.gzip :refer [wrap-gzip]]
[ring.middleware.json :refer [wrap-json-body wrap-json-response]]
[environ.core :refer [env]]
[ring.adapter.jetty :refer [run-jetty]]
[attendance.google.sheets :refer [reflect-spreadsheets]])
(:gen-class))
(defroutes routes
(resources "/")
(GET "/sheets" _
{:body (reflect-spreadsheets)}))
(def http-handler
(-> routes
wrap-json-body
wrap-json-response
(wrap-defaults api-defaults)
wrap-gzip))
(defn -main [& [port]]
(let [port (Integer. (or port (env :port) 10555))]
(run-jetty http-handler {:port port :join? false})))
|
Fix the test case to request the response as application/edn | (ns integration-spec
(:use speclj.core)
(:require
[org.example.server :as server]
[clj-http.client :as client]))
(describe "integration"
(with-all server (server/start-server 8080))
(it "can start the server"
(should-not-be-nil @server))
(after-all
;; start-server returns a function to stop the server, invoke it after all characteristics
;; have executed.
(@server))
(it "can get current counters"
(let [response (client/get "http://localhost:8080/counters")]
(->> response
:body
read-string
(should= {"foo" 0 "bar" 0})))))
(run-specs) | (ns integration-spec
(:use speclj.core)
(:require
[org.example.server :as server]
[clj-http.client :as client]))
(describe "integration"
(with-all server (server/start-server 8080))
;; Force the server to start up
(before-all @server)
;; And shut it down at the very end
(after-all
;; start-server returns a function to stop the server, invoke it after all characteristics
;; have executed.
(@server))
(it "can get current counters"
(let [response (client/get "http://localhost:8080/counters"
{:accept :edn})]
(->> response
:body
read-string
(should= {"foo" 0 "bar" 0})))))
(run-specs) |
Update version info and deploy to clojars. | ;(defproject cli4clj "1.6.3"
(defproject cli4clj "1.6.4-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]]]}}
)
|
Change compile-time to always emit in self hosted cljs | (ns mikron.compiler.util-macros
#?(:cljs [:require-macros mikron.compiler.util-macros]))
(defmacro compile-time
"Emits the body only at compile time."
[& body]
(when #?(:clj (not (:ns &env))
:cljs (re-matches #".*\$macros" (name (ns-name *ns*))))
`(do ~@body)))
| (ns mikron.compiler.util-macros
#?(:cljs [:require-macros mikron.compiler.util-macros]))
(defmacro compile-time
"Emits the body only at compile time."
[& body]
(when #?(:clj (not (:ns &env)))
`(do ~@body)))
|
Update Mac OS name and file types | (ns app.analysis
"GitHub releases URL analysis"
(:require
[taoensso.timbre :as timbre :refer-macros [info]]))
(defn get-os
[url]
(cond
(boolean (re-find #"windows" url)) "Windows"
(boolean (re-find #"linux" url)) "Linux"
(boolean (re-find #"mac|.dmg" url)) "Mac OS X"
:else "Other"))
(defn get-word-size
[url]
(cond
(boolean (re-find #"x86_64" url)) "64-bit"
(boolean (re-find #"x64" url)) "64-bit"
(boolean (re-find #"x86" url)) "32-bit"
:else ""))
(defn get-file-type
[url]
(cond
(boolean (re-find #".zip" url)) "Portable"
(boolean (re-find #".tar.gz" url)) "Portable"
(boolean (re-find #".dmg" url)) "Disk Image"
:else "Installer"))
(defn analyze-download-url
[asset-info]
(let [{url :browser-download-url} asset-info]
{:os (get-os url) :word-size (get-word-size url)
:file-type (get-file-type url) :url url}))
(defn build-download-map
[asset-info-vector]
(group-by :os (map analyze-download-url asset-info-vector)))
| (ns app.analysis
"GitHub releases URL analysis"
(:require
[taoensso.timbre :as timbre :refer-macros [info]]))
(defn get-os
[url]
(cond
(boolean (re-find #"windows" url)) "Windows"
(boolean (re-find #"linux" url)) "Linux"
(boolean (re-find #"mac|.dmg" url)) "macOS"
:else "Other"))
(defn get-word-size
[url]
(cond
(boolean (re-find #"x86_64" url)) "64-bit"
(boolean (re-find #"x64" url)) "64-bit"
(boolean (re-find #"x86" url)) "32-bit"
:else ""))
(defn get-file-type
[url]
(cond
(boolean (re-find #".zip" url)) "Portable"
(boolean (re-find #".tar.gz" url)) "Portable"
(boolean (re-find #"mac|.dmg" url)) "Disk Image"
:else "Installer"))
(defn analyze-download-url
[asset-info]
(let [{url :browser-download-url} asset-info]
{:os (get-os url) :word-size (get-word-size url)
:file-type (get-file-type url) :url url}))
(defn build-download-map
[asset-info-vector]
(group-by :os (map analyze-download-url asset-info-vector)))
|
Update dependencies to the latest hoplon... | #!/usr/bin/env boot
#tailrecursion.boot.core/version "2.0.0"
(set-env!
:dependencies [['tailrecursion/boot.core "2.0.0"]
['tailrecursion/boot.task "2.0.0"]
['tailrecursion/hoplon "5.0.0"]
['markdown-clj "0.9.38"]
['org.clojure/clojurescript "0.0-2156"]]
:src-paths #{"src"}
:out-path "resources/public")
(add-sync! (get-env :out-path) #{"resources/assets"})
(require
['tailrecursion.boot.task :refer :all]
['tailrecursion.hoplon.boot :refer :all])
(deftask dev
"Build hoplon.io for local development."
[]
(comp (watch) (hoplon {:pretty-print true
:prerender false
:optimizations :whitespace})))
(deftask prod
"Build hoplon.io for production deployment."
[]
(hoplon {:optimizations :advanced}))
| #!/usr/bin/env boot
#tailrecursion.boot.core/version "2.3.1"
(set-env!
:dependencies [['tailrecursion/boot.task "2.1.2"]
['tailrecursion/hoplon "5.7.0"]
['markdown-clj "0.9.41"]
['org.clojure/clojurescript "0.0-2156"]]
:src-paths #{"src"}
:out-path "resources/public")
(add-sync! (get-env :out-path) #{"resources/assets"})
(require
['tailrecursion.boot.task :refer :all]
['tailrecursion.hoplon.boot :refer :all])
(deftask dev
"Build hoplon.io for local development."
[]
(comp (watch) (hoplon {:pretty-print true
:prerender false
:optimizations :whitespace})))
(deftask prod
"Build hoplon.io for production deployment."
[]
(hoplon {:optimizations :advanced}))
|
Update and use some cool leiningen plugins | ;; See: https://github.com/kumarshantanu/lein-localrepo
{:user {:plugins [[lein-localrepo "0.5.4"]
[lein-try "0.4.3"]
;; Convert pom.xml to project.clj
;; Note: from https://github.com/thickey/lein-nevam
[lein-nevam "0.1.2"]]}}
| ;; See: https://github.com/kumarshantanu/lein-localrepo
{:user {:plugins [[lein-localrepo "0.5.4"]
[lein-try "0.4.3"]
;; Convert pom.xml to project.clj
;; Note: from https://github.com/thickey/lein-nevam
[lein-nevam "0.1.2"]
;; https://github.com/venantius/ultra
[venantius/ultra "0.5.2"]]
;; Experimental
:dependencies [[pjstadig/humane-test-output "0.8.3"]]
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}}
|
Reset textarea after message posted | (ns om-chat.components.message-composer
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom]
))
(def ESCAPE_KEY 27)
(def ENTER_KEY 13)
(defn change [c e]
(om/update-state! c assoc
:edit-text (.. e -target -value)))
(defn key-down [c id e on-new-msg]
(condp == (.-keyCode e)
ENTER_KEY
(let [msg-text (or (om/get-state c :edit-text) "")]
(on-new-msg id msg-text)
(doto e (.preventDefault) (.stopPropagation)))
nil))
(defui MessageComposer
;; static om/IQuery
;; (query [this]
;; :thread/id)
Object
(render [this]
(let [{:keys [thread/id] :as props} (om/props this)
{:keys [on-new-msg]} (om/get-computed props)]
;; (println "RENDER composer: " props)
(dom/textarea #js{:className "message-composer"
:name "message"
:value (om/get-state this :edit-text)
:onChange #(change this %)
:onKeyDown #(key-down this id % on-new-msg)})
)))
(def message-composer (om/factory MessageComposer))
| (ns om-chat.components.message-composer
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom]
))
(def ESCAPE_KEY 27)
(def ENTER_KEY 13)
(defn change [c e]
(om/update-state! c assoc
:edit-text (.. e -target -value)))
(defn key-down [c id e on-new-msg]
(condp == (.-keyCode e)
ENTER_KEY
(let [msg-text (or (om/get-state c :edit-text) "")]
(if-not (= msg-text "") (on-new-msg id msg-text))
(om/update-state! c assoc :edit-text "")
(doto e (.preventDefault) (.stopPropagation)))
nil))
(defui MessageComposer
;; static om/IQuery
;; (query [this]
;; :thread/id)
Object
(render [this]
(let [{:keys [thread/id] :as props} (om/props this)
{:keys [on-new-msg]} (om/get-computed props)]
;; (println "RENDER composer: " props)
(dom/textarea #js{:className "message-composer"
:name "message"
:value (om/get-state this :edit-text)
:onChange #(change this %)
:onKeyDown #(key-down this id % on-new-msg)})
)))
(def message-composer (om/factory MessageComposer))
|
Add handler to start load balancer | (ns router.core
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.middleware.json :refer [wrap-json-body wrap-json-response]]
[ring.util.response :refer [response]]
[router.haproxy :as h])
(:gen-class))
(def services
(atom {}))
(defn merge-services [one two]
(let [in (one :in-port)
outs (into (one :out-port) (two :out-port))]
{:in-port in
:out-port outs}))
(defn register-service [{name :name in :in-port out :out-port}]
(let [new-service {name {:in-port in
:out-port [out]}}]
(swap! services
#(merge-with merge-services % new-service))))
(defroutes app-routes
(GET "/status" [] (response (str @services)))
(POST "/register" {body :body} (register-service body))
(route/not-found "Not Found"))
(def app
(-> app-routes
(wrap-defaults api-defaults)
(wrap-json-body {:keywords? true})
(wrap-json-response)))
| (ns router.core
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.middleware.json :refer [wrap-json-body wrap-json-response]]
[ring.util.response :refer [response]]
[router.haproxy :as h])
(:gen-class))
(def services
(atom {}))
(defn merge-services [one two]
(let [in (one :in-port)
outs (into (one :out-port) (two :out-port))]
{:in-port in
:out-port outs}))
(defn register-service [{name :name in :in-port out :out-port}]
(let [new-service {name {:in-port in
:out-port [out]}}]
(swap! services
#(merge-with merge-services % new-service))))
(defroutes app-routes
(GET "/status" [] (response (str @services)))
(POST "/register" {body :body} (register-service body))
(POST "/start" [] (h/start-haproxy! @services))
(route/not-found "Not Found"))
(def app
(-> app-routes
(wrap-defaults api-defaults)
(wrap-json-body {:keywords? true})
(wrap-json-response)))
|
Bump version number, improve description | (defproject degasolv/degasolv "1.1.1-SNAPSHOT"
:description "Dependency resolver with an eye toward building software."
:url "http://github.com/djhaskin987/degasolv"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:main degasolv.cli
:dependencies [
[org.clojure/clojure "1.9.0-alpha14"]
[version-clj "0.1.2"]
[org.clojure/tools.cli "0.3.5"]
[me.raynes/fs "1.4.6"]
[com.velisco/tagged "0.5.0"]
]
:plugins [[lein-print "0.1.0"]]
:test-selectors
{
:resolve-basic :resolve-basic
:resolve-harden :resolve-harden
:string-to-requirement :string-to-requirement
:repo-aggregation :repo-aggregation
:resolve-conflict-strat :resolve-conflict-strat
}
:profiles {
:dev {:dependencies [
[org.clojure/core.match "0.3.0-alpha4"]
[version-clj "0.1.2"
:exclusions [org.clojure/clojure]]
]}
:uberjar {:aot [degasolv.cli degasolv.resolver]}
}
:target-path "target/%s")
| (defproject degasolv/degasolv "1.2.0"
:description "Dependency tracker with an eye toward building and shipping software."
:url "http://github.com/djhaskin987/degasolv"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:main degasolv.cli
:dependencies [
[org.clojure/clojure "1.9.0-alpha14"]
[version-clj "0.1.2"]
[org.clojure/tools.cli "0.3.5"]
[me.raynes/fs "1.4.6"]
[com.velisco/tagged "0.5.0"]
]
:plugins [[lein-print "0.1.0"]]
:test-selectors
{
:resolve-basic :resolve-basic
:resolve-harden :resolve-harden
:string-to-requirement :string-to-requirement
:repo-aggregation :repo-aggregation
:resolve-conflict-strat :resolve-conflict-strat
}
:profiles {
:dev {:dependencies [
[org.clojure/core.match "0.3.0-alpha4"]
[version-clj "0.1.2"
:exclusions [org.clojure/clojure]]
]}
:uberjar {:aot [degasolv.cli degasolv.resolver]}
}
:target-path "target/%s")
|
Fix a couple devcard typos | (ns zetawar.devcards.scenarios
(:require
[datascript.core :as d]
[devcards.core :as dc :include-macros true]
[integrant.core :as ig]
[posh.core :as posh]
[reagent.core :as r]
[zetawar.app :as app]
[zetawar.system :as system]
[zetawar.views :as views])
(:require-macros
[devcards.core :refer [defcard defcard-rg]]))
(defcard-rg sterlings-aruba-multiplayer-card
(let [system (ig/init system/game-config)
game-cfg (:zetwar.system/game system)
views-cfg (:zetwar.system/game-views system)]
(app/start-new-game! game-cfg :sterlings-aruba-multiplayer)
[views/board views-cfg]))
(defcard-rg city-sprawl-multiplayer-card
(let [system (ig/init system/game-config)
game-cfg (:zetwar.system/game system)
views-cfg (:zetwar.system/game-views system)]
(app/start-new-game! game-cfg :city-sprawl-multiplayer)
[views/board views-cfg]))
| (ns zetawar.devcards.scenarios
(:require
[datascript.core :as d]
[devcards.core :as dc :include-macros true]
[integrant.core :as ig]
[posh.core :as posh]
[reagent.core :as r]
[zetawar.app :as app]
[zetawar.system :as system]
[zetawar.views :as views])
(:require-macros
[devcards.core :refer [defcard defcard-rg]]))
(defcard-rg sterlings-aruba-multiplayer-card
(let [system (ig/init system/game-config)
game-cfg (:zetawar.system/game system)
views-cfg (:zetawar.system/game-views system)]
(app/start-new-game! game-cfg :sterlings-aruba-multiplayer)
[views/board views-cfg]))
(defcard-rg city-sprawl-multiplayer-card
(let [system (ig/init system/game-config)
game-cfg (:zetawar.system/game system)
views-cfg (:zetawar.system/game-views system)]
(app/start-new-game! game-cfg :city-sprawl-multiplayer)
[views/board views-cfg]))
|
Remove eastwood; it's breaking 'lein new' | {:user {:plugins [[lein-exec "0.3.0"]
[lein-depgraph "0.1.0"]
[lein-deps-tree "0.1.2"]
[jonase/eastwood "0.1.2"]]
:dependencies [[org.clojure/tools.namespace "0.2.4"]
[criterium "0.4.2"]
[slamhound "1.5.5"]]
:aliases {"slamhound" ["run" "-m" "slam.hound"]}}}
| {:user {:plugins [[lein-exec "0.3.0"]
[lein-depgraph "0.1.0"]
[lein-deps-tree "0.1.2"]]
:dependencies [[org.clojure/tools.namespace "0.2.4"]
[criterium "0.4.2"]
[slamhound "1.5.5"]]
:aliases {"slamhound" ["run" "-m" "slam.hound"]}}}
|
Break out project org, name, branch | (ns runbld.build
(:require [runbld.util.date :as date]))
(defn make-rand-uuid []
(.replaceAll (str (java.util.UUID/randomUUID)) "-" ""))
(defn make-id []
(format "%s-%s"
(date/yyyymmdd-hhmmss)
(make-rand-uuid)))
(defn wrap-build-meta [proc]
(fn [opts]
(proc (assoc opts :id (make-id)))))
| (ns runbld.build
(:require [runbld.util.date :as date]))
(defn make-rand-uuid []
(.replaceAll (str (java.util.UUID/randomUUID)) "-" ""))
(defn make-id []
(format "%s-%s"
(date/yyyymmdd-hhmmss)
(make-rand-uuid)))
(defn split-jenkins-name [s]
(let [[_ org project branch] (re-find #"^([^,]+),([^,]+),([^,]+)$" s)]
{:org org
:project project
:branch branch}))
(defn inherited-build-info [opts]
(if (get-in opts [:env "JENKINS_HOME"])
(split-jenkins-name (get-in opts [:env "JOB_NAME"]))))
(defn wrap-build-meta [proc]
(fn [opts]
(proc (assoc opts
:build (merge
{:id (make-id)}
(inherited-build-info opts))))))
|
Break out the show/render methods into funtions so Refresh redefines them | (ns {{namespace}}
(:import [com.badlogic.gdx Game Gdx Graphics Screen]
[com.badlogic.gdx.graphics Color GL20]
[com.badlogic.gdx.graphics.g2d BitmapFont]
[com.badlogic.gdx.scenes.scene2d Stage]
[com.badlogic.gdx.scenes.scene2d.ui Label Label$LabelStyle]))
(def main-screen
(let [stage (atom nil)]
(proxy [Screen] []
(show []
(reset! stage (Stage.))
(let [style (Label$LabelStyle. (BitmapFont.) (Color. 1 1 1 1))
label (Label. "Hello world!" style)]
(.addActor @stage label)))
(render [delta]
(.glClearColor (Gdx/gl) 0 0 0 0)
(.glClear (Gdx/gl) GL20/GL_COLOR_BUFFER_BIT)
(doto @stage
(.act delta)
(.draw)))
(dispose [])
(hide [])
(pause [])
(resize [w h])
(resume []))))
(gen-class
:name {{package}}.Game
:extends com.badlogic.gdx.Game)
(defn -create [^Game this]
(.setScreen this main-screen))
| (ns {{namespace}}
(:import [com.badlogic.gdx Game Gdx Graphics Screen]
[com.badlogic.gdx.graphics Color GL20]
[com.badlogic.gdx.graphics.g2d BitmapFont]
[com.badlogic.gdx.scenes.scene2d Stage]
[com.badlogic.gdx.scenes.scene2d.ui Label Label$LabelStyle]))
(defn show
[stage]
(let [style (Label$LabelStyle. (BitmapFont.) (Color. 1 1 1 1))
label (Label. "Hello world!" style)]
(.addActor stage label)))
(defn render
[stage delta]
(.glClearColor (Gdx/gl) 0 0 0 0)
(.glClear (Gdx/gl) GL20/GL_COLOR_BUFFER_BIT)
(doto stage
(.act delta)
(.draw)))
(def main-screen
(let [stage (atom nil)]
(proxy [Screen] []
(show [] (show (reset! stage (Stage.))))
(render [delta] (render @stage delta))
(dispose [])
(hide [])
(pause [])
(resize [w h])
(resume []))))
(gen-class
:name {{package}}.Game
:extends com.badlogic.gdx.Game)
(defn -create [^Game this]
(.setScreen this main-screen))
|
Add working query parameter reading | (ns leftpad.handler
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.json :refer [wrap-json-response]]
[ring.util.response :refer [response]]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
(defroutes app-routes
(GET "/" [] (response {:foo "bar"}))
(route/not-found "Not Found"))
(def app
(wrap-json-response app-routes site-defaults))
| (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)))
|
Change the demo page for excepton reporting to be more involved | (ns io.aviso.launch
(use io.aviso.twixt
[io.aviso.twixt exceptions tracker]
ring.adapter.jetty)
(import [java.sql SQLException]))
(defn handler [request]
(trace "Invoking handler (that throws exceptions)"
(throw
(->>
(SQLException. "Inner Exception" "SQL-STATE", 999)
(RuntimeException. "Middle Exception")
(IllegalArgumentException. "Outer Exception")))))
(defn app []
(let [twixt (new-twixt {:development-mode true})]
(->
handler
(wrap-with-twixt twixt)
(wrap-with-exception-reporting twixt))))
(defn launch []
(let [server (run-jetty (app) {:port 8888 :join? false})]
#(.stop server))) | (ns io.aviso.launch
(use io.aviso.twixt
[io.aviso.twixt exceptions tracker]
ring.adapter.jetty))
(defn make-handler [twixt]
(fn [request]
(trace "Invoking handler (that throws exceptions)"
;; This will fail at some depth:
(get-asset-uri twixt "invalid-coffeescript.coffee"))))
(defn app []
(let [twixt (new-twixt {:development-mode true})]
(->
(make-handler twixt)
(wrap-with-twixt twixt)
(wrap-with-exception-reporting twixt))))
(defn launch []
(let [server (run-jetty (app) {:port 8888 :join? false})]
#(.stop server))) |
Update Jetty dependency to 9.4.12.v20180830 | (defproject ring/ring-jetty-adapter "1.7.0"
:description "Ring Jetty adapter."
:url "https://github.com/ring-clojure/ring"
:scm {:dir ".."}
:license {:name "The MIT License"
:url "http://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.7.0"]
[ring/ring-core "1.7.0"]
[ring/ring-servlet "1.7.0"]
[org.eclipse.jetty/jetty-server "9.2.24.v20180105"]]
:aliases {"test-all" ["with-profile" "default:+1.8:+1.9" "test"]}
:profiles
{:dev {:dependencies [[clj-http "2.2.0"]]
:jvm-opts ["-Dorg.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT=500"]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}})
| (defproject ring/ring-jetty-adapter "1.7.0"
:description "Ring Jetty adapter."
:url "https://github.com/ring-clojure/ring"
:scm {:dir ".."}
:license {:name "The MIT License"
:url "http://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.7.0"]
[ring/ring-core "1.7.0"]
[ring/ring-servlet "1.7.0"]
[org.eclipse.jetty/jetty-server "9.4.12.v20180830"]]
:aliases {"test-all" ["with-profile" "default:+1.8:+1.9" "test"]}
:profiles
{:dev {:dependencies [[clj-http "2.2.0"]]
:jvm-opts ["-Dorg.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT=500"]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}})
|
Fix logging for responses without status | (ns buildviz.main
(:require [buildviz.build-results :as results]
[buildviz.handler :as handler]
[buildviz.storage :as storage]
[clojure.tools.logging :as log]))
(def jobs-filename "buildviz_jobs")
(def tests-filename "buildviz_tests")
(defn- wrap-log-request [handler]
(fn [req]
(let [resp (handler req)
method (.toUpperCase (name (:request-method req)))
uri (:uri req)
status (:status resp)]
(log/info (format "\"%s %s\" %s" method uri status))
resp)))
(defn- wrap-log-errors [handler]
(fn [req]
(let [resp (handler req)
status (:status resp)
body (:body resp)
uri (:uri req)]
(when (>= status 400)
(log/warn (format "Returned %s for %s: \"%s\"" status uri body)))
resp)))
(defn- persist-jobs! [build-data]
(storage/store-jobs! build-data jobs-filename))
(defn- persist-tests! [tests-data]
(storage/store-jobs! tests-data tests-filename))
(def app
(let [builds (atom (storage/load-jobs jobs-filename))
tests (atom (storage/load-jobs tests-filename))] ; TODO hide atom inside record
(-> (handler/create-app (results/build-results builds tests) persist-jobs! persist-tests!)
wrap-log-request
wrap-log-errors)))
| (ns buildviz.main
(:require [buildviz.build-results :as results]
[buildviz.handler :as handler]
[buildviz.storage :as storage]
[clojure.tools.logging :as log]))
(def jobs-filename "buildviz_jobs")
(def tests-filename "buildviz_tests")
(defn- wrap-log-request [handler]
(fn [req]
(let [resp (handler req)
method (.toUpperCase (name (:request-method req)))
uri (:uri req)
status (:status resp)]
(log/info (format "\"%s %s\" %s" method uri status))
resp)))
(defn- wrap-log-errors [handler]
(fn [req]
(let [resp (handler req)
status (:status resp)
body (:body resp)
uri (:uri req)]
(when (and (some? status) (>= status 400))
(log/warn (format "Returned %s for %s: \"%s\"" status uri body)))
resp)))
(defn- persist-jobs! [build-data]
(storage/store-jobs! build-data jobs-filename))
(defn- persist-tests! [tests-data]
(storage/store-jobs! tests-data tests-filename))
(def app
(let [builds (atom (storage/load-jobs jobs-filename))
tests (atom (storage/load-jobs tests-filename))] ; TODO hide atom inside record
(-> (handler/create-app (results/build-results builds tests) persist-jobs! persist-tests!)
wrap-log-request
wrap-log-errors)))
|
Fix require expression in markdown-spec. | (ns incise.parsers.impl.markdown-spec
(:require [speclj.core :refer :all]
[clojure.java.io :refer [file resource]]
[incise.core] ; Ensure that layouts have been loaded
(incise.parsers [core :as pc]
[markdown :refer :all]))
(:import [java.io File]))
(describe "parsing"
(with markdown-file (file (resource "spec/another-forgotten-binding-pry.md")))
(it "does something"
(should= "" (pc/Parse->string (parse @markdown-file)))))
(run-specs)
| (ns incise.parsers.impl.markdown-spec
(:require [speclj.core :refer :all]
[clojure.java.io :refer [file resource]]
[incise.core] ; Ensure that layouts have been loaded
[incise.parsers.core :as pc]
[incise.parsers.impl.markdown :refer :all])
(:import [java.io File]))
(describe "parsing"
(with markdown-file (file (resource "spec/another-forgotten-binding-pry.md")))
(it "does something"
(should= "" (pc/Parse->string (parse @markdown-file)))))
(run-specs)
|
Set cljs compiler as provided scope dependency. | (defproject funcool/postal "0.1.0-SNAPSHOT"
:description "A parser, renderer and validation layer for POSTAL protocol for Clojure and ClojureScript."
:url "http://github.com/funcool/postal"
:license {:name "BSD (2-Clause)"
:url "http://opensource.org/licenses/BSD-2-Clause"}
:source-paths ["src"]
:jar-exclusions [#"\.swp|\.swo|user.clj"]
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
:dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
[org.clojure/tools.reader "0.10.0-alpha1"]
[funcool/cuerdas "0.5.0"]]
:profiles {:dev {:dependencies [[org.clojure/clojurescript "0.0-3308"]]}})
| (defproject funcool/postal "0.1.0-SNAPSHOT"
:description "A parser, renderer and validation layer for POSTAL protocol for Clojure and ClojureScript."
:url "http://github.com/funcool/postal"
:license {:name "BSD (2-Clause)"
:url "http://opensource.org/licenses/BSD-2-Clause"}
:source-paths ["src"]
:jar-exclusions [#"\.swp|\.swo|user.clj"]
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
:dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
[org.clojure/clojurescript "0.0-3308" :scope "provided"]
[org.clojure/tools.reader "0.10.0-alpha1"]
[funcool/cuerdas "0.5.0"]])
|
Update dependency clj-http:clj-http to v3.10.3 | (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.1"]
[incanter/incanter-core "1.9.3"]
[incanter/incanter-charts "1.9.3"]
[incanter/incanter-io "1.9.3"]
[org.clojure/data.json "1.0.0"]
[clj-http "3.10.2"]
[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.1"]
[incanter/incanter-core "1.9.3"]
[incanter/incanter-charts "1.9.3"]
[incanter/incanter-io "1.9.3"]
[org.clojure/data.json "1.0.0"]
[clj-http "3.10.3"]
[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}})
|
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.10.0.0-beta9"
: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. | (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)
|
Add release tasks for gh-pages site. | (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"]])
|
Move speclj to dev dependencies. | (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/"])
|
Include :java6 in :default profile. | (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"]]}})
|
Add basic cljsbuild release build | (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" })
|
Revert back to snapshot version. | (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]]]}}
)
|
Exclude some unused deps for size | (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]]]}})
|
Prepare for next release cycle. | (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)
|
Update dependency lein-cljfmt:lein-cljfmt to v0.8.0 | (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 the name to be more standard with other clojure libs | (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"]]}})
|
Add proper version number and url | (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)
|
Enable logging and server logging via timbre | (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}})
|
Add initial clojure leftpad implementation | (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)))
|
Fix bug if all touched registers driven negative | (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)))
|
Use latest version of clojure | (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/"}})
|
Bump jline version to get rid of jlinerc message | (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)
|
Add watchtower, markdown and namespace deps. | (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)
|
Prepare for next release cycle. | (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)
|
Fix the test (in an unfortunate fashion) | (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"))})))
|
Make the git clone test a little more specific | (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)) |
Use log fn instead of macro on cljs | (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)))
|
Initialize webworker only on browser environment. | ;; 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")))
|
Switch the messenger inbound-ch to a sliding buffer | (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}))
|
Fix the JNDI name for the datasource | (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!))
|
Load message by entity-id from search | (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)))
|
Add test-ns-setup to the new test file | (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 a test for secretbox-pfx | (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)))))
|
Use apply and a list. | (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"))})
|
Add piggieback to local profile | (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"]]}})
|
Synchronize topic listeners to account for slow CI hardware. | (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"})))
|
Add command config argument cardinalities | {
: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",
}
|
Update Jetty to version 9.4.44 | (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"]]}})
|
Reset counter so the test can be run multiple times in repl. | (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))))))
|
Update clj-http to fix error with Clojure 1.8 | (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"]]}})
|
Add a workaround for bug in Leiningen 1.6.2. | (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))
|
Make page background a tad lighter | (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"}]])
|
Replace hyphen in filename with underscore & rename ns | (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)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.