(require
  '[cljs.repl :as repl]
  '[cljs.repl.nashorn :as nashorn])

(cljs.repl/repl
 (cljs.repl.nashorn/repl-env)
 :output-dir "out"
 :cache-analysis true)

(require
  '[cljs.repl :as repl]
  '[cljs.repl.node :as node])

(cljs.repl/repl
 (node/repl-env)
 :output-dir "out"
 :cache-analysis true)

Use node REPL instead of Nashorn

Use node REPL instead of Nashorn

Nashorn doesn't provide a suitable async scheduler for Bluebird out of
the box and Node does.

See https://github.com/petkaantonov/bluebird/wiki/Error:-No-async-scheduler-available


(ns user
  (:require
    [clojure.java.io :as io]
    [clojure.string :as str]))

(ns user
  (:require
    [clojure.java.io :as io]
    [clojure.string :as str]
    (puget
      data
      [printer :as puget])
    [vault.blob.core :as blob]))

Add dev alias for vault.blob.core as blob.


(ns runbld.util.data)

;; http://dev.clojure.org/jira/browse/CLJ-1468
(defn deep-merge
  "Like merge, but merges maps recursively."
  {:added "1.7"}
  [& maps]
  (if (every? map? maps)
    (apply merge-with deep-merge maps)
    (last maps)))

(defn deep-merge-with
  "Like merge-with, but merges maps recursively, applying the given fn
  only when there's a non-map at a particular level."
  {:added "1.7"}
  [f & maps]
  (apply
   (fn m [& maps]
     (if (every? map? maps)
       (apply merge-with m maps)
       (apply f maps)))
   maps))

(ns runbld.util.data
  (:refer-clojure :exclude [map?])
  (:require [clojure.walk :refer [postwalk]]))

(defn map? [x]
  (or (instance? clojure.lang.IPersistentMap x)
      (instance? java.util.Map x)))

;; http://dev.clojure.org/jira/browse/CLJ-1468
(defn deep-merge
  "Like merge, but merges maps recursively."
  {:added "1.7"}
  [& maps]
  (if (every? map? maps)
    (apply merge-with deep-merge maps)
    (last maps)))

(defn deep-merge-with
  "Like merge-with, but merges maps recursively, applying the given fn
  only when there's a non-map at a particular level."
  {:added "1.7"}
  [f & maps]
  (apply
   (fn m [& maps]
     (if (every? map? maps)
       (apply merge-with m maps)
       (apply f maps)))
   maps))

(defn keywordize-keys
  "clojure.walk/keywordize-keys breaks when a map is actually a
  j.u.LinkedHashMap, which is what happens with interop, in our case
  Yaml#load()"
  [m]
  (with-redefs [clojure.core/map? map?]
    (clojure.walk/keywordize-keys m)))

Add a map? which considers java.util.Map, for keywordize-keys


(ns io.perun.gravatar
  (:require [io.perun.core :as perun]
            [gravatar      :as gr]))

(defn add-gravatar [file source-prop target-prop]
  (if-let [email (get file source-prop)]
    (assoc file target-prop (gr/avatar-url email))
    file))

(defn find-gravatar [files source-prop target-prop]
  (let [updated-files (map #(add-gravatar % source-prop target-prop) files)]
    (perun/report-info "gravatar" "added gravatar to %s files" (count updated-files))
    updated-files))

(ns io.perun.gravatar
  (:require [io.perun.core :as perun]
            [gravatar.core :as gr]))

(defn add-gravatar [file source-prop target-prop]
  (if-let [email (get file source-prop)]
    (assoc file target-prop (gr/avatar-url email))
    file))

(defn find-gravatar [files source-prop target-prop]
  (let [updated-files (map #(add-gravatar % source-prop target-prop) files)]
    (perun/report-info "gravatar" "added gravatar to %s files" (count updated-files))
    updated-files))

Use correct namespace... confused about this one


(ns comic-reader.ui.site-list
  (:refer-clojure :exclude [get set])
  (:require [re-frame.core :as re-frame]
            [comic-reader.ui.base :as base]))

(defn get* [db]
  (clojure.core/get db :site-list))

(defn set* [db sites]
  (assoc db :site-list sites))

(defn setup! []
  (re-frame/reg-sub
   :site-list
   (fn [app-db _]
     (get* app-db)))

  (re-frame/reg-event-db
   :set-site-list
   (fn [db [_ sites]]
     (set* db sites))))

(defn get []
  (re-frame/subscribe [:site-list]))

(defn set [sites]
  (re-frame/dispatch [:set-site-list sites]))

(defn site-list [view-site sites]
  (base/list-with-loading
   {:heading "Comic Sites"
    :list-element [:ul.inline-list]
    :item->li (fn [site]
                [:a.large.button.radius
                 {:on-click #(view-site (:id site))}
                 (:name site)])}
   sites))

(defn site-list-container []
  (let [sites (re-frame/subscribe [:site-list])]
    (fn [] [site-list
            (fn [site-id]
              (re-frame/dispatch [:view-comics site-id]))
            (deref sites)])))

(ns comic-reader.ui.site-list
  (:refer-clojure :exclude [get set])
  (:require [re-frame.core :as re-frame]
            [comic-reader.ui.base :as base]))

(defn get* [db]
  (clojure.core/get db :site-list))

(defn set* [db sites]
  (assoc db :site-list sites))

(defn setup! []
  (re-frame/reg-sub
   :site-list
   (fn [app-db _]
     (get* app-db)))

  (re-frame/reg-event-db
   :set-site-list
   (fn [db [_ sites]]
     (set* db sites))))

(defn get []
  (re-frame/subscribe [:site-list]))

(defn set [sites]
  (re-frame/dispatch [:set-site-list sites]))

(defn site-list [view-site sites]
  (base/list-with-loading
   {:heading "Comic Sites"
    :list-element [:ul.inline-list]
    :item->li (fn [site]
                [:a.large.button.radius
                 {:on-click #(view-site (:site/id site))}
                 (:site/name site)])}
   sites))

(defn site-list-container []
  (let [sites (re-frame/subscribe [:site-list])]
    (fn [] [site-list
            (fn [site-id]
              (re-frame/dispatch [:view-comics site-id]))
            (deref sites)])))

Use the namespaced keys being returned by the API now


(ns ember-cljs.core
  (:require [clojure.string :as string]
            [jquery] [ember]))

(def Ember js/Ember)
(def HomeRoute
  (.extend (.-Route Ember)
    #js {:model
         (fn []
           "Dynamic Data")}))

(def SmallComponentComponent
  (.extend (.-Component Ember)
    #js {:dynamicAttribute "foo"
         :thing "123"
         :actions
         #js {:myAction
              (fn []
                (this-as this
                 (.set this "dynamicAttribute" "abc")))}}))

(let [application (.create (.-Application Ember))
      router (.-Router application)]
  (set! (.-HomeRoute application) HomeRoute)
  (set! (.-SmallComponentComponent application) SmallComponentComponent)
  (.map router (fn []
                 (this-as r
                   (.route r "home" #js {:path "/"})
                   (.route r "foo" #js {:path "/foo"})))))

(ns ember-cljs.core
  (:require [clojure.string :as string]
            [jquery] [ember]))

;; set Ember as a variable so I don't have to
;; type 'js/Ember' all the time.
(def Ember js/Ember)

(def HomeRoute
  (.extend (.-Route Ember)
    #js {:model
         (fn []
           "Dynamic Data")}))

(def SmallComponentComponent
  (.extend (.-Component Ember)
    #js {:dynamicAttribute "foo"
         :thing "123"
         :actions
         #js {:myAction
              (fn []
                (this-as this
                 (.set this "dynamicAttribute" "abc")))}}))

(let [application (.create (.-Application Ember))
      router (.-Router application)]

  ;; Attach route and component to the application
  (set! (.-HomeRoute application) HomeRoute)
  (set! (.-SmallComponentComponent application) SmallComponentComponent)

  ;; Set up the router
  (.map router (fn []
                 (this-as r
                   (.route r "home" #js {:path "/"})
                   (.route r "foo" #js {:path "/foo"})))))

Add some comments for fun

Add some comments for fun


(ns scrape-trs.cascade-climbers.core
  (:require [scrape-trs.cascade-climbers
             [extract-pager-urls :refer [extract-all-pager-urls]]
             [extract-tr-urls :refer [extract-tr-urls]]
             [extract-trip-report :refer [extract-trip-report]]])
  (:import scrape_trs.protocol.ScrapeTripReport))

(def base-url "http://cascadeclimbers.com/")

(defrecord CCScrapeTripReport []

  ScrapeTripReport

  (extract-pager-urls
    [this list-page]
    (extract-all-pager-urls list-page))

  (extract-trip-report-urls
    [this list-page]
    (extract-tr-urls base-url list-page))

  (extract-trip-report
    [this trip-report-url trip-report-page]
    (extract-trip-report trip-report-url trip-report-page)))

(ns scrape-trs.cascade-climbers.core
  (:require [scrape-trs.cascade-climbers
             [extract-pager-urls :refer [extract-all-pager-urls]]
             [extract-tr-urls :refer [extract-tr-urls]]
             [extract-trip-report :refer [extract-trip-report]]])
  (:import scrape_trs.protocol.ScrapeTripReport))

(def base-url "http://cascadeclimbers.com/")

(deftype CCScrapeTripReport []

  ScrapeTripReport

  (extract-pager-urls
    [this list-page]
    (extract-all-pager-urls list-page))

  (extract-trip-report-urls
    [this list-page]
    (extract-tr-urls base-url list-page))

  (extract-trip-report
    [this trip-report-url trip-report-page]
    (extract-trip-report trip-report-url trip-report-page)))

Change CCScrapeTripReport to a deftype instead of defrecord.


(ns braid.client.gateway.subs
  (:require
    [re-frame.core :refer [reg-sub]]
    [braid.client.gateway.user-auth.subs]
    [braid.client.gateway.create-group.subs]))

(reg-sub
  :gateway/field-value
  (fn [state [_ field]]
    (get-in state [:fields field :value])))

(reg-sub
  :gateway/field-errors
  (fn [state [_ field]]
    (get-in state [:fields field :errors])))

(reg-sub
  :gateway/field-status
  (fn [state [_ field]]
    (cond
      (get-in state [:fields field :typing?]) :typing
      (get-in state [:fields field :untouched?]) :untouched
      (not (empty? (get-in state [:fields field :errors]))) :invalid
      (< 0 (get-in state [:fields field :validations-left])) :loading
      :else :valid)))

(reg-sub
  :gateway/fields-valid?
  (fn [state [_ fields]]
    (->> fields
         (map (fn [field]
                (empty? (get-in state [:fields field :errors]))))
         (every? true?))))

(reg-sub
  :gateway/action-mode
  (fn [state _]
    (get-in state [:action :mode])))

(ns braid.client.gateway.subs
  (:require
    [re-frame.core :refer [reg-sub]]
    [braid.client.gateway.user-auth.subs]
    [braid.client.gateway.create-group.subs]))

(reg-sub
  :gateway/field-value
  (fn [state [_ field]]
    (get-in state [:fields field :value])))

(reg-sub
  :gateway/field-errors
  (fn [state [_ field]]
    (get-in state [:fields field :errors])))

(reg-sub
  :gateway/field-status
  (fn [state [_ field]]
    (cond
      (get-in state [:fields field :typing?]) :typing
      (get-in state [:fields field :untouched?]) :untouched
      (not (empty? (get-in state [:fields field :errors]))) :invalid
      (< 0 (get-in state [:fields field :validations-left])) :loading
      :else :valid)))

(reg-sub
  :gateway/fields-valid?
  (fn [state [_ fields]]
    (->> fields
         (map (fn [field]
                (and
                  (empty? (get-in state [:fields field :errors]))
                  (= 0 (get-in state [:fields field :validations-left]))
                  (not (get-in state [:fields field :typing?])))))
         (every? true?))))

(reg-sub
  :gateway/action-mode
  (fn [state _]
    (get-in state [:action :mode])))

Disable button while typing and doing remote validations


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

(defonce appstate (atom {}))

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

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

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

(defonce appstate (atom {}))

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

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

Add the first entry iterator.

Add the first entry iterator.


(ns oxcart.pattern)

(defn def?
  "λ AST -> Boolean

  Indicates whether the top level form of the argument AST is a def form."
  [ast]
  (-> ast
      :op
      (= :def)))

(defn def->symbol
  "λ AST -> (Option Symbol)

  If the argument form was a def, returns the defined
  symbol. Otherwise the return value is garbage."
  [ast]
  (when (def? ast)
    (:name ast)))

;;   Copyright (c) Reid McKenzie, Rich Hickey & contributors. The use
;;   and distribution terms for this software are covered by the
;;   Eclipse Public License 1.0
;;   (http://opensource.org/licenses/eclipse-1.0.php) which can be
;;   found in the file epl-v10.html at the root of this distribution.
;;   By using this software in any fashion, you are agreeing to be
;;   bound by the terms of this license.  You must not remove this
;;   notice, or any other, from this software.

(ns oxcart.pattern
  {:doc "Implements a number of pattern matching predicates and utility
        functions over the clojure.tools.analyzer.jvm AST structure."
   :added "0.0.1"
   :author "Reid McKenzie"})

;; TODO:
;;  Depending on benchmarking and API changes it may make sense to
;;  make core.match a dependency of this project rather than hard
;;  coding datastructure dependant paths and equality checks.

(defn def?
  "λ AST -> Boolean

  Indicates whether the top level form of the argument AST is a def form."
  [ast]
  (-> ast
      :op
      (= :def)))

(defn def->symbol
  "λ AST -> (Option Symbol)

  If the argument form was a def, returns the defined
  symbol. Otherwise the return value is garbage."
  [ast]
  (when (def? ast)
    (:name ast)))

Add the license and some more docs

Add the license and some more docs


(ns riemann.kairosdb-test
  (:use riemann.kairosdb
        [riemann.time :only [unix-time]]
        clojure.test)
  (:require [riemann.logging :as logging]))

(logging/init)

(deftest ^:kairosdb ^:integration kairosdb-test
         (let [k (kairosdb {:block-start true})]
           (k {:host "riemann.local"
               :service "kairosdb test"
               :state "ok"
               :description "all clear, uh, situation normal"
               :metric -2
               :time (unix-time)}))

         (let [k (kairosdb {:block-start true})]
           (k {:service "kairosdb test"
               :state "ok"
               :description "all clear, uh, situation normal"
               :metric 3.14159
               :time (unix-time)}))

         (let [k (kairosdb {:block-start true})]
           (k {:host "no-service.riemann.local"
               :state "ok"
               :description "Missing service, not transmitted"
               :metric 4
               :time (unix-time)})))

Fix up indentation in kairosdb test

Fix up indentation in kairosdb test


(defproject replete "0.1.0"
  :dependencies [[org.clojure/clojure "1.7.0-RC2"]
                 [org.clojure/clojurescript "0.0-3422"]
                 [org.clojure/tools.reader "0.10.0-SNAPSHOT" :exclusions [org.clojure/clojure]]])

(defproject replete "0.1.0"
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "0.0-3422"]
                 [org.clojure/tools.reader "0.10.0-SNAPSHOT" :exclusions [org.clojure/clojure]]])

Update to released version of Clojure

Update to released version of Clojure


(ns analyze-data.naive-bayes.predict
  (:require [clojure.core.matrix :as m]
            [analyze-data.greatest :refer [greatest]]))

(defn predict
  "parameters: map produced by analyze-data.naive-bayes.train/train
   x: vector of term weights representing a document

  Return a vector of [most-likely-label score]"
  [parameters x]
  (let [{:keys [log-phi log-phi-y]} parameters
        log-probs (->> (m/mul log-phi x)
                       (map m/esum)
                       (m/add log-phi-y))
        indexed-log-probs (map-indexed #(vector %1 %2) log-probs)]
    (reduce greatest indexed-log-probs)))

(ns analyze-data.naive-bayes.predict
  (:require [clojure.core.matrix :as m]
            [analyze-data.greatest :refer [greatest]]))

(defn predict
  "parameters: map produced by analyze-data.naive-bayes.train/train
   z: vector of term weights representing a document

  Return a vector of [most-likely-label score]"
  [parameters z]
  (let [{:keys [log-phi log-phi-y]} parameters
        log-probs (->> (m/mul log-phi z)
                       (map m/esum)
                       (m/add log-phi-y))
        indexed-log-probs (map-indexed #(vector %1 %2) log-probs)]
    (reduce greatest indexed-log-probs)))

Rename variable to z for consistency.

Rename variable to z for consistency.


(ns play-clj.repl
  (:require [play-clj.core :refer :all]))

(defn s
  "Returns the screen map in `screen-object`.

    (s main-screen)"
  [screen-object]
  (-> screen-object :screen deref))

(defn s!
  "Associates values to the screen map in `screen-object`. Returns the new
screen map.

    (s! main-screen :camera (orthographic))"
  [screen-object & args]
  (apply swap! (:screen screen-object) assoc args))

(defn e
  "Returns the entities in `screen-object`, optionally filtered by a supplied
function.

    (e main-screen :player?)"
  ([screen-object]
    (-> screen-object :entities deref))
  ([screen-object filter-fn]
    (vec (filter filter-fn (e screen-object)))))

(defn e!
  "Resets the entities in `screen-object`, or associates values to the entities
in `screen-object` that match the supplied function. Returns the entities that
were changed.

    (e! main-screen [])
    (e! main-screen :player? :health 10)"
  ([screen-object new-entities]
    (reset! (:entities screen-object) new-entities))
  ([screen-object filter-fn & args]
    (swap! (:entities screen-object)
           (fn [entities]
             (vec (for [e entities]
                    (if (filter-fn e)
                      (apply assoc e args)
                      e)))))
    (e screen-object filter-fn)))

(ns play-clj.repl
  (:require [play-clj.core :refer :all]))

(defn s
  "Returns the screen map in `screen-object`.

    (s main-screen)"
  [screen-object]
  (-> screen-object :screen deref))

(defn s!
  "Associates values to the screen map in `screen-object`. Returns the new
screen map.

    (s! main-screen :camera (orthographic))"
  [screen-object & args]
  (apply swap! (:screen screen-object) assoc args))

(defn e
  "Returns the entities in `screen-object`, optionally filtered by a supplied
function.

    (e :player? main-screen)
    (e texture? main-screen)"
  ([screen-object]
    (-> screen-object :entities deref))
  ([filter-fn screen-object]
    (vec (filter filter-fn (e screen-object)))))

(defn e!
  "Associates values to the entities in `screen-object` that match the supplied
function. Returns the entities that were changed.

    (e! :player? main-screen :health 10)"
  [filter-fn screen-object & args]
  (swap! (:entities screen-object)
         (fn [entities]
           (vec (for [e entities]
                  (if (filter-fn e)
                    (apply assoc e args)
                    e)))))
  (e filter-fn screen-object))

Make the filter-fn the first arg to be consistent with filter


(ns mirthsync.cli-test
  (:require [mirthsync.cli :refer :all]
            [clojure.test :refer :all]
            [clojure.tools
             [cli :refer [parse-opts]]]))

(deftest configuration
  (are [args] (let [conf (config args)]
                (is (seq (:exit-msg conf)))
                (is (= 1 (:exit-code conf))))
    ["blah"]
    ["-z"]
    [""]
    ["-f"]
    nil)

  (is (= 3 (:verbosity (config ["-vvv" "push"]))))

  (let [conf {:errors nil,
              :exit-code 0,
              :verbosity 0,
              :password "",
              :arguments ["push"],
              :server "https://localhost:8443/api",
              :username "admin",
              :action "push",
              :target ".",
              :exit-msg nil}]
    (is (= conf (config ["push"]))))

  (let [conf {:errors nil,
              :exit-code 0,
              :force true,
              :verbosity 0,
              :password "",
              :arguments ["pull"],
              :server "https://localhost:8443/api",
              :username "admin",
              :action "pull",
              :target ".",
              :exit-msg nil}]
    (is (= conf (config ["-f" "pull"]))))

  (is (nil? (:force (config ["pull"])))))

(ns mirthsync.cli-test
  (:require [mirthsync.cli :refer :all]
            [clojure.test :refer :all]
            [clojure.tools
             [cli :refer [parse-opts]]]))

(deftest configuration
  (testing "Fail on invalid arguments"
    (are [args] (let [conf (config args)]
                  (is (seq (:exit-msg conf)))
                  (is (= 1 (:exit-code conf))))
      ["blah"]
      ["-z"]
      [""]
      ["-f"]
      nil))

  (testing "Verbosity increases with extra v's"
    (is (= 3 (:verbosity (config ["-vvv" "push"])))))

  (testing "Sensible push defaults"
    (let [conf {:errors nil,
                :exit-code 0,
                :verbosity 0,
                :password "",
                :server "https://localhost:8443/api",
                :username "admin",
                :action "push",
                :target ".",
                :exit-msg nil}]
      (is (= conf (config ["push"])))))

  (testing "Sensible pull defaults"
    (let [conf {:errors nil,
                :exit-code 0,
                :force true,
                :verbosity 0,
                :password "",
                :server "https://localhost:8443/api",
                :username "admin",
                :action "pull",
                :target ".",
                :exit-msg nil}]
      (is (= conf (config ["-f" "pull"])))))

  (testing "Force defaults to nil"
    (is (nil? (:force (config ["pull"]))))))

Fix and annotate cli tests

Fix and annotate cli tests


zreladdr-y	+= 0x00008000
params_phys-y	:= 0x00000100
initrd_phys-y	:= 0x00800000

dtb-$(CONFIG_BOARD_SPEAR600_DT)	+= spear600-evb.dtb

SPEAr6xx: Add compilation support for dtbs using 'make dtbs'

'make dtbs' compiles all dtbs for a family. For this we need to add entries for
all board dtb's in Makefile.boot file. This patch does it.

Signed-off-by: Viresh Kumar <5ff32272b3d9f86512eddc8e0af523fc6f7924e5@st.com>


(ns tabswitcher.utils)

(defn format-result [url]
  (clojure.string/replace url #"(^https?://)|(\?.+)" ""))

(ns tabswitcher.utils)

(defn format-result [url]
  (clojure.string/replace url #"(^https?://(www\.)?)|(\?.+)" ""))

Remove www. from urls when filtering

Remove www. from urls when filtering


(ns magician.list-test
  (:require [clojure.test :refer :all]
            [magician.list :refer :all]))

(deftest numerics-test
  (is (= [1 2.0 -3] (numerics [1 2.0 -3])))
  (is (= [] (numerics ["string"])))
  (is (= [] (numerics [])))
  (is (= [1 3] (numerics [1, "two", 3, "four"]))))

(ns magician.list-test
  (:require [clojure.test :refer :all]
            [magician.list :refer :all]))

(deftest numerics-test
  (is (= '(1 2.0 -3) (numerics '(1 2.0 -3))))
  (is (= () (numerics '("string"))))
  (is (= () (numerics ())))
  (is (= '(1 3) (numerics '(1 "two" 3 "four")))))

Test with lists instead of vectors

Test with lists instead of vectors


(require '[cljs.build.api :as b])

(b/watch (b/inputs "test" "src")
  {:main 'bide.tests.benchmarks
   :target :nodejs
   :output-to "out/benchmarks.js"
   :output-dir "out/benchmarks"
   :optimizations :none
   :pretty-print true
   :verbose true})

(require '[cljs.build.api :as b])

(b/watch (b/inputs "test" "src")
  {:main 'bide.tests.benchmarks
   :target :nodejs
   :output-to "out/benchmarks.js"
   :output-dir "out/benchmarks"
   :optimizations :none
   :pretty-print false
   :verbose true})

Disable pretty printing on benchmark build.


(ns asid.wallet-repository
  (:require [clojurewerkz.neocons.rest :as nr]
            [clojurewerkz.neocons.rest.nodes :as nn]
            [clojurewerkz.neocons.rest.relationships :as nrl]))

(defn initialize! []
  (nr/connect! "http://localhost:7474/db/data/")
  (let [root (nn/get 0)
        asid-rels (nrl/outgoing-for root :types [:asid])]
    (if (seq asid-rels)
      {:root (-> asid-rels first :end nn/fetch-from)}
      (let [asid-root (nn/create {:name "asid root"})]
        (nrl/create root asid-root :asid)
        {:root asid-root}))))

(defn save [ctxt wallet]
  (let [node (nn/create {:identity (:identity wallet)})]
    (nrl/create (:root ctxt) node :wallet)
    wallet))

(ns asid.wallet-repository
  (:require [clojurewerkz.neocons.rest :as nr]
            [clojurewerkz.neocons.rest.nodes :as nn]
            [clojurewerkz.neocons.rest.relationships :as nrl]))

(defn initialize! []
  (nr/connect! "http://localhost:7474/db/data/")
  (let [root (nn/get 0)
        asid-rels (nrl/outgoing-for root :types [:asid])]
    (if (seq asid-rels)
      {:root (-> asid-rels first :end nn/fetch-from)}
      (let [asid-root (nn/create {:name "asid root"})]
        (nrl/create root asid-root :asid)
        {:root asid-root}))))

(defn attach-to-node [node link data]
  (let [data-node (nn/create data)]
        (nrl/create node data-node link)))

(defn save [ctxt wallet]
  (let [node (nn/create {:identity (:identity wallet)})]
    (doseq [data [:bag :signatures :key]]
      (attach-to-node node data (get wallet data)))
    (nrl/create (:root ctxt) node :wallet)
    wallet))

Save all the maps attached to a wallet as well.


(ns cadence.migrations
  "Define some migrations yo."
  (:require [cadence.model.migration :refer [defmigration]]
            (monger [collection :as mc]
                    [operators :refer :all]))
  (:import (org.bson.types ObjectId)))

(defn str-id
  "Helper function for generating an id when adding migrations."
  [] (str (ObjectId.)))

;; ## Define some migrations.

(defmigration "Add roles to users"
  "5108749844ae8febda9c2ed4"
  (mc/update "users" {} {$set {:roles [:user]}} :multi true)
  (mc/update "users" {} {$unset {:roles ""}} :multi true))

(ns cadence.migrations
  "Define some migrations yo."
  (:require [cadence.model.migration :refer [defmigration]]
            (monger [collection :as mc]
                    [operators :refer :all]))
  (:import (org.bson.types ObjectId)))

(defn- str-id
  "Helper function for generating an id when adding migrations."
  [] (str (ObjectId.)))

;; ## Define some migrations.

(defmigration "Add roles to users"
  "5108749844ae8febda9c2ed4"
  (do (mc/update "users" {} {$set {:roles [:user]}} :multi true)
      (mc/update "users" {:username "RyanMcG"} {$push {:roles :admin}}))
  (mc/update "users" {} {$unset {:roles ""}} :multi true))

Modify roles migration to make me an admin.


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

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

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

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

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

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

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

(run-tests)

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

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

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

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

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

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

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

(run-tests)

Change expected implementation file name for consistency


;; Copyright 2015 Timothy Brooks
;;
;; Licensed 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
;;
;; 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.

(ns beehive.future-test
  (:require [clojure.test :refer :all]
            [beehive.future :as f])
  (:import (net.uncontended.precipice.concurrent Eventual)))

(defn remove-false [f & ks]
  (filter (fn [func] (func f)) ks))

(deftest future-status
  (testing "Test that statuses work correctly."
    (let [eventual (Eventual.)
          future (f/->BeehiveFuture eventual)]
      (is (= :pending (:status future)))
      (is (:pending? future))
      (.complete eventual 4)
      (is (= :success (:status future)))
      (is (:success? future))
      (is (= [] (remove-false future :pending?))))))

Add basic tests for success futures

Add basic tests for success futures


(defproject kevin "0.1.0-SNAPSHOT"
  :description "It's like Kevin Bacon is right here!"
  :url "http://imdb.com"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [com.datomic/datomic-pro "0.9.4556"]
                 [hiccup "1.0.5"]
                 [environ "0.4.0"]
                 [ring-server "0.3.1"]
                 [compojure "1.1.6"]]
  :plugins [[lein-ring "0.8.10"]
            [lein-beanstalk "0.2.7"]]
  :aws {:access-key ~(System/getenv "AWS_ACCESS_KEY_ID")
        :secret-key ~(System/getenv "AWS_SECRET_KEY") }
  :ring {:handler kevin.system/handler
         :init kevin.system/init
         :destroy kevin.system/destroy }
  :profiles {:production
             {:ring
              {:open-browser? false :stacktraces? false :auto-reload? false}}
             :dev {:source-paths ["dev"]
                   :dependencies [[org.clojure/tools.namespace "0.2.4"]
                                  [org.clojure/java.classpath "0.2.2"]
                                  [javax.servlet/servlet-api "2.5"]
                                  [ring-mock "0.1.5"]]}}
  :jvm-opts ["-Xmx1g" "-server"]
  )

(defproject kevin "0.1.0-SNAPSHOT"
  :description "It's like Kevin Bacon is right here!"
  :url "http://imdb.com"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [com.datomic/datomic-pro "0.9.4556"]
                 [hiccup "1.0.5"]
                 [environ "0.4.0"]
                 [ring-server "0.3.1"]
                 [compojure "1.1.6"]]
  :plugins [[lein-ring "0.8.10"]
            [lein-beanstalk "0.2.7"]]
  :aws {:access-key ~(System/getenv "AWS_ACCESS_KEY_ID")
        :secret-key ~(System/getenv "AWS_SECRET_KEY") }
  :ring {:handler kevin.system/handler
         :init kevin.system/init
         :destroy kevin.system/destroy }
  :profiles {:production
             {:ring
              {:open-browser? false :stacktraces? false :auto-reload? false}}
             :dev {:source-paths ["dev"]
                   :dependencies [[org.clojure/tools.namespace "0.2.4"]
                                  [org.clojure/java.classpath "0.2.2"]
                                  [javax.servlet/servlet-api "2.5"]
                                  [ring-mock "0.1.5"]]}}
  :jvm-opts ["-Xmx4g" "-server"]
  )

Use more reasonable memory settings

Use more reasonable memory settings


(defproject clj-json "0.4.3"
  :description "Fast JSON encoding and decoding for Clojure via the Jackson library."
  :url "http://github.com/mmcgrana/clj-json"
  :source-path "src/clj"
  :java-source-path "src/jvm"
  :javac-fork "true"
  :dependencies
    [[org.clojure/clojure "1.2.0"]
     [org.codehaus.jackson/jackson-core-asl "1.5.0"]]
  :dev-dependencies
    [[org.clojars.mmcgrana/lein-javac "1.2.1"]])

(defproject clj-json "0.4.3"
  :description "Fast JSON encoding and decoding for Clojure via the Jackson library."
  :url "http://github.com/mmcgrana/clj-json"
  :source-path "src/clj"
  :java-source-path "src/jvm"
  :javac-fork "true"
  :dependencies
    [[org.clojure/clojure "1.2.0"]
     [org.codehaus.jackson/jackson-core-asl "1.5.0"]])

Remove dev dependency on old lein-javac plugin


(defproject funcool/suricatta "0.3.0"
  :description "High level sql toolkit for clojure (backed by jooq library)"
  :url "https://github.com/funcool/suricatta"
  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.jooq/jooq "3.6.0"]
                 [cats "0.4.0" :exclusions [org.clojure/clojure]]
                 [funcool/clojure.jdbc "0.5.1"]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]]

  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
  :profiles {:dev {:global-vars {*warn-on-reflection* true}
                   :dependencies [[org.clojure/clojure "1.7.0-beta2"]
                                  [postgresql "9.3-1102.jdbc41"]
                                  [com.h2database/h2 "1.4.187"]
                                  [cheshire "5.4.0"]]}}
  :java-source-paths ["src/java"])

(defproject funcool/suricatta "0.3.0"
  :description "High level sql toolkit for clojure (backed by jooq library)"
  :url "https://github.com/funcool/suricatta"
  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.jooq/jooq "3.6.1"]
                 [cats "0.4.0" :exclusions [org.clojure/clojure]]
                 [funcool/clojure.jdbc "0.5.1"]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]]

  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
  :profiles {:dev {:global-vars {*warn-on-reflection* true}
                   :dependencies [[org.clojure/clojure "1.7.0-beta2"]
                                  [postgresql "9.3-1102.jdbc41"]
                                  [com.h2database/h2 "1.4.187"]
                                  [cheshire "5.4.0"]]}}
  :java-source-paths ["src/java"])

Update jooq version to 3.6.1

Update jooq version to 3.6.1


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

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

Prepare for next release cycle.

Prepare for next release cycle.


(defproject todomvc-re-frame "0.11.0-rc2-SNAPSHOT"
  :dependencies [[org.clojure/clojure        "1.10.1"]
                 [org.clojure/clojurescript  "1.10.520"
                  :exclusions [com.google.javascript/closure-compiler-unshaded
                               org.clojure/google-closure-library]]
                 [thheller/shadow-cljs "2.8.52"]
                 [reagent "0.9.0-rc1"]
                 [re-frame "0.11.0-rc2-SNAPSHOT"]
                 [binaryage/devtools "0.9.10"]
                 [clj-commons/secretary "1.2.4"]
                 [day8.re-frame/tracing "0.5.3"]]

  :plugins [[lein-shadow "0.1.6"]]

  :clean-targets ^{:protect false} [:target-path
                                    "shadow-cljs.edn"
                                    "package.json"
                                    "package-lock.json"
                                    "resources/public/js"]

  :shadow-cljs {:nrepl {:port 8777}

                :builds {:client {:target :browser
                                  :output-dir "resources/public/js"
                                  :modules {:client {:init-fn todomvc.core/main}}
                                  :devtools {:http-root "resources/public"
                                             :http-port 8280}}}}

  :aliases {"dev-auto" ["shadow" "watch" "client"]})

(defproject todomvc-re-frame "0.11.0-rc2-SNAPSHOT"
  :dependencies [[org.clojure/clojure        "1.10.1"]
                 [org.clojure/clojurescript  "1.10.520"
                  :exclusions [com.google.javascript/closure-compiler-unshaded
                               org.clojure/google-closure-library]]
                 [thheller/shadow-cljs "2.8.59"]
                 [reagent "0.9.0-rc1"]
                 [re-frame "0.11.0-rc2-SNAPSHOT"]
                 [binaryage/devtools "0.9.10"]
                 [clj-commons/secretary "1.2.4"]
                 [day8.re-frame/tracing "0.5.3"]]

  :plugins [[lein-shadow "0.1.6"]]

  :clean-targets ^{:protect false} [:target-path
                                    "shadow-cljs.edn"
                                    "package.json"
                                    "package-lock.json"
                                    "resources/public/js"]

  :shadow-cljs {:nrepl {:port 8777}

                :builds {:client {:target :browser
                                  :output-dir "resources/public/js"
                                  :modules {:client {:init-fn todomvc.core/main}}
                                  :devtools {:http-root "resources/public"
                                             :http-port 8280}}}}

  :aliases {"dev-auto" ["shadow" "watch" "client"]})

Upgrade todomvc example shadow-cljs to 2.8.59


(ns advent2017.day4
  (:require [advent2017.core :refer [->words]]))

(defn solve [xform lines]
  (reduce (fn [counter words]
            (if (= (count words)
                   (count (set words)))
              (inc counter)
              counter))
          0
          (map (comp xform ->words) lines)))

(def solve-1 (partial solve identity))
(def solve-2 (partial solve frequencies))

(comment
  (assert (= (solve-1 ["aa bb cc dd ee"]) 1))
  (assert (= (solve-1 ["aa bb cc dd aa"]) 0))
  (assert (= (solve-1 ["aa bb cc dd aaa"]) 1))
  (solve-1 (line-seq (clojure.java.io/reader "../2017/day4.data")))

  (assert (= (solve-2 ["abcde fghij"]) 1))
  (assert (= (solve-2 ["abcde xyz ecdab"]) 0))
  (assert (= (solve-2 ["a ab abc abd abf abj"]) 1))
  (assert (= (solve-2 ["iiii oiii ooii oooi oooo"]) 1))
  (assert (= (solve-2 ["oiii ioii iioi iiio"]) 0))
  (solve-2 (line-seq (clojure.java.io/reader "../2017/day4.data"))))

(ns advent2017.day4
  "Part 1 is simply finding duplicate words, we can compare the length of the
  original list of words with the length of a set of the original list, if there
  are any duplicates the lengths will be unequal.

  Part 2 requires checking anagrams. For two words to be anagrams all we need to
  do is compare letter frequencies."
  (:require [advent2017.core :refer [->words]]))

(defn solve [xform lines]
  (reduce (fn [counter words]
            (if (= (count words)
                   (count (set words)))
              (inc counter)
              counter))
          0
          (map (comp xform ->words) lines)))

(def solve-1 (partial solve identity))
(def solve-2 (partial solve frequencies))

(comment
  (assert (= (solve-1 ["aa bb cc dd ee"]) 1))
  (assert (= (solve-1 ["aa bb cc dd aa"]) 0))
  (assert (= (solve-1 ["aa bb cc dd aaa"]) 1))
  (solve-1 (line-seq (clojure.java.io/reader "../2017/day4.data")))

  (assert (= (solve-2 ["abcde fghij"]) 1))
  (assert (= (solve-2 ["abcde xyz ecdab"]) 0))
  (assert (= (solve-2 ["a ab abc abd abf abj"]) 1))
  (assert (= (solve-2 ["iiii oiii ooii oooi oooo"]) 1))
  (assert (= (solve-2 ["oiii ioii iioi iiio"]) 0))
  (solve-2 (line-seq (clojure.java.io/reader "../2017/day4.data"))))

Add an explanation to the day 4 solution approach.

I want to try remember to do this, reading last year's solutions some of them
are hard to follow now that the thought process is not freshly in my mind.


(ns klangmeister.ui.jam
  (:require [klangmeister.ui.graph :as graph]
            [klangmeister.actions :as action]
            [klangmeister.ui.editor :as editor]))

(defn controls [handle! state]
  (let [{:keys [looping?]} (:main state)
        play (if-not looping?
               [:button {:on-click #(handle! (action/->Play :main))} "Loop"]
               [:button {:on-click #(handle! (action/->Stop :main))} "Stop"])]
    [:div {:class "controls"} play]))

(defn render [handle! state-atom]
  [:div
   [:p "Now we know how to make both instruments and melodies, we can create whole songs. To make the experience more interactive, lets graph the notes we're playing, and loop them over and over again as we edit the synth and music."]
   [graph/render handle! state-atom]
   [editor/render :main (-> @state-atom :main :text) handle! @state-atom]
   [controls handle! @state-atom]
   [:div
    [:p "If you find anything confusing, refer back to the " [:a {:href "/klangmeister/synthesis"} "synthesis tutorial"] " or the " [:a {:href "/klangmeister/music"} " music tutorial"] "."]]])

(ns klangmeister.ui.jam
  (:require [klangmeister.ui.graph :as graph]
            [klangmeister.actions :as action]
            [klangmeister.ui.editor :as editor]))

(defn controls [handle! state]
  (let [{:keys [looping?]} (:main state)
        play (if-not looping?
               [:button {:on-click #(handle! (action/->Play :main))} "Loop"]
               [:button {:on-click #(handle! (action/->Stop :main))} "Stop"])]
    [:div {:class "controls"} play]))

(defn render [handle! state-atom]
  [:div
   [graph/render handle! state-atom]
   [editor/render :main (-> @state-atom :main :text) handle! @state-atom]
   [controls handle! @state-atom]
   [:div
    [:p "Now we know how to make both instruments and melodies, we can create whole songs. To make the experience more interactive, lets graph the notes we're playing, and loop them over and over again as we edit the synth and music."]
    [:p "If you find anything confusing, refer back to the " [:a {:href "/klangmeister/synthesis"} "synthesis tutorial"] " or the " [:a {:href "/klangmeister/music"} " music tutorial"] "."]]])

Reduce the verbage leading up to performance.


{:user {:signing {:gpg-key "8ED1CE42"}

        :dependencies [[alembic "0.2.1"]
                       [clj-stacktrace "0.2.7"]
                       [criterium "0.4.2"]
                       [org.clojure/tools.namespace "0.2.5"]
                       [slamhound "1.5.3"]
                       [spyscope "0.1.4"]]

        :plugins [[cider/cider-nrepl "0.8.0-SNAPSHOT"]
                  [codox "0.6.6"]
                  [jonase/eastwood "0.1.4"]
                  [lein-ancient "0.5.5" :exclusions [commons-codec]]
                  [lein-cljsbuild "1.0.3"]
                  [lein-clojars "0.9.1"]
                  [lein-cloverage "1.0.2"]
                  [lein-difftest "2.0.0"]
                  [lein-kibit "0.0.8"]
                  [lein-marginalia "0.7.1"]
                  [lein-pprint "1.1.1"]
                  [lein-swank "1.4.4"]]

        :injections [(require
                      '[alembic.still :refer [distill]]
                      '[clojure.repl :refer [source]]
                      '[clojure.tools.namespace.repl :as repl]
                      '[criterium.core :refer [bench quick-bench]]
                      'spyscope.core)]

        :aliases {"slamhound" ["run" "-m" "slam.hound"]}
        :search-page-size 50}}

{:user {:signing {:gpg-key "8ED1CE42"}

        :dependencies [[alembic "0.2.1"]
                       [clj-stacktrace "0.2.7"]
                       [criterium "0.4.2"]
                       [org.clojure/tools.namespace "0.2.5"]
                       [slamhound "1.5.3"]
                       [spyscope "0.1.4"]]

        :plugins [[cider/cider-nrepl "0.8.0-SNAPSHOT"]
                  [codox "0.6.6"]
                  [jonase/eastwood "0.1.4"]
                  [lein-ancient "0.5.5" :exclusions [commons-codec]]
                  [lein-cljsbuild "1.0.3"]
                  [lein-clojars "0.9.1"]
                  [lein-cloverage "1.0.2"]
                  [lein-difftest "2.0.0"]
                  [lein-kibit "0.0.8"]
                  [lein-marginalia "0.7.1"]
                  [lein-pprint "1.1.1"]
                  [lein-swank "1.4.4"]]

        :injections [(require
                      '[alembic.still :refer [distill]]
                      '[clojure.repl :refer [doc source]]
                      '[clojure.tools.namespace.repl :as repl]
                      '[criterium.core :refer [bench quick-bench]]
                      'spyscope.core)]

        :aliases {"slamhound" ["run" "-m" "slam.hound"]}
        :search-page-size 50}}

Make sure doc is available in the REPL

Make sure doc is available in the REPL


(ns cortex.wiring-test
  (:use [clojure.test])
  (:use [cortex.core]))

(deftest test-function-module
  (let [m (function-module inc)]
    (is (= 2 (output (calc m 1))))))

(deftest test-stack-module
  (let [m (function-module inc)
        st (stack-module [m m])]
    (is (= 3 (output (calc st 1))))))

(ns cortex.wiring-test
  (:use [clojure.test])
  (:use [cortex.core]))

(deftest test-function-module
  (let [m (function-module inc)]
    (is (= 2 (output (calc m 1))))))

(deftest test-stack-module
  ;; simple 2-layer stack
  (let [m (function-module inc)
        st (stack-module [m m])]
    (is (= 3 (output (calc st 1)))))

  ;; empty stack
  (let [st (stack-module [])]
    (is (= 1 (output (calc st 1))))))

Add test for empty stack

Add test for empty stack


(ns uswitch.bifrost.main
  (:require [uswitch.bifrost.system :refer (make-system)]
            [uswitch.bifrost.version :refer (current-version current-build-number)]
            [com.stuartsierra.component :refer (start)]
            [clojure.tools.logging :refer (info)]
            [clojure.tools.cli :refer (parse-opts)]
            [metrics.gauges :refer (gauge)])
  (:gen-class))

(defn wait! []
  (let [s (java.util.concurrent.Semaphore. 0)]
    (.acquire s)))

(def cli-options
  [["-c" "--config CONFIG" "Path to EDN configuration file"
    :default "./etc/config.edn"
    :validate [string?]]
   ["-h" "--help"]])

(defn -main [& args]
  (let [{:keys [options summary]} (parse-opts args cli-options)]
    (when (:help options)
      (println summary)
      (System/exit 0))
    (let [{:keys [config]} options]
      (info "Bifrost" (current-version))
      (when (current-build-number)
        (gauge "build-number" (current-build-number)))
      (info "Starting Bifrost with config" config)
      (start (make-system (read-string (slurp config))))
      (wait!))))

(ns uswitch.bifrost.main
  (:require [uswitch.bifrost.system :refer (make-system)]
            [uswitch.bifrost.version :refer (current-version current-build-number)]
            [com.stuartsierra.component :refer (start)]
            [clojure.tools.logging :refer (info)]
            [clojure.tools.cli :refer (parse-opts)]
            [metrics.gauges :refer (gauge)])
  (:gen-class))

(defn wait! []
  (let [s (java.util.concurrent.Semaphore. 0)]
    (.acquire s)))

(def cli-options
  [["-c" "--config CONFIG" "Path to EDN configuration file"
    :default "./etc/config.edn"
    :validate [string?]]
   ["-h" "--help"]])

(defn credentials
  [config]
  (let [{{:keys [access-key secret-key]
          :or {access-key (System/getenv "AWS_ACCESS_KEY_ID")
               secret-key (System/getenv "AWS_SECRET_ACCESS_KEY")}} :credentials} config]
    (update-in config [:credentials]
               assoc :access-key access-key :secret-key secret-key)))

(defn -main [& args]
  (let [{:keys [options summary]} (parse-opts args cli-options)]
    (when (:help options)
      (println summary)
      (System/exit 0))
    (let [{:keys [config]} options
          config (-> config slurp read-string credentials)]
      (info "Bifrost" (current-version))
      (when (current-build-number)
        (gauge "build-number" (current-build-number)))
      (info "Starting Bifrost with config" config)
      (start (make-system config))
      (wait!))))

Read AWS credentials from environment variables.

If the credentials are not set in the configuration file, bifrost will
look for credentials in the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
environment variables.

These are the same environment variables used by the AWS SDKs as of July 2014.
(http://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs)


(defproject {{app-name}} "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                 [org.onyxplatform/onyx "0.8.0-alpha1"]
                 [com.stuartsierra/component "0.2.3"]]
  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :source-paths ["env/dev" "src"]}})

(defproject {{app-name}} "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.onyxplatform/onyx "0.8.0-alpha1"]]
  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :source-paths ["env/dev" "src"]}})

Drop core.async/component dependency These will force older versions than Onyx use internally, which is probably a bad idea


(ns blue-salamander.r3elements
  (:require-macros [blue-salamander.r3elements :as abbrev])
  (:require [goog.events :as events]
            [clojure.string :as string]))

(defn element-args [opts children]
  (cond
    (nil? opts) [nil children]
    (map? opts) [(clj->js opts) children]
    (object? opts) [opts children]))

(abbrev/defn-r3-element Renderer)
(abbrev/defn-r3-element Scene)
(abbrev/defn-r3-element Mesh)
(abbrev/defn-r3-element Object3D)
(abbrev/defn-r3-element PerspectiveCamera)

(ns blue-salamander.r3elements
  (:require-macros [blue-salamander.r3elements :as abbrev])
  (:require [goog.events :as events]
            [clojure.string :as string]))

;;
;; provides convenient definitions for threejs nodes. Instead of going:
;;
;; (js/React.createElement (js/ReactTHREE.Scene #js {} ....))
;;
;; you go:
;;
;; < require this ns as 'r3' >
;;
;; (r3/scene {} ...)
;;

(defn element-args [opts children]
  (cond
    (nil? opts) [nil children]
    (map? opts) [(clj->js opts) children]
    (object? opts) [opts children]))

(abbrev/defn-r3-element Renderer)
(abbrev/defn-r3-element Scene)
(abbrev/defn-r3-element Mesh)
(abbrev/defn-r3-element Object3D)
(abbrev/defn-r3-element PerspectiveCamera)

Comment in element convenience funcs

Comment in element convenience funcs


(defproject funcool/postal "0.1.0-SNAPSHOT"
  :description "A parser, renderer and validation layer for POSTAL protocol for Clojure and ClojureScript."
  :url "http://github.com/funcool/postal"
  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :source-paths ["src"]
  :jar-exclusions [#"\.swp|\.swo|user.clj"]
  :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
  :dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
                 [org.clojure/clojurescript "0.0-3308" :scope "provided"]
                 [org.clojure/tools.reader "0.10.0-alpha1"]
                 [funcool/cuerdas "0.5.0"]])

(defproject funcool/postal "0.1.0-SNAPSHOT"
  :description "A parser, renderer and validation layer for POSTAL protocol for Clojure and ClojureScript."
  :url "http://github.com/funcool/postal"
  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :source-paths ["src"]
  :jar-exclusions [#"\.swp|\.swo|user.clj"]
  :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
  :dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
                 [org.clojure/clojurescript "1.7.28" :scope "provided"]
                 [org.clojure/tools.reader "0.10.0-alpha3"]
                 [funcool/cuerdas "0.5.0"]])

Update cljs compiler and tools.reader versions.


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

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

Prepare for next release cycle.

Prepare for next release cycle.


(defproject io.aviso/twixt "0.1.8"
  :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.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"]]}})

Advance version number to 0.1.9

Advance version number to 0.1.9


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

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

Prepare for next release cycle.

Prepare for next release cycle.


(defproject foreclojure "0.1.3.1"
  :description "4clojure - a website for lisp beginners"
  :dependencies [[org.clojure/clojure "1.2.1"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [compojure "0.6.2"]
                 [hiccup "0.2.4"]
                 [clojail "0.4.0-SNAPSHOT"]
                 [sandbar "0.4.0-SNAPSHOT"]
                 [org.clojars.christophermaier/congomongo "0.1.4-SNAPSHOT"]
		 [org.jasypt/jasypt "1.7"]
                 [amalloy/utils "[0.3.7,)"]
                 [clj-github "1.0.1"]
                 [ring "0.3.7"]
                 [clj-config "0.1.0"]
                 [org.apache.commons/commons-email "1.2"]]
  :dev-dependencies [[lein-ring "0.4.0"]
                     [swank-clojure "1.2.1"]]
  :main foreclojure.core
  :ring {:handler foreclojure.core/app})

(defproject foreclojure "0.1.3.2"
  :description "4clojure - a website for lisp beginners"
  :dependencies [[org.clojure/clojure "1.2.1"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [compojure "0.6.2"]
                 [hiccup "0.2.4"]
                 [clojail "0.4.0-SNAPSHOT"]
                 [sandbar "0.4.0-SNAPSHOT"]
                 [org.clojars.christophermaier/congomongo "0.1.4-SNAPSHOT"]
		 [org.jasypt/jasypt "1.7"]
                 [amalloy/utils "[0.3.7,)"]
                 [clj-github "1.0.1"]
                 [ring "0.3.7"]
                 [clj-config "0.1.0"]
                 [org.apache.commons/commons-email "1.2"]]
  :dev-dependencies [[lein-ring "0.4.0"]
                     [swank-clojure "1.2.1"]]
  :main foreclojure.core
  :ring {:handler foreclojure.core/app})

Increase version number for release

Increase version number for release


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

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

Prepare for next release cycle.

Prepare for next release cycle.


(defproject manners "0.7.0"
  :description "A validation library built on using predicates properly."
  :url "https://github.com/RyanMcG/manners"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :profiles {:dev {:aliases {"incise" ^:pass-through-help ["run" "-m" "incise.core"]}
                   :resource-paths ["dev-resources"]
                   :plugins [[lein-repack "0.2.10"]]
                   :dependencies [[com.ryanmcg/incise-vm-layout "0.5.0"]
                                  [incise "0.5.0"]
                                  [com.ryanmcg/incise-codox "0.2.0"]]}
             :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
             :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
             :1.7 {:dependencies [[org.clojure/clojure "1.7.0-alpha5"]]}})

(defproject manners "0.7.0"
  :description "A validation library built on using predicates properly."
  :url "https://github.com/RyanMcG/manners"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :profiles {:dev {:aliases {"incise" ^:pass-through-help ["run" "-m" "incise.core"]}
                   :resource-paths ["dev-resources"]
                   :plugins [[lein-repack "0.2.10"]]
                   :dependencies [[com.ryanmcg/incise-vm-layout "0.5.0"]
                                  [incise "0.5.0"]
                                  [com.ryanmcg/incise-codox "0.2.0"]]}
             :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
             :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
             :1.7 {:dependencies [[org.clojure/clojure "1.7.0-beta2"]]}})

Update 1.7 version of Clojure to use beta2.


(defproject compojure "1.1.8"
  :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.3.0"]
                 [org.clojure/tools.macro "0.1.0"]
                 [clout "1.2.0"]
                 [ring/ring-core "1.3.0"]]
  :plugins [[codox "0.8.0"]]
  :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.1.8/"
          :src-linenum-anchor-prefix "L"}
  :profiles
  {:dev {:dependencies [[ring-mock "0.1.3"]
                        [javax.servlet/servlet-api "2.5"]]}
   :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
   :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
   :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}})

(defproject compojure "1.1.8"
  :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.3.0"]
                 [org.clojure/tools.macro "0.1.0"]
                 [clout "1.2.0"]
                 [ring/ring-core "1.3.1"]]
  :plugins [[codox "0.8.0"]]
  :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.1.8/"
          :src-linenum-anchor-prefix "L"}
  :profiles
  {:dev {:dependencies [[ring-mock "0.1.3"]
                        [javax.servlet/servlet-api "2.5"]]}
   :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
   :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
   :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}})

Update ring-core dependency to 1.3.1

Update ring-core dependency to 1.3.1


(ns tabswitcher.background
  (:require [khroma.log :as console]
            [khroma.runtime :as runtime]
            [cljs.core.async :refer [>! <!] :as async])
  (:require-macros [cljs.core.async.macros :refer [go go-loop]]))

(defn init []
  (go-loop [conns (runtime/connections)
            content (<! conns)]

    (let [[message & args] (<! content)]
      (console/log "Content script said: " message)
      ; keywords ends as a string there, need to read khroma
      (condp = message
        "tabs"
        (.query js/chrome.tabs #js {:currentWindow true}
                (fn [result]
                  (async/put! content result)))
        "jump"
        (let [tab-id (first args)]
          (.update js/chrome.tabs tab-id #js {:highlighted true}))
        nil
        (recur conns (<! conns)))
      (recur conns content))))

(ns tabswitcher.background
  (:require [khroma.log :as console]
            [khroma.runtime :as runtime]
            [cljs.core.async :refer [>! <!] :as async])
  (:require-macros [cljs.core.async.macros :refer [go go-loop]]))

(defn init []
  (go-loop [conns (runtime/connections)
            popup (<! conns)]

    (let [[message & args] (<! popup)]
      (console/log "popup script said: " message)
      ; keywords ends as a string there, need to read khroma
      (condp = message
        "tabs"
        (.query js/chrome.tabs #js {:currentWindow true}
                (fn [result]
                  (async/put! popup result)))
        "jump"
        (let [tab-id (first args)]
          (.update js/chrome.tabs tab-id #js {:highlighted true}))
        nil
        (recur conns (<! conns)))
      (recur conns popup))))

Clarify by renaming content into popup

Clarify by renaming content into popup


{:user {:signing {:gpg-key "8ED1CE42"}

        :dependencies [[alembic "0.2.1"]
                       [clj-stacktrace "0.2.7"]
                       [criterium "0.4.2"]
                       [org.clojure/tools.namespace "0.2.4"]
                       [slamhound "1.5.3"]
                       [spyscope "0.1.4"]]

        :plugins [[codox "0.6.6"]
                  [jonase/eastwood "0.1.1"]
                  [lein-ancient "0.5.4"]
                  [lein-cljsbuild "1.0.0"]
                  [lein-clojars "0.9.1"]
                  [lein-cloverage "1.0.2"]
                  [lein-difftest "2.0.0"]
                  [lein-kibit "0.0.8"]
                  [lein-marginalia "0.7.1"]
                  [lein-pprint "1.1.1"]
                  [lein-swank "1.4.4"]]

        :injections [(require
                      '[alembic.still :refer [distill]]
                      '[clojure.repl :refer [source]]
                      '[clojure.tools.namespace.repl :as repl]
                      '[criterium.core :refer [bench quick-bench]]
                      'spyscope.core)]

        :aliases {"slamhound" ["run" "-m" "slam.hound"]}
        :search-page-size 50}}

{:user {:signing {:gpg-key "8ED1CE42"}

        :dependencies [[alembic "0.2.1"]
                       [clj-stacktrace "0.2.7"]
                       [criterium "0.4.2"]
                       [org.clojure/tools.namespace "0.2.4"]
                       [slamhound "1.5.3"]
                       [spyscope "0.1.4"]]

        :plugins [[cider/cider-nrepl "0.7.0-SNAPSHOT"]
                  [codox "0.6.6"]
                  [jonase/eastwood "0.1.1"]
                  [lein-ancient "0.5.4"]
                  [lein-cljsbuild "1.0.0"]
                  [lein-clojars "0.9.1"]
                  [lein-cloverage "1.0.2"]
                  [lein-difftest "2.0.0"]
                  [lein-kibit "0.0.8"]
                  [lein-marginalia "0.7.1"]
                  [lein-pprint "1.1.1"]
                  [lein-swank "1.4.4"]]

        :injections [(require
                      '[alembic.still :refer [distill]]
                      '[clojure.repl :refer [source]]
                      '[clojure.tools.namespace.repl :as repl]
                      '[criterium.core :refer [bench quick-bench]]
                      'spyscope.core)]

        :aliases {"slamhound" ["run" "-m" "slam.hound"]}
        :search-page-size 50}}

Add cider-nrepl 0.7.0-SNAPSHOT to lein plugins


(ns leiningen.packagejson
  (:require [leiningen.npm :as npm]
            [cheshire.core :as json]
            [clojure.java.io :as io]
            [leiningen.npm.deps :refer [resolve-node-deps]]))

(defn- root [project]
  (if-let [root (project :npm-root)]
    (if (keyword? root)
      (project root)                                        ;; e.g. support using :target-path
      root)
    (project :root)))

(defn packagejson [project & args]
  (println "Generating package.json")
  (->> (json/generate-string
         (merge {:private true}                           ;; prevent npm warnings about repository and README
                {:name         (project :name)
                 :description  (project :description)
                 :version      (project :version)
                 :dependencies (npm/transform-deps (resolve-node-deps project))}
                (when-let [main (project :main)]
                  {:scripts {:start (str "node " main)}})
                (project :nodejs))
         {:pretty true})
       (spit (io/file (root project) "package.json"))))

(ns leiningen.packagejson
  (:require [leiningen.npm :as npm]
            [cheshire.core :as json]
            [clojure.java.io :as io]
            [leiningen.npm.deps :refer [resolve-node-deps]]))

;; inlined these bits from lein-npm as it keeps deleting the package.json after each action
;; this makes it difficult to deploy to heroku as a nodejs project.

(defn- root [project]
  (if-let [root (project :npm-root)]
    (if (keyword? root)
      (project root)                                        ;; e.g. support using :target-path
      root)
    (project :root)))

(defn packagejson [project & args]
  (println "Generating package.json")
  (->> (json/generate-string
         (merge {:private true}                           ;; prevent npm warnings about repository and README
                {:name         (project :name)
                 :description  (project :description)
                 :version      (project :version)
                 :dependencies (npm/transform-deps (resolve-node-deps project))}
                (when-let [main (project :main)]
                  {:scripts {:start (str "node " main)}})
                (project :nodejs))
         {:pretty true})
       (spit (io/file (root project) "package.json"))))

Add note about inlined bits from lein-npm


(ns flare.cljs-test
  (:require [flare.report :as report]
            [flare.diff :as diff]
            [cljs.test :as ct]))

(defn render-diff [m]
  (let [[pred & values] (second (:actual m))]
    (try
      (when (and (= pred '=) (= 2 (count values)))
        (when-let [diff (apply diff/diff* values)]
          (println "\n" (clojure.string/join "\n" (report/report* diff)))))
      (catch js/Error e
        (println "*** Oh noes! Flare threw an exception diffing the following values:")
        (println values)
        (println "*** Exception thrown is:" e)))))

(defmethod cljs.test/report [:cljs.test/default :fail] [m]
  (ct/inc-report-counter! :fail)
  (println "\nFAIL in" (ct/testing-vars-str m))
  (when (seq (:testing-contexts (ct/get-current-env)))
    (println (ct/testing-contexts-str)))
  (when-let [message (:message m)] (println message))
  (ct/print-comparison m)
  (render-diff m))

(ns flare.cljs-test
  (:require [flare.report :as report]
            [flare.diff :as diff]
            [cljs.test :as ct]))

(defn render-diff [m]
  (let [[pred & values] (second (:actual m))]
    (try
      (when (and (= pred '=) (= 2 (count values)))
        (when-let [diff (apply diff/diff* (reverse values))]
          (println "\n" (clojure.string/join "\n" (report/report* diff)))))
      (catch js/Error e
        (println "*** Oh noes! Flare threw an exception diffing the following values:")
        (println values)
        (println "*** Exception thrown is:" e)))))

(defmethod cljs.test/report [:cljs.test/default :fail] [m]
  (ct/inc-report-counter! :fail)
  (println "\nFAIL in" (ct/testing-vars-str m))
  (when (seq (:testing-contexts (ct/get-current-env)))
    (println (ct/testing-contexts-str)))
  (when-let [message (:message m)] (println message))
  (ct/print-comparison m)
  (render-diff m))

Fix ordering of actual/expected in CLJS

Fix ordering of actual/expected in CLJS


(ns comic-reader.core
  (:gen-class)
  (:require [ring.util.response :as response]
            [ring.middleware.params :refer [wrap-params]]
            [compojure.core  :as c]
            [compojure.route :as route]))

(c/defroutes routes
  (c/GET "/" [] "Hello World!")
  (c/context "/api/v1" []
    (c/GET "/comics" []
      "All the comics.")
    (c/GET "/comic/:name" [name]
      (str "Hello comic" name)))
  (route/resources "/"))

(def app (wrap-params routes))

(ns comic-reader.core
  (:gen-class)
  (:require [ring.util.response :as response]
            [ring.middleware.params :refer [wrap-params]]
            [compojure.core  :as c]
            [compojure.route :as route]))

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

(c/defroutes routes
  (c/GET "/" [] "Hello World!")
  (c/context "/api/v1" []
    (c/GET "/comics" []
      "All the comics.")
    (c/GET "/comic/:name" [name]
      (str "Hello comic" name)))
  (route/resources "/"))

(def app (wrap-params routes))

Add edn-response fn from url-shortener

Add edn-response fn from url-shortener


(ns c2.geo.core
  (:use [clojure.core.match :only [match]]
        [clojure.string :only [join]]))

(defn geo-to-svg
  "Convert geoJSON to svg path data. Takes optional projection, defaulting to identity"
  [geo & {:keys [projection]
          :or {projection identity}}]

  (defn project [coordinate]
    (join "," (projection coordinate)))
  (defn coords->path [coordinates]
    (str "M"
         (join "L" (map project coordinates))
         "Z"))
  ;;See http://geojson.org/geojson-spec.html
  ;;This SVG rendering doesn't implement the full spec.
  (match [geo]
         [{:type "FeatureCollection" :features xs}]
         (join (map geo-to-svg xs))

         [{:type "Feature" :geometry g}] (geo-to-svg g)

         [{:type "Polygon" :coordinates xs}]
         (join (map coords->path xs))

         [{:type "MultiPolygon" :coordinates xs}]
         ;;It'd be nice to recurse to the actual branch that handles Polygon, instead of repeating...
         (join (map (fn [subpoly]
                      (join (map coords->path subpoly)))
                    xs))))

(ns c2.geo.core
  (:use [clojure.core.match :only [match]]
        [clojure.string :only [join]]))

(defn geo->svg
  "Convert geoJSON to svg path data. Takes optional projection, defaulting to identity"
  [geo & {:keys [projection]
          :or {projection identity}}]

  (defn project [coordinate]
    (join "," (projection coordinate)))
  (defn coords->path [coordinates]
    (str "M"
         (join "L" (map project coordinates))
         "Z"))
  ;;See http://geojson.org/geojson-spec.html
  ;;This SVG rendering doesn't implement the full spec.
  (match [geo]
         [{:type "FeatureCollection" :features xs}]
         (join (map geo-to-svg xs))

         [{:type "Feature" :geometry g}] (geo-to-svg g)

         [{:type "Polygon" :coordinates xs}]
         (join (map coords->path xs))

         [{:type "MultiPolygon" :coordinates xs}]
         ;;It'd be nice to recurse to the actual branch that handles Polygon, instead of repeating...
         (join (map (fn [subpoly]
                      (join (map coords->path subpoly)))
                    xs))

         :else ""))

Add empty string :else clause to geo-to-svg, rename to more concise geo->svg.


(ns lein-xjc.internal.xjc
  (:import [com.sun.tools.xjc Driver]))

(defn mk-xjc-argvs
  [project-root target-dir xjc-calls]
  (map (fn [c] ["-d" (str target-dir)
                (format "%s/%s" project-root (:xsd-file c)) ])
       xjc-calls))

(defn xjc-main
  [argv]
  ;; TODO: fork process to avoid driver killing currently executing jvm
  (Driver/main (into-array String argv)))

(defn call-xjc
  [project-root target-dir xjc-calls]
  (doseq [argv (mk-xjc-argvs project-root target-dir xjc-calls)]
    (xjc-main argv)))

(ns lein-xjc.internal.xjc
  (:import [com.sun.tools.xjc Driver]))

(defn mk-xjc-argvs
  [project-root target-dir xjc-calls]
  (map (fn [c] ["-d" (str target-dir)
                (format "%s/%s" project-root (:xsd-file c)) ])
       xjc-calls))

(defn xjc-main
  [argv]
  (Driver/run (into-array String argv) (System/out) (System/err)))

(defn call-xjc
  [project-root target-dir xjc-calls]
  (doseq [argv (mk-xjc-argvs project-root target-dir xjc-calls)]
    (xjc-main argv)))

Call Driver/run instead of main.

Call Driver/run instead of main.


(ns tryclojure.views.home
  (:require [noir.core :refer [defpartial defpage]]
            [noir.response :refer [redirect]]
            [hiccup.element :refer [javascript-tag link-to unordered-list]]
            [hiccup.page :refer [include-css include-js html5]]))

(defn root-html [mode title]
  (html5
   [:head
    (include-css "/resources/public/css/tryclojure.css")
    (include-js "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
                "/resources/public/javascript/jquery-console/jquery.console.js"
                "/resources/public/javascript/tryclojure.js")
    [:title "Try Isla"]]
   [:body
    [:div#wrapper
     [:div#content
      [:div#header
       [:h1 "Try Isla"]]
      [:div#container
       [:div#console.console]]
      (javascript-tag
       (str "mode = '" mode "';"))]]]))

(defpage "/" []
  (redirect "/story"))

(defpage "/story" []
  (root-html "story" "Story time with Isla"))

(defpage "/code" []
  (root-html "isla" "Try Isla"))

(ns tryclojure.views.home
  (:require [noir.core :refer [defpartial defpage]]
            [noir.response :refer [redirect]]
            [hiccup.element :refer [javascript-tag link-to unordered-list]]
            [hiccup.page :refer [include-css include-js html5]]))

(defn root-html [mode title]
  (html5
   [:head
    (include-css "/resources/public/css/tryclojure.css")
    (include-js "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
                "/resources/public/javascript/jquery-console/jquery.console.js"
                "/resources/public/javascript/tryclojure.js")
    [:title title]]
   [:body
    [:div#wrapper
     [:div#content
      [:div#header
       [:h1 title]]
      [:div#container
       [:div#console.console]]
      (javascript-tag
       (str "mode = '" mode "';"))]]]))

(defpage "/" []
  (redirect "/story"))

(defpage "/story" []
  (root-html "story" "Story time with Isla"))

(defpage "/code" []
  (root-html "isla" "Try Isla"))

Make title reflect whether doing code or story.


(ns comic-reader.core
  (:gen-class)
  (:require [ring.util.response :as response]
            [ring.middleware.params :refer [wrap-params]]
            [compojure.core  :as c]
            [compojure.route :as route]))

(c/defroutes routes
  (c/GET "/" [] "Hello World!")
  (c/context "/api/v1" []
    (c/GET "/comic/:name" [name]
      (str "Hello comic" name)))
  (route/resources "/"))

(def app (wrap-params routes))

(ns comic-reader.core
  (:gen-class)
  (:require [ring.util.response :as response]
            [ring.middleware.params :refer [wrap-params]]
            [compojure.core  :as c]
            [compojure.route :as route]))

(c/defroutes routes
  (c/GET "/" [] "Hello World!")
  (c/context "/api/v1" []
    (c/GET "/comics" []
      "All the comics.")
    (c/GET "/comic/:name" [name]
      (str "Hello comic" name)))
  (route/resources "/"))

(def app (wrap-params routes))

Add an API endpoint for getting all comics


(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 "/" _
    {: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]]
            [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})))

Add anti forgery token route

Add anti forgery token route


(ns incise.once
  (:require (incise [load :refer [load-parsers-and-layouts]]
                    [config :as conf]
                    [utils :refer [delete-recursively directory?]])
            [clojure.java.io :refer [file]]
            [incise.parsers.core :refer [parse-all-input-files]]
            [taoensso.timbre :refer [info]]
            (stefon [settings :refer [with-options]]
                    [core :refer [precompile]])))

(defn once
  "Incise just once. This requires that config is already loaded."
  [& {:as config}]
  (conf/merge config)
  (conf/avow!)
  (let [{:keys [out-dir uri-root precompiles]} (conf/get)
        stefon-pre-opts {:mode :production
                         :serving-root out-dir
                         :uri-root uri-root
                         :precompiles precompiles}]
    (info "Clearing out" (str \" out-dir \"))
    (delete-recursively (file out-dir))
    (with-options stefon-pre-opts
      (info "Precompiling assets...")
      (precompile)
      (info "Done.")
      (load-parsers-and-layouts)
      (doall (parse-all-input-files)))))

(ns incise.once
  (:require (incise [load :refer [load-parsers-and-layouts]]
                    [config :as conf]
                    [utils :refer [delete-recursively directory?]])
            [clojure.java.io :refer [file]]
            [incise.parsers.core :refer [parse-all-input-files]]
            [taoensso.timbre :refer [info]]
            (stefon [settings :refer [with-options]]
                    [core :refer [precompile]])))

(defn once
  "Incise just once. This requires that config is already loaded."
  [& {:as config}]
  (conf/merge config)
  (conf/avow!)
  (let [{:keys [out-dir uri-root precompiles]} (conf/get)]
    (info "Clearing out" (str \" out-dir \"))
    (delete-recursively (file out-dir))
    (with-options {:mode :production
                   :serving-root out-dir
                   :precompiles precompiles}
      (info "Precompiling assets...")
      (precompile)
      (info "Done.")
      (with-options (when uri-root
                      {:generated-assets-root (str \/ uri-root "/assets/")})
        (load-parsers-and-layouts)
        (doall (parse-all-input-files))))))

Use genereated-assets-root stefon option to implement uri-root.


(ns incise.parsers.core
  (:require [incise.config :as conf]
            [incise.parsers.helpers :refer [extension]]
            [clj-time.core :as tm]
            [clojure.java.io :refer [file]]
            [clojure.string :as s])
  (:import [java.io File]))

(defrecord Parse [^String title
                  ^String extension
                  ^String content
                  ^String date
                  ^String layout
                  ^String path
                  ^clojure.lang.Seqable tags
                  ^String category])

(def parsers
  "An atom containing a mapping of extensions (strings) to parse functions. A
   parse function takes a java.io.File and returns a Parse."
  (atom {}))

(defn register
  "Register a parser for the given file extensions."
  [extensions parser]
  (swap! parsers
         merge (zipmap (map name extensions)
                       (repeat parser))))
(defn parse
  "Do all the work, parse the file and output it to the proper location."
  [^File handle]
  {:pre [(contains? @parsers (extension handle))]}
  ((@parsers (extension handle)) handle))

(ns incise.parsers.core
  (:require [incise.config :as conf]
            [incise.parsers.helpers :refer [extension]]
            [clj-time.core :as tm]
            [clojure.java.io :refer [file]]
            [taoensso.timbre :refer [with-default-outs spy trace debug info warn error fatal]]
            [clojure.string :as s])
  (:import [java.io File])
  (:refer-clojure :exclude [contains?]))

(defrecord Parse [^String title
                  ^String extension
                  ^String content
                  ^String date
                  ^String layout
                  ^String path
                  ^clojure.lang.Seqable tags
                  ^String category])

(def parsers
  "An atom containing a mapping of extensions (strings) to parse functions. A
   parse function takes a java.io.File and returns a Parse."
  (atom {}))

(defn contains? [& args]
  (apply clojure.core/contains? @parsers args))

(defn register
  "Register a parser for the given file extensions."
  [extensions parser]
  (swap! parsers
         merge (zipmap (map name extensions)
                       (repeat parser))))

(defn parse
  "Do all the work, parse the file and output it to the proper location."
  [^File handle]
  {:pre [(instance? File handle)]}
  (let [ext (extension handle)]
    (when (contains? ext)
      (info "Parsing" (.getPath handle))
      ((@parsers ext) handle))))

Modify parse to only attempt parsing when a parser exists.

Also, log the file being parsed.


(defproject {{name}} "0.1.0-SNAPSHOT"
  :description "FIXME: write this!"
  :url "http://example.com/FIXME"

  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/clojurescript "0.0-2138"]]

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

  :source-paths ["src"]

  :cljsbuild {
    :builds [{:id "{{name}}"
              :source-paths ["src"]
              :compiler {
                :output-to "{{sanitized}}.js"
                :output-dir "out"
                :optimizations :none
                :source-map true}}]})

(defproject {{name}} "0.1.0-SNAPSHOT"
  :description "FIXME: write this!"
  :url "http://example.com/FIXME"

  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/clojurescript "0.0-2173"]]

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

  :source-paths ["src"]

  :cljsbuild {
    :builds [{:id "{{name}}"
              :source-paths ["src"]
              :compiler {
                :output-to "{{sanitized}}.js"
                :output-dir "out"
                :optimizations :none
                :source-map true}}]})

Update version of ClojureScript to 0.0-2173


{:user {:plugins [[venantius/ultra "0.4.0"]]}}

{:user {:plugins [[venantius/ultra "0.4.0"]]
       :ultra  {:color-scheme :solarized_dark}}}

Add colour scheme to clojure repl

Add colour scheme to clojure repl


(ns circle.backend.build.template
  (:require [circle.backend.action.load-balancer :as lb])
  (:refer-clojure :exclude [find])
  (:use [circle.backend.action.nodes :only (start-nodes stop-nodes)])
  (:require [circle.backend.action.tag :as tag])
  (:use [circle.util.except :only (throw-if-not assert!)])
  (:use [circle.backend.action.vcs :only (checkout)])
  (:require [circle.backend.action.rvm :as rvm]))

(defn build-templates []
  ;;; defn, solely so this file doesn't need to be reloaded when reloading action fns.
  {:build {:prefix [start-nodes
                    tag/tag-revision
                    checkout
                    rvm/rvm-use]
           :suffix [stop-nodes]}

   :deploy {:prefix [start-nodes
                     tag/tag-revision
                     checkout
                     rvm/trust]
            :suffix [lb/add-instances
                     lb/wait-for-healthy
                     lb/shutdown-remove-old-revisions]}

   :staging {:prefix [start-nodes
                      tag/tag-revision
                      checkout]
             :suffix []}

   :empty {:prefix []
           :suffix []}})

(defn find [name]
  (get (build-templates) (keyword name)))

(defn find! [name]
  (assert! (find name) "could not find template %s" name))

(defn apply-template [template-name actions]
  (let [template (find! template-name)
        before (map #(apply % []) (-> template :prefix))
        after (map #(apply % []) (-> template :suffix))]
    (concat before actions after)))

(ns circle.backend.build.template
  (:require [circle.backend.action.load-balancer :as lb])
  (:refer-clojure :exclude [find])
  (:use [circle.backend.action.nodes :only (start-nodes stop-nodes)])
  (:require [circle.backend.action.tag :as tag])
  (:use [circle.util.except :only (throw-if-not assert!)])
  (:use [circle.backend.action.vcs :only (checkout)])
  (:require [circle.backend.action.rvm :as rvm]))

(defn build-templates []
  ;;; defn, solely so this file doesn't need to be reloaded when reloading action fns.
  {:build {:prefix [start-nodes
                    tag/tag-revision
                    checkout
                    rvm/rvm-use]
           :suffix [stop-nodes]}

   :deploy {:prefix [start-nodes
                     tag/tag-revision
                     checkout]
            :suffix [lb/add-instances
                     lb/wait-for-healthy
                     lb/shutdown-remove-old-revisions]}

   :staging {:prefix [start-nodes
                      tag/tag-revision
                      checkout]
             :suffix []}

   :empty {:prefix []
           :suffix []}})

(defn find [name]
  (get (build-templates) (keyword name)))

(defn find! [name]
  (assert! (find name) "could not find template %s" name))

(defn apply-template [template-name actions]
  (let [template (find! template-name)
        before (map #(apply % []) (-> template :prefix))
        after (map #(apply % []) (-> template :suffix))]
    (concat before actions after)))

Remove another rvm/trust missed in the merge


{:wrap-reload false
 :db-host "localhost"
 :db-user nil
 :db-pwd nil
 :host "smtp.googlemail.com"
 :user "team@4clojure.com"
 :problem-submission false
 :advanced-user-count 50
 :pass ""}

{:wrap-reload false
 :db-host "localhost"
 :db-user nil
 :db-pwd nil
 :host "smtp.googlemail.com"
 :user "team@4clojure.com"
 :problem-submission false
 :advanced-user-count 50
 :pass ""
 :golfing-active true}

Enable golf leagues for everyone

Enable golf leagues for everyone


(defproject {{ project_name }} "0.0.1-SNAPSHOT"
  :source-paths ["topologies"]
  :resource-paths ["_resources"]
  :target-path "_build"
  :min-lein-version "2.0.0"
  :jvm-opts ["-client"]
  :dependencies  [[org.apache.storm/storm-core "0.9.4"]
                  [com.parsely/streamparse "0.0.4-SNAPSHOT"]
                  ]
  :jar-exclusions     [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
  :uberjar-exclusions [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
  )

(defproject {{ project_name }} "0.0.1-SNAPSHOT"
  :source-paths ["topologies"]
  :resource-paths ["_resources"]
  :target-path "_build"
  :min-lein-version "2.0.0"
  :jvm-opts ["-client"]
  :dependencies  [[org.apache.storm/storm-core "0.9.5"]
                  [com.parsely/streamparse "0.0.4-SNAPSHOT"]
                  ]
  :jar-exclusions     [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
  :uberjar-exclusions [#"log4j\.properties" #"backtype" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
  )

Switch to using Storm 0.9.5 in quickstart


{:user {:plugins [[jonase/eastwood "0.2.0"]
                  [lein-kibit "0.0.8"]]}}

{:user {:plugins [[jonase/eastwood "0.2.0"]
                  [lein-kibit "0.0.8"]
                  [cider/cider-nrepl "0.8.1"]]}}

Add lein CIDER nREPL plugin

Add lein CIDER nREPL plugin