(ns devcards.discuss.add-statements
  (:require [devcards.core :as dc :refer-macros [defcard defcard-om-next]]
            [discuss.parser :as parser]
            [discuss.views :as views]
            [devcards.discuss.utils :as dutils]
            [om.next :as om]))

(defcard shortcuts dutils/shortcuts)

(def sample-api-route "/town-has-to-cut-spending/justify/37/agree?history=/attitude/37")

(def ^:private stmts-reconciler
  (om/reconciler {:state (assoc @(om/app-state parser/reconciler) :api/last-call sample-api-route)
                  :parser (om/parser {:read parser/read :mutate parser/mutate})}))

(defcard-om-next main-content-view
  views/MainContentView
  parser/reconciler)

(defcard-om-next add-new-statement
  views/AddElement
  parser/reconciler)

(ns devcards.discuss.add-statements
  (:require [devcards.core :as dc :refer-macros [defcard defcard-om-next]]
            [discuss.parser :as parser]
            [discuss.views :as views]
            [devcards.discuss.utils :as dutils]
            [om.next :as om]
            [discuss.utils.common :as lib]))

(defcard shortcuts
  dutils/shortcuts)

(def sample-api-route "/town-has-to-cut-spending/justify/37/agree?history=/attitude/37")

(defcard-om-next main-content-view
  views/MainContentView
  parser/reconciler)

(dc/defcard-doc
  "Do request to the following Route:"
  sample-api-route)

(defcard-om-next add-new-statement
  views/AddElement
  parser/reconciler)

Prepare defcard to add new statements

Prepare defcard to add new statements


(ns leiningen.new.devcards
  (:require [leiningen.new.templates :refer [renderer name-to-path ->files]]
            [leiningen.core.main :as main]))

(def render (renderer "devcards"))

(defn devcards
  [name]
  (let [data {:name name
              :sanitized (name-to-path name)}]
    (main/info (str "Generating fresh 'lein new' devcards project.\n"
                    "cd into your project directory\n"
                    "Run 'lein figwheel' and then open localhost:3449/cards.html in your browser."
                    ""))
    (->files data
             ["project.clj" (render "project.clj" data)]
             ["resources/public/cards.html" (render "resources/index.html" data)]
             ["resources/public/index.html" (render "resources/app_index.html" data)]
             ["resources/public/css/{{sanitized}}_style.css" (render "style.css" data)]
             ["src/{{sanitized}}/core.cljs" (render "core.cljs" data)])))

(ns leiningen.new.devcards
  (:require [leiningen.new.templates :refer [renderer name-to-path ->files]]
            [leiningen.core.main :as main]))

(def render (renderer "devcards"))

(defn devcards
  [name]
  (let [data {:name name
              :sanitized (name-to-path name)}]
    (main/info (str "Generating fresh 'lein new' devcards project.\n"
                    "cd into your project directory\n"
                    "Run 'lein figwheel' and then open http://localhost:3449/cards.html in your browser."
                    ""))
    (->files data
             ["project.clj" (render "project.clj" data)]
             ["resources/public/cards.html" (render "resources/index.html" data)]
             ["resources/public/index.html" (render "resources/app_index.html" data)]
             ["resources/public/css/{{sanitized}}_style.css" (render "style.css" data)]
             ["src/{{sanitized}}/core.cljs" (render "core.cljs" data)])))

Make the URL to cards.html clickable

Make the URL to cards.html clickable

Many terminal emulators (such as iTerm) will recognize a URL and let you click it, but only if it includes the scheme.


{:user {:plugins [[lein-ancient "0.6.10"]
                  [lein-cljfmt "0.5.6"]
                  [lein-kibit "0.1.5" :exclusions [org.clojure/clojure]]
                  [lein-cloverage "1.0.9"]]}}

{:user {:plugins [[lein-ancient "0.6.10"]
                  [lein-cljfmt "0.5.6"]
                  [lein-kibit "0.1.5" :exclusions [org.clojure/clojure]]
                  [lein-cloverage "1.0.9"]
                  [jonase/eastwood "0.2.4"]]}}

Add eastwood to lein profile

Add eastwood to lein profile


(ns circle.init
  ;; (:require circle.swank)
  (:require circle.db)
  (:require circle.web)
  (:require circle.repl)
  (:require circle.logging)
  ;; (:require circle.backend.nodes
  ;;           circle.backend.project.rails
  ;;           circle.backend.project.circle)
  )

(def init*
  (delay
   (try
     (circle.logging/init)
     ;; workaround for Heroku not liking us starting up swank
     (when (System/getenv "SWANK")
       (require 'circle.swank)
       (.invoke (ns-resolve 'circle.swank 'init)))
     (circle.db/init)
     (circle.web/init)
     (circle.repl/init)
     (println (java.util.Date.))
     true
     (catch Exception e
       (println "caught exception on startup:")
       (.printStackTrace e)
       (println "exiting")
       (System/exit 1)))))

(defn init
  "Start everything up. idempotent."
  []
  @init*)

(defn -main []
  (init))

(ns circle.init
  ;; (:require circle.swank)
  (:require circle.db)
  (:require circle.web)
  (:require circle.repl)
  (:require circle.logging)
  ;; (:require circle.backend.nodes
  ;;           circle.backend.project.rails
  ;;           circle.backend.project.circle)
  (:gen-class :main true)
  )

(def init*
  (delay
   (try
     (circle.logging/init)
     ;; workaround for Heroku not liking us starting up swank
     (when (System/getenv "SWANK")
       (require 'circle.swank)
       (.invoke (ns-resolve 'circle.swank 'init)))
     (circle.db/init)
     (circle.web/init)
     (circle.repl/init)
     (println (java.util.Date.))
     true
     (catch Exception e
       (println "caught exception on startup:")
       (.printStackTrace e)
       (println "exiting")
       (System/exit 1)))))

(defn init
  "Start everything up. idempotent."
  []
  @init*)

(defn -main []
  (init))

Add :gen-class for main, removing one of two bugs preventing `lein uberjar` from working.

The other is that midje requires :skip-aot, which of course prevents jars from being properly generated.


(defproject mvxcvi/vault "0.3.0-SNAPSHOT"
  :description "Content-addressable data store."
  :url "https://github.com/greglook/vault"
  :license {:name "Public Domain"
            :url "http://unlicense.org/"}

  :dependencies
  [[byte-streams "0.1.10"]
   [clj-time "0.7.0"]
   [environ "0.5.0"]
   [potemkin "0.3.4"]
   [mvxcvi/clj-pgp "0.5.2"]
   [mvxcvi/puget "0.5.2"]
   [org.clojure/clojure "1.6.0"]
   [org.clojure/data.codec "0.1.0"]
   [prismatic/schema "0.2.3"]]

  :hiera
  {:cluster-depth 2
   :ignore-ns #{clojure byte-streams clj-time potemkin}}

  :profiles
  {:coverage
   {:plugins
    [[lein-cloverage "1.0.2"]]}

   :tool
   {:dependencies
    [[mvxcvi/directive "0.4.2"]
     [org.clojure/tools.namespace "0.2.4"]]
    :jvm-opts []
    :repl-options {:init-ns vault.system}
    :source-paths ["tool"]}

   :repl [:tool]})

(defproject mvxcvi/vault "0.3.0-SNAPSHOT"
  :description "Content-addressable data store."
  :url "https://github.com/greglook/vault"
  :license {:name "Public Domain"
            :url "http://unlicense.org/"}

  :dependencies
  [[byte-streams "0.1.11"]
   [clj-time "0.7.0"]
   [environ "0.5.0"]
   [potemkin "0.3.4"]
   [mvxcvi/clj-pgp "0.5.2"]
   [mvxcvi/puget "0.6.2"]
   [org.clojure/clojure "1.6.0"]
   [org.clojure/data.codec "0.1.0"]
   [prismatic/schema "0.2.4"]]

  :hiera
  {:cluster-depth 2
   :ignore-ns #{clojure byte-streams clj-time potemkin}}

  :profiles
  {:coverage
   {:plugins
    [[lein-cloverage "1.0.2"]]}

   :tool
   {:dependencies
    [[mvxcvi/directive "0.4.2"]
     [org.clojure/tools.namespace "0.2.4"]]
    :jvm-opts []
    :repl-options {:init-ns vault.system}
    :source-paths ["tool"]}

   :repl [:tool]})

Update puget, schema, and byte-streams dependencies.


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

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

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

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

Change version back to snapshot

Change version back to snapshot


(defproject cli4clj "1.5.0"
;(defproject cli4clj "1.5.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
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.3.3"] [lein-html5-docs "3.0.3"]]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.6" :exclusions  [org.clojure/clojure]]]}}
)

;(defproject cli4clj "1.5.0"
(defproject cli4clj "1.5.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
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.3.3"] [lein-html5-docs "3.0.3"]]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.6" :exclusions  [org.clojure/clojure]]]}}
)

Revert back to snapshot version.

Revert back to snapshot version.


(defproject dependable "0.1.0-SNAPSHOT"
            :description "Dependency resolution for the impatient."
            :url "http://example.com/FIXME"
            :license {:name "Eclipse Public License"
                      :url "http://www.eclipse.org/legal/epl-v10.html"}
            :dependencies [[org.clojure/clojure "1.8.0"]
                           [org.clojure/core.match "0.3.0-alpha4"]]
            :main ^:skip-aot dependable.core
            :target-path "target/%s"
            :test-selectors
            {
             :default :resolve-basic
             :resolve-basic :resolve-basic
             :resolve-harden :resolve-harden
             }
            :profiles {:uberjar {:aot :all}})

(defproject dependable "0.1.0"
            :description "Dependency resolution for the impatient."
            :url "http://example.com/FIXME"
            :license {:name "Eclipse Public License"
                      :url "http://www.eclipse.org/legal/epl-v10.html"}
            :dependencies [[org.clojure/clojure "1.8.0"]
                           [org.clojure/core.match "0.3.0-alpha4"]]
            :main ^:skip-aot dependable.core
            :target-path "target/%s"
            :test-selectors
            {
             :default :resolve-basic
             :resolve-basic :resolve-basic
             :resolve-harden :resolve-harden
             }
            :profiles {:uberjar {:aot :all}})

Bump version number to 0.1.0

Bump version number to 0.1.0


(ns bytebuf.bytes
  (:import java.util.Arrays
           java.security.SecureRandom))

(defn random-bytes
  "Generate a byte array of scpecified length with random
  bytes taken from secure random number generator.
  This method should be used for generate a random
  iv/salt or arbitrary length."
  ([^long numbytes]
   (random-bytes numbytes (SecureRandom.)))
  ([^long numbytes ^SecureRandom sr]
   (let [buffer (byte-array numbytes)]
     (.nextBytes sr buffer)
     buffer)))

(defn slice
  "Given a byte array, get a copy of it. If offset
  and limit is provided, a slice will be returned."
  [^bytes input ^long offset ^long limit]
  (Arrays/copyOfRange input offset limit))

(defn zeropad!
  "Add zero byte padding to the given byte array
  to the remaining bytes after specified data length."
  [^bytes input ^long datalength]
  (Arrays/fill input datalength (count input) (byte 0)))

(defn zeropad-count
  "Given a byte array, returns a number of bytes
  allocated with zero padding (zero byte)."
  [^bytes input]
  (let [mark (byte 0)]
    (reduce (fn [sum index]
              (let [value (aget input index)]
                (if (= value mark)
                  (inc sum)
                  (reduced sum))))
            0
            (reverse (range (count input))))))

(ns bytebuf.bytes
  (:import java.util.Arrays
           java.security.SecureRandom))

(defn random-bytes
  "Generate a byte array of scpecified length with random
  bytes taken from secure random number generator.
  This method should be used for generate a random
  iv/salt or arbitrary length."
  ([^long numbytes]
   (random-bytes numbytes (SecureRandom.)))
  ([^long numbytes ^SecureRandom sr]
   (let [buffer (byte-array numbytes)]
     (.nextBytes sr buffer)
     buffer)))

(defn slice
  "Given a byte array, get a copy of it. If offset
  and limit is provided, a slice will be returned."
  [^bytes input ^long offset ^long limit]
  (Arrays/copyOfRange input offset limit))

(defn equals?
  "Check if two byte arrays are equals."
  [^bytes a ^bytes b]
  (Arrays/equals a b))

(defn zeropad!
  "Add zero byte padding to the given byte array
  to the remaining bytes after specified data length."
  [^bytes input ^long datalength]
  (Arrays/fill input datalength (count input) (byte 0)))

(defn zeropad-count
  "Given a byte array, returns a number of bytes
  allocated with zero padding (zero byte)."
  [^bytes input]
  (let [mark (byte 0)]
    (reduce (fn [sum index]
              (let [value (aget input index)]
                (if (= value mark)
                  (inc sum)
                  (reduced sum))))
            0
            (reverse (range (count input))))))

Add simple function for check byte array equality.


(ns juxt.crux.demo.foo
  (:require
    crux.api
    [yada.yada :as yada]
    [integrant.core :as ig]))

(def id #uuid "50005565-299f-4c08-86d0-b1919bf4b7a9")

(defmethod ig/init-key ::read-write
  [_ {:keys [system]}]
  (yada/resource
    {:id ::read-write
     :methods
     {:get
      {:produces ["text/html" "application/edn" "application/json"]
       :response (fn [ctx]
                   (let [db (crux.api/db system)]
                     (map
                       #(crux.api/entity db (first %))
                       (crux.api/q
                         db
                         {:find '[?e]
                          :where [['?e :crux.db/id id]]}))))}
      :post
      {:produces "text/plain"
       :consumes "application/edn"
       :response
       (fn [ctx]
         (crux.api/submit-tx
           system
           [[:crux.tx/put id
             (merge {:crux.db/id id} (:body ctx))]])
         (yada/redirect ctx ::read-write))}}}))

;; To populate data using cURL:
; $ curl -H "Content-Type: application/edn" -d '{:foo/username "Bart"}' localhost:8300

(ns juxt.crux.demo.foo
  (:require
    crux.api
    [yada.yada :as yada]
    [integrant.core :as ig]))

(def id #uuid "50005565-299f-4c08-86d0-b1919bf4b7a9")

(defmethod ig/init-key ::read-write
  [_ {:keys [system]}]
  (yada/resource
    {:id ::read-write
     :methods
     {:get
      {:produces ["text/html" "application/edn" "application/json"]
       :response (fn [ctx]
                   (let [db (crux.api/db system)]
                     (map
                       #(crux.api/entity db (first %))
                       (crux.api/q
                         db
                         {:find '[?e]
                          :where [['?e :crux.db/id id]]}))))}
      :post
      {:produces "text/plain"
       :consumes "application/edn"
       :response
       (fn [ctx]
         (crux.api/submit-tx
           system
           [[:crux.tx/put (merge {:crux.db/id id} (:body ctx))]])
         (yada/redirect ctx ::read-write))}}}))

;; To populate data using cURL:
; $ curl -H "Content-Type: application/edn" -d '{:foo/username "Bart"}' localhost:8300

Update crux example app with new put api


(ns decktouch.handler
  (:require [decktouch.dev :refer [browser-repl start-figwheel]]
            [compojure.core :refer [GET defroutes]]
            [compojure.route :refer [not-found resources]]
            [ring.middleware.defaults :refer [site-defaults wrap-defaults]]
            [selmer.parser :refer [render-file]]
            [environ.core :refer [env]]
            [prone.middleware :refer [wrap-exceptions]]))

(defroutes routes
  (GET "/" [] (render-file "templates/index.html" {:dev (env :dev?)}))
  (resources "/")
  (not-found "Not Found"))

(def app
  (let [handler (wrap-defaults routes site-defaults)]
    (if (env :dev?) (wrap-exceptions handler) handler)))

(ns decktouch.handler
  (:require [decktouch.dev :refer [browser-repl start-figwheel]]
            [compojure.core :refer [GET defroutes]]
            [compojure.route :refer [not-found resources]]
            [ring.middleware.defaults :refer [site-defaults wrap-defaults]]
            [selmer.parser :refer [render-file]]
            [environ.core :refer [env]]
            [prone.middleware :refer [wrap-exceptions]]
            [decktouch.mtg-card-master :as mtg-card-master]
            [clojure.data.json :as json]))

(defroutes routes
  (GET "/" [] (render-file "templates/index.html" {:dev (env :dev?)}))
  (GET "/data/input/:query" [query]
       (json/write-str
         (mtg-card-master/get-cards-matching-query query)))
  (resources "/")
  (not-found "Not Found"))

(def app
  (let [handler (wrap-defaults routes site-defaults)]
    (if (env :dev?) (wrap-exceptions handler) handler)))

Add route for querying card master

Add route for querying card master


(defproject get-here "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/data.csv "0.1.2"]
                 [clj-time "0.7.0"]
                 [aysylu/loom "0.4.2"]
                 [ring "1.3.0"]
                 [ring/ring-jetty-adapter "1.3.0"]
                 [ring/ring-json "0.3.1"]
                 [cheshire "5.3.1"]
                 [compojure "1.1.8"]
                 [org.clojure/core.memoize "0.5.6"]]

  :main get-here.core

  :profiles {:dev {:main get-here.core/-dev-main}}

  :min-lein-version "2.0.0"
  :uberjar-name "get-here.jar")

(defproject get-here "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/data.csv "0.1.2"]
                 [clj-time "0.7.0"]
                 [aysylu/loom "0.4.2"]
                 [ring "1.3.0"]
                 [ring/ring-jetty-adapter "1.3.0"]
                 [ring/ring-json "0.3.1"]
                 [cheshire "5.3.1"]
                 [compojure "1.1.8"]
                 [org.clojure/core.memoize "0.5.6"]]

  :main get-here.core

  :profiles {:dev {:main get-here.core/-dev-main}}

  :min-lein-version "2.0.0"
  :jar-name "get-here.jar"
  :uberjar-name "get-standalone-here.jar")

Rename jars, upgrade to Clojure 1.6

Rename jars, upgrade to Clojure 1.6


(defproject uruk "0.2.0-SNAPSHOT"
  :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.5"]
                 ;; 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.0.8"]]
  :repositories [["MarkLogic-releases" "http://developer.marklogic.com/maven2"]])

(defproject uruk "0.2.1"
  :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.5"]
                 ;; 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.0.8"]]
  :repositories [["MarkLogic-releases" "http://developer.marklogic.com/maven2"]])

Bump to version 0.2.1 - hotfix for error handling


(defproject dungeon-crusade "0.0.1-SNAPSHOT"
  :description "dungeon-crusade"
  :plugins      [[lein-marginalia "0.7.1"]
                 [lein-kibit "0.0.8"]]
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/core.async "0.1.303.0-886421-alpha"]
                 [org.clojure/tools.reader "0.8.4"]
                 [org.clojure/core.typed "0.2.44"]
                 [org.clojure/math.combinatorics "0.0.7"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [org.clojars.vishk/algotools "0.1.0"]
                 [net.mikera/clisk "0.9.1-SNAPSHOT"]
                 [com.palletops/thread-expr "1.3.0"]
                 [tinter "0.1.1-SNAPSHOT"]
                 [clj-tiny-astar "0.1.0-SNAPSHOT"]
                 [dorothy "0.0.3"]
                 [com.taoensso/timbre "3.2.1"]
                 [org.clojars.folcon/clojure-lanterna "0.9.5-SNAPSHOT"]]
  :main dungeon-crusade.core
  :repl-init dungeon-crusade.main)

(defproject dungeon-crusade "0.0.1-SNAPSHOT"
  :description "dungeon-crusade"
  :plugins      [[lein-marginalia "0.7.1"]
                 [lein-kibit "0.0.8"]]
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/core.async "0.1.303.0-886421-alpha"]
                 [org.clojure/tools.reader "0.8.4"]
                 [org.clojure/core.typed "0.2.44"]
                 [org.clojure/math.combinatorics "0.0.7"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [org.clojars.vishk/algotools "0.1.0"]
                 [net.mikera/clisk "0.10.0"]
                 [com.palletops/thread-expr "1.3.0"]
                 [tinter "0.1.1-SNAPSHOT"]
                 [clj-tiny-astar "0.1.0-SNAPSHOT"]
                 [dorothy "0.0.3"]
                 [com.taoensso/timbre "3.2.1"]
                 [org.clojars.folcon/clojure-lanterna "0.9.5-SNAPSHOT"]]
  :main dungeon-crusade.core
  :repl-init dungeon-crusade.main)

Stop using custom clisk snapshot. 0.10.0 includes required changes


(defproject compojure "1.5.1"
  :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.2"]
                 [ring/ring-core "1.5.0"]
                 [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.3"]
                        [javax.servlet/servlet-api "2.5"]]}
   :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})

(defproject compojure "1.5.1"
  :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.2"]
                 [ring/ring-core "1.5.1"]
                 [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.3"]
                        [javax.servlet/servlet-api "2.5"]]}
   :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})

Update Ring version to 1.5.1

Update Ring version to 1.5.1

Fixes path traversal vulnerability in route/resources.


(defproject org.onyxplatform/onyx-metrics "0.7.2.1-SNAPSHOT"
  :description "Instrument Onyx workflows"
  :url "https://github.com/MichaelDrogalis/onyx"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                 [com.mdrogalis/rotating-seq "0.1.3"]
                 [com.taoensso/timbre "3.0.1"]
                 [stylefruits/gniazdo "0.4.0"]
                 [riemann-clojure-client "0.4.1"]]
  :profiles {:dev {:dependencies [[org.onyxplatform/onyx "0.7.2"]
                                  [midje "1.6.3"]]
                   :plugins [[lein-midje "3.1.1"]]}})

(defproject org.onyxplatform/onyx-metrics "0.7.2.1-SNAPSHOT"
  :description "Instrument Onyx workflows"
  :url "https://github.com/MichaelDrogalis/onyx"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [com.mdrogalis/rotating-seq "0.1.3"]
                 [stylefruits/gniazdo "0.4.0"]]
  :profiles {:dev {:dependencies [[org.onyxplatform/onyx "0.7.3"]
                                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                                  [riemann-clojure-client "0.4.1"]
                                  [com.taoensso/timbre "3.0.1"]
                                  [midje "1.7.0"]]
                   :plugins [[lein-midje "3.1.3"]]}})

Switch dependencies to dev dependencies

Switch dependencies to dev dependencies


;;;; This file is part of algebolic. Copyright (C) 2014-, Jony Hudson.
;;;;
;;;; algebolic is licenced to you under the MIT licence. See the file LICENCE.txt for full details.

(defproject algebolic "0.1.0-SNAPSHOT"
  :description "A library for doing symbolic regression with algebraic manipulation."
  :license {:name "MIT"}
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :plugins [[lein-gorilla "0.3.4-SNAPSHOT"]]
  :jvm-opts ["-server" "-Xmx4g"])

;;;; This file is part of algebolic. Copyright (C) 2014-, Jony Hudson.
;;;;
;;;; algebolic is licenced to you under the MIT licence. See the file LICENCE.txt for full details.

(defproject algebolic "0.1.0-SNAPSHOT"
  :description "A library for doing symbolic regression with algebraic manipulation."
  :license {:name "MIT"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [clj-kdtree "1.2.0" :exclusions [org.clojure/clojure]]]
  :plugins [[lein-gorilla "0.3.4-SNAPSHOT"]]
  :jvm-opts ["-server" "-Xmx4g"])

Add dependencies for last commit :-(

Add dependencies for last commit :-(


(defproject bukkure "0.4.2-SNAPSHOT"
  :description "Bringing Clojure to the Bukkit API"
  :url "http://github.com/SevereOverfl0w/Bukkure"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :java-source-paths ["javasrc"]
  :javac-options ["-d" "classes/" "-source" "1.7" "-target" "1.7"]
  :resource-paths ["resources/*"]
  :repositories [["spigot-repo" "https://hub.spigotmc.org/nexus/content/groups/public/"]]
  :plugins [[codox "0.8.13"]]
  :codox {:defaults {:doc/format :markdown}}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.reflections/reflections "0.9.8"]
                 [org.clojure/tools.nrepl "0.2.3"]
                 [cheshire "5.2.0"]]
  :profiles {:provided
              {:dependencies [[org.bukkit/bukkit "1.8.7-R0.1-SNAPSHOT"]]}})

(defproject bukkure "0.4.2-SNAPSHOT"
  :description "Bringing Clojure to the Bukkit API"
  :url "http://github.com/SevereOverfl0w/Bukkure"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :java-source-paths ["javasrc"]
  :javac-options ["-d" "classes/" "-source" "1.7" "-target" "1.7"]
  :resource-paths ["resources/*"]
  :repositories [["spigot-repo" "https://hub.spigotmc.org/nexus/content/groups/public/"]]
  :plugins [[codox "0.8.13"]]
  :codox {:defaults {:doc/format :markdown}}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.reflections/reflections "0.9.8"]
                 [org.clojure/tools.nrepl "0.2.3"]
                 [cheshire "5.2.0"]]
  :profiles {:provided
              {:dependencies [[org.bukkit/bukkit "1.8.8-R0.1-SNAPSHOT"]]}})

Bump up bukkit dependency version.

Bump up bukkit dependency version.


(defproject frereth-common "0.0.1-SNAPSHOT"
  :description "Pieces that the different Frereth parts share"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  ;; TODO: Could I totally pull datomic dependencies out of everything else?
  :dependencies [[com.stuartsierra/component "0.2.2"]
                 [com.taoensso/timbre "3.3.1"]
                 [im.chit/ribol "0.4.0"]
                 [mvxcvi/puget "0.6.4"]
                 [org.clojure/clojure "1.6.0"]
                 [prismatic/schema "0.3.3"]]

  :profiles {:dev {:source-paths ["dev"]
                   :dependencies [[org.clojure/tools.namespace "0.2.7"]
                                  [org.clojure/java.classpath "0.2.2"]]}
             :uberjar {:aot :all}}
  :repl-options {:init-ns user})

(defproject frereth-common "0.0.1-SNAPSHOT"
  :description "Pieces that the different Frereth parts share"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  ;; TODO: Could I totally pull datomic dependencies out of everything else?
  :dependencies [[com.stuartsierra/component "0.2.2"]
                 [com.taoensso/timbre "3.3.1" :exclusions [org.clojure/tools.reader]]
                 [im.chit/ribol "0.4.0"]
                 [mvxcvi/puget "0.6.4"]
                 [org.clojure/clojure "1.6.0"]
                 [prismatic/schema "0.3.3"]]

  :profiles {:dev {:source-paths ["dev"]
                   :dependencies [[org.clojure/tools.namespace "0.2.7"]
                                  [org.clojure/java.classpath "0.2.2"]]}
             :uberjar {:aot :all}}
  :repl-options {:init-ns user})

Fix up conflicts in the renderer

Fix up conflicts in the renderer


(ns lazytest.group
  (:use [lazytest.testable :only (Testable get-tests)]
	[lazytest.runnable-test :only (RunnableTest
				       run-tests
				       skip-or-pending
				       try-expectations
				       runnable-test?)]
	[lazytest.fixture :only (setup teardown fixture?)]
	[lazytest.test-result :only (result-group)]))

(defrecord TestCase [fixtures f]
  Testable
  (get-tests [this] (list this))
  RunnableTest
  (run-tests [this]
	     (lazy-seq
	      (list
	       (or (skip-or-pending this)
		   (try-expectations
		    this
		    (apply f (map setup fixtures))
		    (dorun (map teardown fixtures))))))))

(defn test-case [fixtures f]
  {:pre [(every? fixture? fixtures) (fn? f)]}
  (TestCase. fixtures f))

(defrecord TestGroup [children]
  Testable
  (get-tests [this] (list this))
  RunnableTest
  (run-tests [this]
	     (or (skip-or-pending this)
		 (result-group this (lazy-seq (mapcat run-tests children))))))

(defn test-group [children]
  {:pre [(every? (runnable-test? children))]}
  (TestGroup. children))

(ns lazytest.group
  (:use [lazytest.testable :only (Testable get-tests)]
	[lazytest.runnable-test :only (RunnableTest
				       run-tests
				       skip-or-pending
				       try-expectations
				       runnable-test?)]
	[lazytest.fixture :only (setup teardown fixture?)]
	[lazytest.test-result :only (result-group)]))

(defrecord TestCase [fixtures f]
  Testable
  (get-tests [this] (list this))
  RunnableTest
  (run-tests [this]
	     (lazy-seq
	      (list
	       (or (skip-or-pending this)
		   (try-expectations
		    this
		    (apply f (map setup fixtures))
		    (dorun (map teardown fixtures))))))))

(defn test-case
  ([fixtures f] (test-case fixtures f nil))
  ([fixtures f metadata]
     {:pre [(every? fixture? fixtures) (fn? f)]}
     (TestCase. fixtures f metadata nil)))

(defrecord TestGroup [children]
  Testable
  (get-tests [this] (list this))
  RunnableTest
  (run-tests [this]
	     (or (skip-or-pending this)
		 (result-group this (lazy-seq (mapcat run-tests children))))))

(defn test-group
  ([children] (test-group children nil))
  ([children metadata]
     {:pre [(every? (runnable-test? children))]}
     (TestGroup. children metadata nil)))

Support metadata in TestCase and TestGroup constructors


(ns pfrt-js.templates
  (:require [crate.core :refer [html]]
            [domina :refer [log]]
            [clojure.string :as str]))

(defn- hostname->domid
  "Convert host name to valid
  dom identifier."
  [host]
  (str "host" (str/join (str/split host #"\."))))

(defn host-entry
  [host data]
  (let [downloaded      (get data "in")
        uploaded        (get data "out")
        download-speed  (get data "speed-in")
        upload-speed    (get data "speed-out")]
    (html [:tr {:id (hostname->domid host)}
           [:td (:name data host)]
           [:td (js/filesize downloaded)]
           [:td (js/filesize uploaded)]
           [:td (str (js/filesize download-speed) "/s")]
           [:td (str (js/filesize upload-speed) "/s")]])))

(defn stats-layout
  []
  (html
   [:div {:class "container table-container"}
    [:table {:id "stats-container" :class "stats-container"}
     [:thead
      [:tr
       [:td "Hostname"]
       [:td "Download"]
       [:td "Upload"]
       [:td "Download Speed"]
       [:td "Upload Speed"]]]
     [:tbody]]]))

(defn base-layout
  "Main layout for all pages."
  []
  (html
   [:div {:class "wrapper"}
    [:div {:class "container header-container"}
     [:h1 "Pr0n Stats"]]
    [:div {:class "container body-container"}]]))

(ns pfrt-js.templates
  (:require [crate.core :refer [html]]
            [domina :refer [log]]
            [clojure.string :as str]))

(defn- hostname->domid
  "Convert host name to valid
  dom identifier."
  [host]
  (str "host" (str/join (str/split host #"\."))))

(defn host-entry
  [host data]
  (let [{:strs [in out speed-in speed-out]} data]
    (html [:tr {:id (hostname->domid host)}
           [:td host]
           [:td (js/filesize in)]
           [:td (js/filesize out)]
           [:td (str (js/filesize speed-in) "/s")]
           [:td (str (js/filesize speed-out) "/s")]])))

(defn stats-layout
  []
  (html
   [:div {:class "container table-container"}
    [:table {:id "stats-container" :class "stats-container"}
     [:thead
      [:tr
       [:td "Hostname"]
       [:td "Download"]
       [:td "Upload"]
       [:td "Download Speed"]
       [:td "Upload Speed"]]]
     [:tbody]]]))

(defn base-layout
  "Main layout for all pages."
  []
  (html
   [:div {:class "wrapper"}
    [:div {:class "container header-container"}
     [:h1 "Pr0n Stats"]]
    [:div {:class "container body-container"}]]))

Add :strs destructig (thanks to @dialelo suggestion)


(defproject com.palletops/hyde-pallet "0.1.0-SNAPSHOT"
  :description "Site generation for clojure projects"
  :url "https://github.com/paleltops/hyde-pallet"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :plugins [[lein-modules "0.3.1"]]
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [com.palletops/hyde "0.1.0"]])

(defproject com.palletops/hyde-pallet "0.1.0-SNAPSHOT"
  :description "Site generation for clojure projects"
  :url "https://github.com/paleltops/hyde-pallet"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :plugins [[lein-modules "0.3.1"]]
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [com.palletops/hyde "0.1.1-SNAPSHOT"]])

Update dep to hyde 1.1-SNAPSHOT

Update dep to hyde 1.1-SNAPSHOT


(defproject sketch "0.1.0-SNAPSHOT"
  :description "A template for a sketch with Quil/Processing"
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [genartlib/genartlib "0.1.20"] ; utility functions
                 [com.seisw/gpcj "2.2.0"]] ; polygon clipping
  :jvm-opts ["-Xms4000m" "-Xmx4000M" "-server"] ; 4GB heap size
  :source-paths ["src/clj"]
  :java-source-paths ["src/java"]
  :aot [sketch.dynamic])

(defproject sketch "0.1.0-SNAPSHOT"
  :description "A template for a sketch with Quil/Processing"
  :dependencies [[org.clojure/clojure "1.10.1"]
                 [genartlib/genartlib "0.1.20"] ; utility functions
                 [com.seisw/gpcj "2.2.0"]] ; polygon clipping
  :jvm-opts ["-Xms4000m" "-Xmx4000M" ; 4GB heap size
             "-server"
             "-Dsun.java2d.uiScale=1.0"] ; adjust scaling for high DPI displays
  :source-paths ["src/clj"]
  :java-source-paths ["src/java"]
  :aot [sketch.dynamic])

Make it easy to scale display for high DPI


(ns apio.concurrency.core
  (import (java.util.concurrent ForkJoinPool)))

;; TODO: initialize forkjoin pool in dynamic context
;; using dynamic loaded configuration.
(def *thread-pool* (ForkJoinPool.))

(ns apio.concurrency.core
  (import (java.util.concurrent Executors)))

;; TODO: initialize forkjoin pool in dynamic context
;; using dynamic loaded configuration.

(defn num-processes [] (.availableProcessors Runtime/getRuntime))
(def *thread-pool* (Executors/newFixedThreadPool (* (num-processes) 2)))

Replace forkjoin with standard fixed thread pool.


(ns adzerk.boot-cljs.util
  (:require [boot.core :as core]
            [clojure.java.io :as io]
            [clojure.string :as string]))

(defn path->js
  "Given a path to a CLJS namespace source file, returns the corresponding
  Google Closure namespace name for goog.provide() or goog.require()."
  [path]
  (-> path
      (string/replace #"\.clj[s|c]$" "")
      (string/replace #"[/\\]" ".")))

(defn path->ns
  "Given a path to a CLJS namespace source file, returns the corresponding
  CLJS namespace name."
  [path]
  (-> (path->js path) (string/replace #"_" "-")))

(defn get-name
  [path-or-file]
  (-> path-or-file io/file .getName))

(defn cljs-files
  [fileset]
  (->> fileset core/input-files (core/by-ext [".cljs" ".cljc"]) (sort-by :path)))

(defn path [& parts]
  (.getPath (apply io/file parts)))

(defn main-files [fileset id]
  (let [select (if (seq id)
                 #(core/by-name [(str id ".cljs.edn")] %)
                 #(core/by-ext [".cljs.edn"] %))]
    (->> fileset
         core/input-files
         select
         (sort-by :path))))

(defn tmp-file->docroot [tmp-file]
  (.getParent (io/file (core/tmp-path tmp-file))))

(ns adzerk.boot-cljs.util
  (:require [boot.core :as core]
            [clojure.java.io :as io]
            [clojure.string :as string]))

(defn path->js
  "Given a path to a CLJS namespace source file, returns the corresponding
  Google Closure namespace name for goog.provide() or goog.require()."
  [path]
  (-> path
      (string/replace #"\.clj[s|c]$" "")
      (string/replace #"[/\\]" ".")))

(defn path->ns
  "Given a path to a CLJS namespace source file, returns the corresponding
  CLJS namespace name."
  [path]
  (-> (path->js path) (string/replace #"_" "-")))

(defn get-name
  [path-or-file]
  (-> path-or-file io/file .getName))

(defn cljs-files
  [fileset]
  (->> fileset core/input-files (core/by-ext [".cljs" ".cljc"]) (sort-by :path)))

(defn path [& parts]
  (.getPath (apply io/file parts)))

(defn main-files [fileset id]
  (let [select (if (seq id)
                 #(core/by-name [(str id ".cljs.edn")] %)
                 #(core/by-ext [".cljs.edn"] %))]
    (->> fileset
         core/input-files
         select
         (sort-by :path))))

(defn tmp-file->docroot [tmp-file]
  (or (.getParent (io/file (core/tmp-path tmp-file))) ""))

Fix case where docroot is nil

Fix case where docroot is nil


(defproject clj-gatling "0.0.5"
  :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"]
                 [clj-containment-matchers "0.9.1"]
                 [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
                 [clojure-csv/clojure-csv "2.0.1"]
                 [cheshire "5.3.1"]
                 [compojure "1.1.5"]
                 [ring/ring-devel "1.1.8"]
                 [ring/ring-core "1.1.8"]
                 [ring-json-response "0.2.0"]
                 [http-kit "2.1.16"]
                 [clj-time "0.6.0"]
                 [io.gatling/gatling-charts "2.0.0-RC4"]
                 [io.gatling.highcharts/gatling-charts-highcharts "2.0.0-RC4"]]
  :repositories { "excilys" "http://repository.excilys.com/content/groups/public" }
  :main clj-gatling.core)

(defproject clj-gatling "0.0.5"
  :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"]
                 [clj-containment-matchers "0.9.1"]
                 [org.clojure/core.async "0.1.267.0-0d7780-alpha"]
                 [clojure-csv/clojure-csv "2.0.1"]
                 [cheshire "5.3.1"]
                 [compojure "1.1.5"]
                 [ring/ring-devel "1.1.8"]
                 [ring/ring-core "1.1.8"]
                 [ring-json-response "0.2.0"]
                 [http-kit "2.1.16"]
                 [clj-time "0.6.0"]
                 [io.gatling/gatling-charts "2.0.0-RC5"]
                 [io.gatling.highcharts/gatling-charts-highcharts "2.0.0-RC5"]]
  :repositories { "excilys" "http://repository.excilys.com/content/groups/public" }
  :main clj-gatling.core)

Bump Gatling version to 2.0.0-RC5

Bump Gatling version to 2.0.0-RC5


(defproject angelic "1.0.0-SNAPSHOT"
  :description "Angelic hierarchical planning"
  :dependencies [[org.clojure/clojure "1.2.0"]
                 [org.clojure/clojure-contrib "1.2.0"]
;                [org.clojars.robertpfeiffer/vijual "0.1.0-SNAPSHOT"]
                 [org.swinglabs/pdf-renderer "1.0.5"]
                 [incanter "1.2.3-SNAPSHOT"]
                 ]
  :dev-dependencies [[swank-clojure "1.2.1"] [mycroft/mycroft "0.0.2"]]
  :jvm-opts ["-server" "-Xmx1g"
             "-agentpath:/Applications/YourKit_Java_Profiler_9.0.0.app/bin/mac/libyjpagent.jnilib"
             #_ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5000" ]
  )

(ns leiningen.jswat
  (:use
   [clojure.contrib.shell-out :only [sh]]
   [leiningen.classpath]
   [clojure.string :only [join]]))

(defn jswat
  ([project] (jswat project "/Users/jawolfe/Library/clojure/jswat-4.5/bin/jswat"))
  ([project & [path]]
     (let [cp (join java.io.File/pathSeparatorChar (get-classpath project))]
       ;; jswat --cp:p <classpath>
       (sh path "--cp:p" cp))))

(defproject angelic "1.0.0-SNAPSHOT"
  :description "Angelic hierarchical planning"
  :dependencies [[org.clojure/clojure "1.2.0"]
                 [org.clojure/clojure-contrib "1.2.0"]
;                [org.clojars.robertpfeiffer/vijual "0.1.0-SNAPSHOT"]
                 [org.swinglabs/pdf-renderer "1.0.5"]
                 [incanter "1.2.3-SNAPSHOT"]
                 ]
  :dev-dependencies [[swank-clojure "1.2.1"] [mycroft/mycroft "0.0.2"]
                     [swank-clj "0.1.6"]]
  :jvm-opts ["-server" "-Xmx1g"
             "-agentpath:/Applications/YourKit_Java_Profiler_9.0.0.app/bin/mac/libyjpagent.jnilib"
             #_ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5000" ]
  )

(ns leiningen.jswat
  (:use
   [clojure.contrib.shell-out :only [sh]]
   [leiningen.classpath]
   [clojure.string :only [join]]))

(defn jswat
  ([project] (jswat project "/Users/jawolfe/Library/clojure/jswat-4.5/bin/jswat"))
  ([project & [path]]
     (let [cp (join java.io.File/pathSeparatorChar (get-classpath project))]
       ;; jswat --cp:p <classpath>
       (sh path "--cp:p" cp))))

Add dev dep on swank-clj

Add dev dep on swank-clj


(ns status-im.ui.screens.profile.group-chat.styles
  (:require [status-im.ui.components.colors :as colors]))

(def action-container
  {:background-color colors/white
   :padding-top      24})

(def action
  {:background-color (colors/alpha colors/blue 0.1)
   :border-radius    50})

(def action-label
  {:color colors/blue})

(def action-separator
  {:height           1
   :background-color colors/gray-light
   :margin-left      50})

(def action-icon-opts
  {:color colors/blue})

(ns status-im.ui.screens.profile.group-chat.styles
  (:require [status-im.ui.components.colors :as colors]))

(def action-container
  {:background-color colors/white
   :padding-top      24})

(def action
  {:background-color (colors/alpha colors/blue 0.1)
   :border-radius    50})

; Action label style is expected to be a fn
(defn action-label [_]
  {:color colors/blue})

(def action-separator
  {:height           1
   :background-color colors/gray-light
   :margin-left      50})

(def action-icon-opts
  {:color colors/blue})

Fix group chat info labels

Fix group chat info labels

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>


Add corner case found in generative tests


(ns ontrail.test.crypto
  (:use [ontrail.crypto])
  (:use [clojure.test]))

(deftest hash-properly
  (is (com.lambdaworks.crypto.SCryptUtil/check "keijo" (password-hash "keijo"))))

(deftest match-properly
  (is (password-match? "keijo" (com.lambdaworks.crypto.SCryptUtil/scrypt "keijo" 16384 8 1))))

(deftest base64-decodes
  (is (= "esko" (byte-array-to-string (base64-decode "ZXNrbw==")))))

(deftest encrypt-and-decrypt-does-what-it-should-do
  (is (= "foo2" (decrypt (encrypt "foo2")))))

(deftest decrypt-does-what-it-should-do
  (is (= "foo2" (decrypt "hcmlYlBedinIG2d5PohVCRKkEGg="))))

(ns ontrail.test.crypto
  (:use [ontrail.crypto])
  (:use [clojure.test]))

(deftest hash-properly
  (is (com.lambdaworks.crypto.SCryptUtil/check "keijo" (password-hash "keijo"))))

(deftest match-properly
  (is (password-match? "keijo" (com.lambdaworks.crypto.SCryptUtil/scrypt "keijo" 16384 8 1))))

(deftest not-match-invalid-pwd
  (not (password-match? "keijo2" (com.lambdaworks.crypto.SCryptUtil/scrypt "keijo" 16384 8 1))))

(deftest base64-decodes
  (is (= "esko" (byte-array-to-string (base64-decode "ZXNrbw==")))))

(deftest encrypt-and-decrypt-does-what-it-should-do
  (is (= "foo2" (decrypt (encrypt "foo2")))))

(deftest decrypt-does-what-it-should-do
  (is (= "foo2" (decrypt "hcmlYlBedinIG2d5PohVCRKkEGg="))))

Add test for false case also

Add test for false case also


(defproject leiningen/lein-swank "1.1.0"
  :description "A leiningen plugin to launch a swank server."
  :dependencies [[swank-clojure "1.1.0"]
                 [org.apache.maven/maven-ant-tasks "2.0.10"]])

(defproject leiningen/lein-swank "1.2.0-SNAPSHOT"
  :description "A leiningen plugin to launch a swank server."
  :dependencies [[swank-clojure "1.2.0-break-SNAPSHOT"]
                 [ant/ant "1.6.5"]
                 [ant/ant-launcher "1.6.5"]
                 [org.apache.maven/maven-ant-tasks "2.0.10"]])

Update lein-swank version and deps.

Update lein-swank version and deps.


(defproject cljs-browser "0.0.1-SNAPSHOT"
  :description ""
  :dependencies [[org.clojure/clojure "1.4.0-beta4"]
                 [org.clojure/clojurescript "0.0-993"]
                 [ring "1.0.0-RC1"]
                 [compojure "0.6.4"]
                 [enlive "1.0.0"]]
  :repl-init one.sample.repl
  :source-path "src/app/clj"
  :extra-classpath-dirs ["src/app/cljs"
                         "src/app/cljs-macros"
                         "src/lib/clj"
                         "src/lib/cljs"
                         "templates"
                         "../src"
                         "../domina/src/cljs"])

(defproject cljs-browser "0.0.1-SNAPSHOT"
  :description ""
  :dependencies [[org.clojure/clojure "1.4.0-beta4"]
                 [org.clojure/clojurescript "0.0-1236"]
                 [ring "1.0.0-RC1"]
                 [compojure "0.6.4"]
                 [enlive "1.0.0"]]
  :repl-init one.sample.repl
  :source-path "src/app/clj"
  :extra-classpath-dirs ["src/app/cljs"
                         "src/app/cljs-macros"
                         "src/lib/clj"
                         "src/lib/cljs"
                         "templates"
                         "../src"
                         "../domina/src/cljs"])

Update to ClojureScript release 0.0-1236


(ns circle.backend.nodes.circle-artifact
  (:require
   pallet.core
   pallet.phase
   [pallet.action.user :as user]
   [pallet.action.directory :as directory]
   [pallet.action.package :as package]
   [pallet.crate.java :as java]
   [pallet.action.remote-file :as remote-file]
   [pallet.action.service :as service]
   [pallet.crate.automated-admin-user :as automated-admin-user]
   [pallet.crate.git :as git]
   [pallet.crate.ssh-key :as ssh-key]
   [pallet.thread-expr :as thread-expr]))

(def circle-artifact-group
  (pallet.core/group-spec
   "circle"
   :circle-node-spec {:ami "ami-e913dd80"
                      :availability-zone "us-east-1a"
                      :instance-type "t1.micro"
                      :keypair-name "www"
                      :security-groups ["artifacts-server"]
                      :username "ubuntu"
                      :public-key (slurp "www.id_rsa.pub")
                      :private-key (slurp "www.id_rsa")}))

(ns circle.backend.nodes.circle-artifact
  (:require
   pallet.core
   pallet.phase
   [pallet.action.user :as user]
   [pallet.action.directory :as directory]
   [pallet.action.package :as package]
   [pallet.crate.java :as java]
   [pallet.action.remote-file :as remote-file]
   [pallet.action.service :as service]
   [pallet.crate.automated-admin-user :as automated-admin-user]
   [pallet.crate.git :as git]
   [pallet.crate.ssh-key :as ssh-key]
   [pallet.thread-expr :as thread-expr])
  (:require circle.dns)
  (:require [circle.backend.ec2 :as ec2]))

(def circle-artifact-group
  (pallet.core/group-spec
   "circle"
   :circle-node-spec {:ami "ami-e913dd80"
                      :availability-zone "us-east-1a"
                      :instance-type "t1.micro"
                      :keypair-name "www"
                      :security-groups ["artifacts-server"]
                      :username "ubuntu"
                      :public-key (slurp "www.id_rsa.pub")
                      :private-key (slurp "www.id_rsa")}))

(defn update-dns
  "Updates the DNS record for artifacts.circle.com to point at the given instance id"
  [instance-id]
  (circle.dns/update-record {:name "artifacts.circleci.com."} {:value (ec2/public-ip instance-id)}))

Add utils for working w/ artifacts DNS

Add utils for working w/ artifacts DNS


(ns desdemona.launcher.launch-prod-peers
  (:require [desdemona.launcher.utils :as utils]
            [taoensso.timbre :as t]
            [onyx.plugin.kafka]
            [onyx.plugin.sql]
            [onyx.plugin.core-async]
            [onyx.plugin.seq]
            [desdemona.functions.sample-functions]
            [desdemona.jobs.sample-submit-job]
            [desdemona.lifecycles.sample-lifecycle])
  (:gen-class))

(defn -main [n & args]
  (let [n-peers (Integer/parseInt n)
        {:keys [peer-config env-config]} (utils/read-config!)
        peer-group (onyx.api/start-peer-group peer-config)
        env (onyx.api/start-env env-config)
        peers (onyx.api/start-peers n-peers peer-group)]
    (println "Connecting to Zookeeper: " (:zookeeper/address peer-config))
    (utils/add-shutdown-hook! (fn []
                                (onyx.api/shutdown-peers peers)
                                (onyx.api/shutdown-peer-group peer-group)
                                (shutdown-agents)))
    (println "Started peers. Blocking forever.")
    (utils/block-forever!)))

(ns desdemona.launcher.launch-prod-peers
  (:require [desdemona.launcher.utils :as utils]
            [taoensso.timbre :as t]
            [onyx.plugin.kafka]
            [onyx.plugin.sql]
            [onyx.plugin.core-async]
            [onyx.plugin.seq]
            [desdemona.functions.sample-functions]
            [desdemona.jobs.sample-submit-job]
            [desdemona.lifecycles.sample-lifecycle])
  (:gen-class))

(defn -main [n & args]
  (let [n-peers (Integer/parseInt n)
        {:keys [peer-config env-config]} (utils/read-config!)
        peer-group (onyx.api/start-peer-group peer-config)
        _ (onyx.api/start-env env-config)
        peers (onyx.api/start-peers n-peers peer-group)]
    (println "Connecting to Zookeeper: " (:zookeeper/address peer-config))
    (utils/add-shutdown-hook! (fn []
                                (onyx.api/shutdown-peers peers)
                                (onyx.api/shutdown-peer-group peer-group)
                                (shutdown-agents)))
    (println "Started peers. Blocking forever.")
    (utils/block-forever!)))

Clarify that env isn't used

Clarify that env isn't used


(ns codewars.runners.groovy-test
  (:require [clojure.test :refer :all]
            [clojure.test.junit :refer [with-junit-output]]
            [cheshire.core :as json]
            [codewars.core :refer [-main] :as core]
            [codewars.utils :refer [with-java-out-str]]
  )

(deftest groovy-code-only
  (testing "-main can handle a groovy code with no fixture"
    (with-in-str
      (json/generate-string
       {:language "groovy"
        :code "1 + 1"})
      (is (= 2 (-main)))
    )
  )
)

(deftest groovy-java-out
  (testing "-main can handle a groovy code with no setup code but no fixture"
    (with-in-str
      (json/generate-string
       {:language "groovy"
        :code "print 'Hello Groovy!'"}
      )
      (is (= "Hello Groovy!" (with-java-out-str (-main))) )
    )
  )
)

(deftest groovy-java-fixt
  (testing "-main can handle a groovy code with no setup code but no fixture"
    (with-in-str
      (json/generate-string
       {:language "groovy"
        :code "class Greeter { static greet = { name -> 'Hello '+name } }"
        :fixture "class MyTestCase extends GroovyTestCase { void testGreet(){def result = Greeter.greet('Ruslan');assert result == 'Hello Ruslan';println 'Lets sum'}}"}
      )
      ;(with-java-out-str (run-all-tests))

     (let [test-out-string (with-java-out-str (-main))]
        (is (.contains test-out-string "<DESCRIBE::>testGreet(MyTestCase)"))
        (is (.contains test-out-string "Lets sum"))
        (is (.contains test-out-string "<PASSED::>Test Passed<:LF:>"))
     )

    )
  )
)

(ns codewars.runners.groovy-test
  (:require [clojure.test :refer :all]
            [cheshire.core :as json]
            [codewars.core :refer [-main] :as core]
            [codewars.utils :refer [with-java-out-str]]))

(deftest groovy-code-only
  (testing "-main can handle a groovy code with no fixture"
    (with-in-str
      (json/generate-string
       {:language "groovy"
        :code "1 + 1"})
      (is (= 2 (-main))))))

(deftest groovy-java-out
  (testing "-main can handle a groovy code with no setup code but no fixture"
    (with-in-str
      (json/generate-string
       {:language "groovy"
        :code "print 'Hello Groovy!'"})
      (is (= "Hello Groovy!" (with-java-out-str (-main)))))))

Revert "downgrade groovy runner version"


(ns herder.web.handler
  (:require
   [compojure.route :as route]
   [compojure.core :refer [defroutes GET POST PUT context] :as compojure]
   [ring.middleware.defaults :refer [wrap-defaults api-defaults]]
   [ring.util.response :refer [file-response content-type]]
   [ring.middleware.json :refer [wrap-json-response]]
   [ring.util.anti-forgery :refer [anti-forgery-field]]
   [korma.core :as d]
   [korma.db :as kd]
   [reloaded.repl :refer [system]]

   [herder.web.conventions :refer [convention-routes]]))

(defn index [params]
  (content-type (file-response "resources/herder/templates/index.html") "text/html"))

(defroutes core-routes
  (GET "/" [] index)
  (route/files "/resources/public/" {:root "target/resources/public/"})
  (route/not-found "Not found"))

(def routes (compojure/routes convention-routes core-routes))

(defn wrap-db [f]
  (fn [req]
    (if-let [sys-db (:db system)]
      (kd/with-db sys-db
        (f req))
      (f req))))

(def app
  (-> #'routes
      (wrap-defaults (assoc-in api-defaults [:params :nested] true))
      wrap-db
      wrap-json-response))

(ns herder.web.handler
  (:require
   [compojure.route :as route]
   [compojure.core :refer [defroutes GET POST PUT context] :as compojure]
   [ring.middleware.defaults :refer [wrap-defaults api-defaults]]
   [ring.util.response :refer [file-response content-type]]
   [ring.middleware.json :refer [wrap-json-response]]
   [ring.util.anti-forgery :refer [anti-forgery-field]]
   [korma.core :as d]
   [korma.db :as kd]
   [reloaded.repl :refer [system]]

   [herder.web.conventions :refer [convention-routes]]))

(defn index [params]
  (content-type (file-response "resources/herder/templates/index.html") "text/html"))

(defroutes core-routes
  (GET "/" [] index)
  (route/files "/resources/public/" {:root "target/resources/public/"})
  (route/not-found "Not found"))

(def routes (compojure/routes convention-routes core-routes))

(defn wrap-db [f]
  (fn [req]
    (if-let [sys-db-spec (:db-spec (:db system))]
      (kd/with-db (kd/create-db sys-db-spec)
        (f req))
      (f req))))

(def app
  (-> #'routes
      (wrap-defaults (assoc-in api-defaults [:params :nested] true))
      wrap-db
      wrap-json-response))

Make db connection actually work each time


(defn hello
  ([] "Hello World!")
  ([a] (str "Hello, you silly " a "."))
  ([a & more] (str "Hello to this group: "
                   (apply str
                          (interpose ", " (concat (list a) more)))
                   "!")))

(defmulti diet (fn [x] (:eater x)))
(defmethod diet :herbivore [a] __)
(defmethod diet :carnivore [a] __)
(defmethod diet :default [a] __)

(meditations
  "Some functions can be used in different ways - with no arguments"
  (= __ (hello))

  "With one argument"
  (= __ (hello "world"))

  "Or with many arguments"
  (= __
     (hello "Peter" "Paul" "Mary"))

  "Multimethods allow more complex dispatching"
  (= "Bambi eats veggies."
     (diet {:species "deer" :name "Bambi" :age 1 :eater :herbivore}))

  "Different methods are used depending on the dispatch function result"
  (= "Simba eats animals."
     (diet {:species "lion" :name "Simba" :age 1 :eater :carnivore}))

  "You may use a default method when no others match"
  (= "I don't know what Rich Hickey eats."
     (diet {:name "Rich Hickey"})))

(defn hello
  ([] "Hello World!")
  ([a] (str "Hello, you silly " a "."))
  ([a & more] (str "Hello to this group: "
                   (apply str
                          (interpose ", " (concat (list a) more)))
                   "!")))

(defmulti diet (fn [x] (:eater x)))
(defmethod diet :herbivore [a] (str (:name a) " eats veggies."))
(defmethod diet :carnivore [a] (str (:name a) " eats animals."))
(defmethod diet :default [a] (str "I don't know what " (:name a) " eats."))

(meditations
  "Some functions can be used in different ways - with no arguments"
  (= "Hello World!" (hello))

  "With one argument"
  (= "Hello, you silly world." (hello "world"))

  "Or with many arguments"
  (= "Hello to this group: Peter, Paul, Mary!"
     (hello "Peter" "Paul" "Mary"))

  "Multimethods allow more complex dispatching"
  (= "Bambi eats veggies."
     (diet {:species "deer" :name "Bambi" :age 1 :eater :herbivore}))

  "Different methods are used depending on the dispatch function result"
  (= "Simba eats animals."
     (diet {:species "lion" :name "Simba" :age 1 :eater :carnivore}))

  "You may use a default method when no others match"
  (= "I don't know what Rich Hickey eats."
     (diet {:name "Rich Hickey"})))

Complete runtime polymorphism koans test


#!/usr/bin/env boot
(set-env!
 :dependencies '[[org.clojure/clojure "1.7.0-RC1" :scope "provided"]
                 [funcool/catacumba "0.2.0-SNAPSHOT"]])

(require '[catacumba.core :as ct])

(defn home-page
  [content]
  "Hello world")

(def app
  (ct/routes [[:get home-page]]))

(defn -main
  "The main entry point to your application."
  [& args]
  (let [lt (java.util.concurrent.CountDownLatch. 1)]
    (ct/run-server app {:port 5050 :basedir "."})
    (.await lt)))

#!/usr/bin/env boot
(set-env!
 :dependencies '[[org.clojure/clojure "1.7.0-RC1"]
                 [funcool/catacumba "0.2.0"]])

(require '[catacumba.core :as ct])

(defn home-page
  [content]
  "Hello world")

(def app
  (ct/routes [[:get home-page]]))

(defn -main
  "The main entry point to your application."
  [& args]
  (let [lt (java.util.concurrent.CountDownLatch. 1)]
    (ct/run-server app {:port 5050 :basedir "."})
    (.await lt)))

Update catacumba version on single-file example.


;-
; Copyright 2011 (c) Meikel Brandmeyer.
; All rights reserved.
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
; THE SOFTWARE.

(ns vimclojure.core)

(defn init-server
  []
  ; Check for doc macro. 1.2 in c.core, 1.3 in c.repl
  (when-not (ns-resolve 'clojure.core 'doc)
    (binding [*ns* *ns*]
      (in-ns 'user)
      (refer-clojure)
      (use 'clojure.repl))))

;-
; Copyright 2011 (c) Meikel Brandmeyer.
; All rights reserved.
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
; THE SOFTWARE.

(ns vimclojure.core)

(defn init-server
  []
  (binding [*ns* *ns*]
    (in-ns 'user)
    (refer-clojure)
    ; Check for doc macro. 1.2 in c.core, 1.3 in c.repl
    (when-not (ns-resolve 'clojure.core 'doc)
      (use 'clojure.repl))
    (when (io/resource "user.clj")
      (load "user"))))

Load user.clj if present on classpath

Load user.clj if present on classpath


(ns new-website.server
  (:require [clojure.java.io :as io]
            [compojure.core :refer [ANY GET PUT POST DELETE defroutes]]
            [compojure.route :refer [resources]]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]
            [ring.middleware.gzip :refer [wrap-gzip]]
            [ring.middleware.logger :refer [wrap-with-logger]]
            [environ.core :refer [env]]
            [ring.adapter.jetty :refer [run-jetty]])
  (:gen-class))

(defroutes routes
  (GET "/anti_forgery.js" [req]
    {:status 200
     :headers {"Content-Type" "application/javascript"}
     :body (str "var csrf = '" *anti-forgery-token* "';")})
  (GET "/" _
    {:status 200
     :headers {"Content-Type" "text/html; charset=utf-8"}
     :body (io/input-stream (io/resource "public/index.html"))})
  (resources "/"))

(def http-handler
  (-> routes
      (wrap-defaults site-defaults)
      wrap-with-logger
      wrap-gzip))

(defn -main [& [port]]
  (let [port (Integer. (or port (env :port) 10555))]
    (run-jetty http-handler {:port port :join? false})))

(ns new-website.server
  (:require [clojure.java.io :as io]
            [compojure.core :refer [ANY GET PUT POST DELETE defroutes routes]]
            [compojure.route :refer [resources]]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]
            [ring.middleware.gzip :refer [wrap-gzip]]
            [ring.middleware.logger :refer [wrap-with-logger]]
            [ring.middleware.params :refer [wrap-params]]
            [ring.middleware.format :refer [wrap-restful-format]]
            [ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
            [environ.core :refer [env]]
            [ring.adapter.jetty :refer [run-jetty]]
            [new-website.trello :refer [trello-routes]])
  (:gen-class))

(defroutes core-routes
  (GET "/anti_forgery.js" [req]
    {:status 200
     :headers {"Content-Type" "application/javascript"}
     :body (str "var csrf = '" *anti-forgery-token* "';")})
  (GET "/" _
    {:status 200
     :headers {"Content-Type" "text/html; charset=utf-8"}
     :body (io/input-stream (io/resource "public/index.html"))})
  (resources "/"))

(def http-handler
  (routes
    (-> core-routes
        (wrap-defaults site-defaults)
        wrap-with-logger
        wrap-gzip)
    (-> trello-routes
        (wrap-restful-format :formats [:json :transit-json :edn])
        wrap-with-logger)))

(defn -main [& [port]]
  (let [port (Integer. (or port (env :port) 10555))]
    (run-jetty http-handler {:port port :join? false})))

Add routes for Trello to available ones

Add routes for Trello to available ones


(ns leiningen.pallet-release.github
  "Github interaction"
  (:require
   [com.palletops.leinout.github :as github]
   [leiningen.core.eval :as eval]
   [tentacles.orgs :as orgs]))

(defn auth-builder
  "Ensure the build-automation team is authorised on the repository."
  [url token]
  (let [{:keys [login name] :as repo} (github/url->repo url token)]
    (if-let [builder-id (github/team-id "build-automation" login token)]
      (let [r (github/auth-team-id builder-id repo token)]
        (case  r
          :authorised (println "Authourised")
          :already-authorised (println "Already authorised")
          :authorisation-failed (println "Authorisation failed")))
      (println
       "No team found for" (str login "/build-automation.")
       "Either create the build-automation team, or authorise pbors."))))

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

(defn repo-coordinates
  [origin]
  (let [{:keys [login name]} (github/url->repo origin)]
    (format push-repo-fmt login name)))

(ns leiningen.pallet-release.github
  "Github interaction"
  (:require
   [com.palletops.leinout.github :as github]
   [leiningen.core.eval :as eval]
   [tentacles.orgs :as orgs]))

(defn auth-builder
  "Ensure the build-automation team is authorised on the repository."
  [url token]
  (let [{:keys [login name] :as repo} (github/url->repo url)]
    (if-let [builder-id (github/team-id "build-automation" login token)]
      (let [r (github/auth-team-id builder-id repo token)]
        (case  r
          :authorised (println "Authourised")
          :already-authorised (println "Already authorised")
          :authorisation-failed (println "Authorisation failed")))
      (println
       "No team found for" (str login "/build-automation.")
       "Either create the build-automation team, or authorise pbors."))))

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

(defn repo-coordinates
  [origin]
  (let [{:keys [login name]} (github/url->repo origin)]
    (format push-repo-fmt login name)))

Fix bug in init from leinout refactoring


(ns tryclojure.models.eval
  (:require [clojail.testers :refer [secure-tester-without-def]]
            [clojail.core :refer [sandbox]]
            [clojure.stacktrace :refer [root-cause]]
            [noir.session :as session])

  (:use [clojure.pprint])
  (:use [isla.parser])
  (:use [isla.interpreter])
  (:require [isla.utils :as utils])
  (:require [isla.library :as library])

  (:import java.io.StringWriter
	   java.util.concurrent.TimeoutException))

(declare run repl)

(def repl-context (ref (library/get-initial-context)))

(defn eval-string [isla-expr]
  ;; (throw (Exception. (str form)))
  (with-open [out (StringWriter.)]
    {:expr isla-expr
     :result [out (run isla-expr)]}))

(defn eval-request [expr]
  (try
    (eval-string expr)
    (catch TimeoutException _
      {:error true :message "Execution Timed Out!"})
    (catch Exception e
      {:error true :message (str (root-cause e))})))

(defn run [code]
  (println (first (:content (first (:content (isla.parser/parse code))))))
  (let [return
        (interpret (first (:content (first (:content (isla.parser/parse code)))))
                   (deref repl-context))]
    (println return)
    (dosync (ref-set repl-context (:ctx return)))
    (:ret return)))

(defn repl []
  (run (utils/take-input))
  (repl))

(ns tryclojure.models.eval
  (:require [clojail.testers :refer [secure-tester-without-def]]
            [clojail.core :refer [sandbox]]
            [clojure.stacktrace :refer [root-cause]]
            [noir.session :as session])

  (:use [clojure.pprint])
  (:use [isla.parser])
  (:use [isla.interpreter])
  (:require [isla.utils :as utils])
  (:require [isla.library :as library])

  (:import java.io.StringWriter
	   java.util.concurrent.TimeoutException))

(declare run repl)

(def repl-env (ref (library/get-initial-env)))

(defn eval-string [isla-expr]
  ;; (throw (Exception. (str form)))
  (with-open [out (StringWriter.)]
    {:expr isla-expr
     :result [out (run isla-expr)]}))

(defn eval-request [expr]
  (try
    (eval-string expr)
    (catch TimeoutException _
      {:error true :message "Execution Timed Out!"})
    (catch Exception e
      {:error true :message (str (root-cause e))})))

(defn run [code]
  (let [return
        (interpret (first (:content (first (:content (isla.parser/parse code)))))
                   (deref repl-env))]
    (println return)
    (dosync (ref-set repl-env return))
    (:ret return)))

(defn repl []
  (run (utils/take-input))
  (repl))

Update tryisla repl to use new env data structure.


(defproject doo "0.1.6-SNAPSHOT"
  :description "doo is a library to run clj.test on different js environments."
  :url "https://github.com/bensu/doo"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}

  :scm {:name "git"
        :url "https://github.com/bensu/doo"}

  :deploy-repositories [["clojars" {:creds :gpg}]]

  :test-paths ["test/clj"]

  :resource-paths ["resources"]

  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "0.0-3308" :scope "provided"]
                 [selmer "0.8.9"]
                 [karma-reporter "0.1.0"]]

  :profiles
  {:dev {:source-paths ["src/clj" "test/clj" "../example/src" "../example/test"]
         :dependencies [[org.clojure/core.async "0.1.346.0-17112a-alpha"]]}})

(defproject doo "0.1.6-SNAPSHOT"
  :description "doo is a library to run clj.test on different js environments."
  :url "https://github.com/bensu/doo"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}

  :scm {:name "git"
        :url "https://github.com/bensu/doo"}

  :deploy-repositories [["clojars" {:creds :gpg}]]

  :test-paths ["test/clj"]

  :resource-paths ["resources"]

  :dependencies [[org.clojure/clojure "1.7.0"]
                 [selmer "0.8.9"]
                 [karma-reporter "0.1.0"]]

  :profiles
  {:dev {:source-paths ["src/clj" "test/clj" "../example/src" "../example/test"]
         :dependencies [[org.clojure/core.async "0.1.346.0-17112a-alpha"]]}})

Remove cljs dependency from doo

Remove cljs dependency from doo


(ns luhn
  (:require [clojure.string :as string]))

(defn to-reversed-digits
  "returns a lazy sequence of least to most significant digits of n"
  [n]
  (->> [n 0]
       (iterate (fn [[i _]] [(quot i 10) (mod i 10)]))
       (take-while (complement #{[0 0]}))
       (map second)
       rest))

(defn checksum
  "returns the luhn checksum of n, assuming it has a check digit"
  [n]
  (-> (->> n
           to-reversed-digits
           (map * (cycle [1 2]))
           (map #(if (>= % 10) (- % 9) %))
           (apply +))
      (mod 10)))

(defn string->long
  "Strips any non-digit characters and converts the string into a Long"
  [n]
  (-> n (string/replace #"[^0-9]+" "") Long/parseLong))

(defn valid?
  "whether n has a valid luhn check-digit"
  [n]
  ; Numbers with non digit/whitespace or only 1 digit are invalid
  (if (or (re-find #"[^0-9\s]+" n) (>= 1 (count (string/trim n))))
    false
    (zero? (-> n string->long checksum))))

(defn add-check-digit
  "given a number, adds a luhn check digit at the end"
  [n]
  (let [n-shifted (* 10 n)
        check-digit (- 10 (checksum n-shifted))]
    (+ n-shifted check-digit)))

Remove unused function from luhn exercise


(ns clj-templates.handler
  (:require [compojure.core :refer [GET routes]]
            [compojure.route :refer [resources]]
            [ring.util.response :refer [resource-response]]
            [ring.logger.timbre :refer [wrap-with-logger]]
            [ring.middleware.defaults :refer [site-defaults wrap-defaults]]
            [ring.util.http-response :refer [content-type ok]]
            [integrant.core :as ig]))

(defn home-page []
  (content-type (resource-response "index.html" {:root "public"}) "text/html; charset=utf-8"))

;; TODO: Get from db
(defn templates [db]
  "Templates")

(defn app-routes [db]
  (routes
    (GET "/templates" [] (templates db))
    (GET "/" [] (home-page))
    (resources "/")))

(defmethod ig/init-key :handler/main [_ {:keys [db]}]
  (-> (app-routes db)
      (wrap-defaults site-defaults)
      wrap-with-logger))

(ns clj-templates.handler
  (:require [compojure.core :refer [GET routes]]
            [compojure.route :refer [resources]]
            [ring.util.response :refer [resource-response response]]
            [ring.logger.timbre :refer [wrap-with-logger]]
            [ring.middleware.defaults :refer [site-defaults wrap-defaults]]
            [ring.util.http-response :refer [content-type ok]]
            [clj-templates.db.db :as db]
            [integrant.core :as ig]
            [cognitect.transit :as transit])
  (:import (java.io ByteArrayOutputStream)))

(defn transit-json [v]
  (let [out (ByteArrayOutputStream. 4096)
        _ (-> out
              (transit/writer :json)
              (transit/write v))
        res (.toString out)]
    (.reset out)
    res))

(defn home-page []
  (-> (resource-response "index.html" {:root "public"})
      (content-type "text/html; charset=utf-8")))

(defn templates [db]
  (let [all-templates {:templates (db/all-templates db)}
        transit-templates (transit-json all-templates)]
    (-> (response transit-templates)
        (content-type "application/transit+json"))))

(defn app-routes [db]
  (routes
    (GET "/templates" [] (templates db))
    (GET "/" [] (home-page))
    (resources "/")))

(defmethod ig/init-key :handler/main [_ {:keys [db]}]
  (-> (app-routes db)
      (wrap-defaults site-defaults)
      wrap-with-logger))

Add endpoint that returns all templates as transit


{:user {
        :plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]]
        :dependencies [[com.datomic/datomic-free "0.9.5350"]
                       [me.raynes/fs "1.4.6"]]
        }}

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

Update lein profile to include flycheck-clojoure deps.


(ns comic-reader.scrape
  (:require [clojure.string :as s]
            [clojure.java.io :as io]
            [clj-http.client :as client]
            [tempfile.core :refer [tempfile with-tempfile]]
            [net.cgrand.enlive-html :as html])
  (:import java.net.URL))

(defn fetch-url [url]
  (with-tempfile [html-file (tempfile (:body (client/get url)))]
   (html/html-resource html-file)))

(defn extract-list [html selector normalize]
  (->> (html/select html selector)
       (map normalize)
       (filter identity)))

(defn fetch-list [{:keys [url selector normalize]}]
  (when (every? (complement nil?) [url selector normalize])
    (extract-list (fetch-url url) selector normalize)))

(defn enlive->hiccup [{:keys [tag attrs content]}]
  (if (nil? content)
    [tag attrs]
    [tag attrs content]))

(defn clean-image-tag [[tag attrs & content]]
  [tag (select-keys attrs [:alt :src])])

(defn extract-image-tag [html selector]
  (some-> html
          (html/select selector)
          seq
          first
          enlive->hiccup
          clean-image-tag))

(defn fetch-image-tag [{:keys [url selector]}]
  (when (every? (complement nil?) [url selector])
    (-> (fetch-url url)
        (extract-image-tag selector))))

(ns comic-reader.scrape
  (:require [clojure.string :as s]
            [clojure.java.io :as io]
            [clj-http.client :as client]
            [tempfile.core :refer [tempfile with-tempfile]]
            [net.cgrand.enlive-html :as html])
  (:import java.net.URL))

(defn fetch-url [url]
  (with-tempfile [html-file (tempfile (:body (client/get url)))]
   (html/html-resource html-file)))

(defn extract-list [html selector normalize]
  (->> (html/select html selector)
       (keep normalize)))

(defn fetch-list [{:keys [url selector normalize]}]
  (when (every? (complement nil?) [url selector normalize])
    (extract-list (fetch-url url) selector normalize)))

(defn enlive->hiccup [{:keys [tag attrs content]}]
  (if (nil? content)
    [tag attrs]
    [tag attrs content]))

(defn clean-image-tag [[tag attrs & content]]
  [tag (select-keys attrs [:alt :src])])

(defn extract-image-tag [html selector]
  (some-> html
          (html/select selector)
          seq
          first
          enlive->hiccup
          clean-image-tag))

(defn fetch-image-tag [{:keys [url selector]}]
  (when (every? (complement nil?) [url selector])
    (-> (fetch-url url)
        (extract-image-tag selector))))

Use keep instead of map+filter-ident

Use keep instead of map+filter-ident


(ns analyze-data.tf-idf.words-test
  (:require [clojure.test :refer [deftest is]]
            [analyze-data.tf-idf.words :as test-ns]))

(deftest to-words-test
  (is (= ["hello" "world"]
         (test-ns/to-words "hello world"))
      "separates two words")
  (is (= ["hello" "world"]
         (test-ns/to-words "Hello world"))
      "lowercases words")
  (is (= ["hello" "world"]
         (test-ns/to-words "Hello world!"))
      "removes punctuation...")
  (is (= ["hello" "world"]
         (test-ns/to-words "Hello, world"))
      "...including commas...")
  (is (= ["he'll" "world"]
         (test-ns/to-words "he'll world"))
      "...but keeps apostrophes"))

(deftest remove-stopwords-test
  (is (= ["hello" "world"]
         (test-ns/remove-stopwords ["the" "hello" "world"]))
      "removes common word \"the\""))

(deftest n-grams-test
  (is (= ["a b" "b c"]
         (test-ns/n-grams 2 ["a" "b" "c"]))
      "creates bigrams"))

(ns analyze-data.tf-idf.words-test
  (:require [clojure.test :refer [deftest is]]
            [analyze-data.tf-idf.words :as test-ns]))

(deftest to-words-test
  (is (= ["hello" "world"]
         (test-ns/to-words "hello world"))
      "separates two words")
  (is (= ["hello" "world"]
         (test-ns/to-words "Hello world"))
      "lowercases words")
  (is (= ["hello" "world"]
         (test-ns/to-words "hello\nworld"))
      "splits words on newline")
  (is (= ["hello" "world"]
         (test-ns/to-words "Hello world!"))
      "removes punctuation...")
  (is (= ["hello" "world"]
         (test-ns/to-words "Hello, world"))
      "...including commas...")
  (is (= ["he'll" "world"]
         (test-ns/to-words "he'll world"))
      "...but keeps apostrophes"))

(deftest remove-stopwords-test
  (is (= ["hello" "world"]
         (test-ns/remove-stopwords ["the" "hello" "world"]))
      "removes common word \"the\""))

(deftest n-grams-test
  (is (= ["a b" "b c"]
         (test-ns/n-grams 2 ["a" "b" "c"]))
      "creates bigrams"))

Add test for splitting words on newlines.


(ns circleci.db.migrations
  (:use [circleci.db :only (with-conn)])
  (:use [circleci.db.migration-lib :only (defmigration run-required-migrations reset-migration-state)])
  (:require [clojure.java.jdbc :as jdbc]))

(def migration-info (circleci.db.migration-lib/migration-info (.getName *ns*)))

(defn init []
  (with-conn
    (run-required-migrations migration-info))
  (println "migrations/init done"))

(reset-migration-state (.getName *ns*))

(defmigration "schema version"
  (println "create-table: schema version")
  (jdbc/create-table :schema_version
                     [:name :varchar "UNIQUE NOT NULL"]
                     [:date_run :timestamp "NOT NULL"]))

(defmigration "add beta notify"
  (println "create-table: beta notify")
  (jdbc/create-table :beta_notify
                     [:email :text "PRIMARY KEY"]
                     [:environment :text]
                     [:features :text]))

(ns circleci.db.migrations
  (:use [circleci.db :only (with-conn)])
  (:use [circleci.db.migration-lib :only (defmigration run-required-migrations reset-migration-state)])
  (:require [clojure.java.jdbc :as jdbc])
  (use (clojure.contrib [string :only (as-str)])))

(def migration-info (circleci.db.migration-lib/migration-info (.getName *ns*)))

(defn init []
  (with-conn
    (run-required-migrations migration-info))
  (println "migrations/init done"))

(reset-migration-state (.getName *ns*))

(defmigration "schema version"
  (println "create-table: schema version")
  (jdbc/create-table :schema_version
                     [:name :varchar "UNIQUE NOT NULL"]
                     [:date_run :timestamp "NOT NULL"]))

(defmigration "add beta notify"
  (println "create-table: beta notify")
  (jdbc/create-table :beta_notify
                     [:email :text "PRIMARY KEY"]
                     [:environment :text]
                     [:features :text]))

(defn alter-table [name & specs]
   (jdbc/do-commands
    (format "ALTER TABLE %s ADD %s"
     (as-str name)
     (apply str
            (map as-str
                 (apply concat
                        (interpose [", "]
                                   (map (partial interpose " ") specs))))))))

(defmigration "add beta checkbox"
  (println "alter-table: beta checkbox")
  (alter-table :beta_notify [:contact :boolean]))

Add alter-table and migrate beta-notify with a checkbox.


(defproject com.stuartsierra/component "0.2.1"
  :description "Managed lifecycle of stateful objects"
  :url "https://github.com/stuartsierra/component"
  :license {:name "The MIT License"
            :url "http://opensource.org/licenses/MIT"}
  :min-lein-version "2.1.3"  ; added :global-vars
  :dependencies [[com.stuartsierra/dependency "0.1.1"]]
  :global-vars {*warn-on-reflection* true}
  :profiles {:dev {:dependencies [[org.clojure/clojure "1.5.1"]
                                  [org.clojure/tools.namespace "0.2.4"]]
                   :source-paths ["dev"]}
             :clj1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}})

(defproject com.stuartsierra/component "0.2.2-SNAPSHOT"
  :description "Managed lifecycle of stateful objects"
  :url "https://github.com/stuartsierra/component"
  :license {:name "The MIT License"
            :url "http://opensource.org/licenses/MIT"}
  :min-lein-version "2.1.3"  ; added :global-vars
  :dependencies [[com.stuartsierra/dependency "0.1.1"]]
  :global-vars {*warn-on-reflection* true}
  :profiles {:dev {:dependencies [[org.clojure/clojure "1.5.1"]
                                  [org.clojure/tools.namespace "0.2.4"]]
                   :source-paths ["dev"]}
             :clj1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}})

Set development version to 0.2.2-SNAPSHOT


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

Prepare for next release cycle.

Prepare for next release cycle.


(defproject io.aviso/twixt "0.1.9"
  :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"]
                 [io.aviso/tracker "0.1.0"]
                 [ring/ring-core "1.2.1"]
                 [org.mozilla/rhino "1.7R4"]
                 [com.github.sommeri/less4j "1.2.4"]
                 [de.neuland-bfi/jade4j "0.4.0"]
                 [hiccup "1.0.4"]]
  :codox {:src-dir-uri               "https://github.com/AvisoNovate/twixt/blob/master/"
          :src-linenum-anchor-prefix "L"}
  :profiles {:dev {:dependencies [[log4j "1.2.17"]
                                  [ring/ring-jetty-adapter "1.2.0"]]}})

(defproject io.aviso/twixt "0.1.10-SNAPSHOT"
  :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"]
                 [io.aviso/tracker "0.1.0"]
                 [ring/ring-core "1.2.1"]
                 [org.mozilla/rhino "1.7R4"]
                 [com.github.sommeri/less4j "1.2.4"]
                 [de.neuland-bfi/jade4j "0.4.0"]
                 [hiccup "1.0.4"]]
  :codox {:src-dir-uri               "https://github.com/AvisoNovate/twixt/blob/master/"
          :src-linenum-anchor-prefix "L"}
  :profiles {:dev {:dependencies [[log4j "1.2.17"]
                                  [ring/ring-jetty-adapter "1.2.0"]]}})

Update version number for next release

Update version number for next release


(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.5.7"]
                 [incanter/incanter-charts "1.5.7"]
                 [incanter/incanter-io "1.5.7"]
                 [org.clojure/data.json "0.2.6"]
                 [clj-http "3.10.0"]
                 [slingshot "0.12.2"]]
  :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.5.7"]
                 [incanter/incanter-charts "1.5.7"]
                 [incanter/incanter-io "1.5.7"]
                 [org.clojure/data.json "0.2.6"]
                 [clj-http "3.10.2"]
                 [slingshot "0.12.2"]]
  :main ^:skip-aot strava-activity-graphs.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

Update dependency clj-http:clj-http to v3.10.2


(defproject compojure "1.6.0-beta1"
  :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.2"]
                 [ring/ring-core "1.6.0-beta4"]
                 [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.3"]
                        [javax.servlet/servlet-api "2.5"]]}
   :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})

(defproject compojure "1.6.0-beta1"
  :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.2"]
                 [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.3"]
                        [javax.servlet/servlet-api "2.5"]]}
   :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}})

Update Ring dependency to 1.6.0-beta6

Update Ring dependency to 1.6.0-beta6


(ns todo-repl-webapp.handler
  (:gen-class :main true)
  (:use compojure.core)
  (:require [compojure.handler :as handler]
            [compojure.route :as route]
            [ring.adapter.jetty :as jetty]
            [todo-repl.core :as todo]
            [todo-repl-webapp.views :as views]))

(def *tasks-ref* (ref []))
(defn tasks [] (deref *tasks-ref*))
(defn add-new-task [x]
  (dosync (alter *tasks-ref* #(cons
                                (todo/new-task-better x)
                                %1))))

(defroutes app-routes
  (GET "/" [] (do (println "get /")
                  (views/home)))
  (POST "/eval" [evalInput]
    (do
      (println "/eval " evalInput)
      (if (nil? evalInput)
        (views/eval "nil")
          (binding [*ns* (find-ns 'todo-repl-webapp.handler)]
            (let [result (load-string evalInput)]
              (println "evals to: " result)
              (views/eval (str result)))))))
  (route/resources "/")
  (route/not-found "Not Found"))

(def app
  (handler/site app-routes))

(defn -main [port]
  (jetty/run-jetty
    (handler/site app-routes)
    {:port (Integer. port) :join? false}))

(ns todo-repl-webapp.handler
  (:gen-class :main true)
  (:use compojure.core)
  (:require [compojure.handler :as handler]
            [compojure.route :as route]
            [ring.adapter.jetty :as jetty]
            [todo-repl.core :as todo]
            [todo-repl-webapp.views :as views]))

(def *tasks-ref* (ref []))
(defn tasks [] (deref *tasks-ref*))
(defn add-new-task [x]
  (dosync (alter *tasks-ref* #(cons
                                (todo/new-task-better x)
                                %1))))

;; Initialize some tasks
(add-new-task {:name "Go get some milk"
               :context "shopping"
               :due "tomorrow"})
(add-new-task {:name "Go get new shoes"
               :context "shopping"
               :due "friday"})
(add-new-task {:name "Clean the kitchen sink"
               :context "cleaning"})

(defroutes app-routes
  (GET "/" [] (do (println "get /")
                  (views/home)))
  (POST "/eval" [evalInput]
    (do
      (println "/eval " evalInput)
      (if (nil? evalInput)
        (views/display "nil")
          (binding [*ns* (find-ns 'todo-repl-webapp.handler)]
            (let [result (load-string evalInput)]
              (println "evals to: " result)
              (views/display result))))))
  (route/resources "/")
  (route/not-found "Not Found"))

(def app
  (handler/site app-routes))

(defn -main [port]
  (jetty/run-jetty
    (handler/site app-routes)
    {:port (Integer. port) :join? false}))

Add a few tasks to initialize tasks

Add a few tasks to initialize tasks