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

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

Prepare for next release cycle.

Prepare for next release cycle.


(defproject mdr2 "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [hiccup "1.0.5"]
                 [compojure "1.1.6"]
                 [com.gfredericks/java.jdbc "0.2.3-p3"]
                 [org.xerial/sqlite-jdbc "3.7.2"]]
  :plugins [[lein-ring "0.8.10"]]
  :ring {:handler mdr2.web/app}
  :profiles
  {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
                        [ring-mock "0.1.5"]]}})

(defproject mdr2 "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [hiccup "1.0.5"]
                 [compojure "1.1.6"]
                 [com.gfredericks/java.jdbc "0.2.3-p3"]
                 [org.xerial/sqlite-jdbc "3.7.2"]]
  :plugins [[lein-ring "0.8.10"]]
  :ring {:handler mdr2.web/app}
  :immutant {:context-path "/"}
  :profiles
  {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
                        [ring-mock "0.1.5"]]}})

Make sure immutant serves this at the root context


(defproject hu.ssh/github-changelog "0.1.0-SNAPSHOT"
  :description "GitHub changelog"
  :url "https://github.com/raszi/github-changelog"
  :main hu.ssh.github-changelog.cli
  :repl-options {:init-ns user}
  :license {:name "MIT"
            :url "http://choosealicense.com/licenses/mit/"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/core.match "0.3.0-alpha4"]
                 [prismatic/schema "1.0.3"]
                 [environ "1.0.1"]
                 [org.clojure/tools.cli "0.3.3"]
                 [clj-jgit "0.8.8"]
                 [tentacles "0.4.0"]
                 [grimradical/clj-semver "0.3.0-20130920.191002-3" :exclusions [org.clojure/clojure]]
                 [org.clojure/test.check "0.9.0"]]
  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :source-paths ["dev"]}
             :uberjar {:aot :all}})

(defproject hu.ssh/github-changelog "0.1.0-SNAPSHOT"
  :description "GitHub changelog"
  :url "https://github.com/raszi/github-changelog"
  :main hu.ssh.github-changelog.cli
  :repl-options {:init-ns user}
  :license {:name "MIT"
            :url "http://choosealicense.com/licenses/mit/"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/core.match "0.3.0-alpha4"]
                 [prismatic/schema "1.0.3"]
                 [environ "1.0.1"]
                 [org.clojure/tools.cli "0.3.3"]
                 [clj-jgit "0.8.8"]
                 [tentacles "0.4.0"]
                 [grimradical/clj-semver "0.3.0-20130920.191002-3" :exclusions [org.clojure/clojure]]]
  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]
                                  [org.clojure/test.check "0.9.0"]]
                   :source-paths ["dev"]}
             :uberjar {:aot :all}})

Move test.check dependency to development profile


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

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

Prepare for next release cycle.

Prepare for next release cycle.


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

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

Prepare for next release cycle.

Prepare for next release cycle.


(ns yaml.writer
 (:import (org.yaml.snakeyaml Yaml DumperOptions DumperOptions$FlowStyle)))

(def flow-styles
  {:auto DumperOptions$FlowStyle/AUTO
   :block DumperOptions$FlowStyle/BLOCK
   :flow DumperOptions$FlowStyle/FLOW})

(defn- make-dumper-options
  [& {:keys [flow-style]}]
  (doto (DumperOptions.)
    (.setDefaultFlowStyle (flow-styles flow-style))))

(defn make-yaml
  [& {:keys [dumper-options]}]
  (if dumper-options
    (Yaml. ^DumperOptions (apply make-dumper-options
                            (mapcat (juxt key val)
                              dumper-options)))
    (Yaml.)))

(defprotocol YAMLWriter
  (encode [data]))

(extend-protocol YAMLWriter
  clojure.lang.IPersistentMap
  (encode [data]
    (into {}
          (for [[k v] data]
            [(encode k) (encode v)])))
  clojure.lang.IPersistentSet
    (encode [data]
      (into #{}
        (map encode data)))
  clojure.lang.IPersistentCollection
  (encode [data]
    (map encode data))
  clojure.lang.Keyword
  (encode [data]
    (name data))
  Object
  (encode [data] data)
  nil
  (encode [data] data))

(defn generate-string [data & opts]
  (.dump ^Yaml (apply make-yaml opts)
         ^Object (encode data)))

(ns yaml.writer
 (:import (org.yaml.snakeyaml Yaml DumperOptions DumperOptions$FlowStyle)))

(def flow-styles
  {:auto DumperOptions$FlowStyle/AUTO
   :block DumperOptions$FlowStyle/BLOCK
   :flow DumperOptions$FlowStyle/FLOW})

(defn- make-dumper-options
  [& {:keys [flow-style]}]
  (doto (DumperOptions.)
    (.setDefaultFlowStyle (flow-styles flow-style))))

(defn make-yaml
  [& {:keys [dumper-options]}]
  (if dumper-options
    (Yaml. ^DumperOptions (apply make-dumper-options
                            (mapcat (juxt key val)
                              dumper-options)))
    (Yaml.)))

(defprotocol YAMLWriter
  (encode [data]))

(extend-protocol YAMLWriter
  clojure.lang.IPersistentMap
  (encode [data]
    (into {}
          (for [[k v] data]
            [(encode k) (encode v)])))
  clojure.lang.IPersistentSet
    (encode [data]
      (into #{}
        (map encode data)))
  clojure.lang.IPersistentCollection
  (encode [data]
    (map encode data))
  clojure.lang.PersistentTreeMap
  (encode [data]
    (into (sorted-map)
          (for [[k v] data]
            [(encode k) (encode v)])))
  clojure.lang.Keyword
  (encode [data]
    (name data))
  Object
  (encode [data] data)
  nil
  (encode [data] data))

(defn generate-string [data & opts]
  (.dump ^Yaml (apply make-yaml opts)
         ^Object (encode data)))

Add support for writing sorted-map

Add support for writing sorted-map


(set-env!
  :source-paths #{"src"}
  :resource-paths #{"resources"}
  :dependencies '[[org.clojure/clojure "1.8.0"]
                  [alda "1.0.0-rc34"]])

(task-options!
  pom {:project '{{app-name}}
       :version "0.1.0-SNAPSHOT"
       :description "FIXME: write description"}
  aot {:namespace #{'{{namespace}}}}
  jar {:main '{{namespace}}})

(require '{{namespace}})

(deftask run []
  (comp
    (with-pre-wrap fileset
      ({{namespace}}/-main)
      fileset)))

(deftask build []
  (comp (aot) (pom) (uber) (jar) (target)))

(set-env!
  :source-paths #{"src"}
  :resource-paths #{"resources"}
  :dependencies '[[org.clojure/clojure "1.8.0"]
                  [alda "1.0.0-rc34"]])

(task-options!
  pom {:project '{{app-name}}
       :version "0.1.0-SNAPSHOT"
       :description "FIXME: write description"}
  aot {:namespace #{'{{namespace}}}}
  jar {:main '{{namespace}}})

(require '{{namespace}})

(deftask run []
  (comp
    (watch)
    (with-pre-wrap fileset
      ({{namespace}}/-main)
      fileset)))

(deftask build []
  (comp (aot) (pom) (uber) (jar) (target)))

Watch when running audio project

Watch when running audio project


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

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

Add clojure.tools.namespace to user deps.


(ns bogo-clojure.bg-websocket
  (:gen-class)
  (:require [bogo-clojure.core :as bogo]
            [clojure.string :as string])
  (:use org.httpkit.server))

(defn process!
  [channel data]
  (let [[old-string key] (string/split-lines data)
        new-string (bogo/process-key old-string key)]
    (println old-string key new-string)
    (send! channel new-string)
    ))
(defn handler [req]
  (with-channel req channel
    (on-close channel (fn [status]
                        (println "channel closed")))
    (if (websocket? channel)
      (println "WebSocket channel")
      (println "HTTP channel"))
    (on-receive channel (fn [data]
                          (process! channel data)))))

(defn -main
  [& args]
  (run-server handler {:port 8080}))

(ns bogo-clojure.bg-websocket
  (:gen-class)
  (:require [bogo-clojure.core :as bogo]
            [bogo-clojure.bg-typemode :refer :all]
            [clojure.string :as string])
  (:use org.httpkit.server))

(def typemode (atom TELEX))

(defn process!
  [channel data]
  (let [[old-string key] (string/split-lines data)
        new-string (bogo/process-key old-string key TELEX)]
    (println old-string key new-string)
    (send! channel new-string)
    ))

(defn handler [req]
  (with-channel req channel
    (on-close channel (fn [status]
                        (println "channel closed")))
    (if (websocket? channel)
      (println "WebSocket channel")
      (println "HTTP channel"))
    (on-receive channel (fn [data]
                          (process! channel data)))))

(defn -main
  [& args]
  (if (not (empty? args))
    (reset! typemode (eval (symbol "bogo-clojure.bg-typemode" (string/uppercase (string/join args)))))
    true)
  (run-server handler {:port 8080}))

Enable typemode selection through main program arguments


(ns cawala.api.mutations
  (:require
   [taoensso.timbre :as timbre]
   [com.wsscode.pathom.core :as p]
   [com.wsscode.pathom.connect :as pc]
   [cawala.api.read :as r]
   [fulcro.server :refer [defmutation]]))

;; Place your server mutations here
#_(defmutation delete-person
  "Server Mutation: Handles deleting a person on the server"
  [{:keys [person-id]}]
  (action [{:keys [state]}]
          (timbre/info "Server deleting person" person-id)
          (swap! people-db dissoc person-id)))

(def delete-person r/delete-person)

#_(pc/defmutation delete-person [{::keys [db]} {:keys [person-id]}]
    {::pc/params [:person-id]
     ::pc/sym 'cawala.api.mutations/delete-person}
    (do
      (timbre/info "Server deleting person" person-id)
      (swap! db dissoc person-id)
      nil))

(ns cawala.api.mutations
  (:require
   [taoensso.timbre :as timbre]
   [com.wsscode.pathom.core :as p]
   [com.wsscode.pathom.connect :as pc]
   [cawala.api.read :as r]
   #_[fulcro.server :refer [defmutation]]))

;; Place your server mutations here
#_(defmutation delete-person
  "Server Mutation: Handles deleting a person on the server"
  [{:keys [person-id]}]
  (action [{:keys [state]}]
          (timbre/info "Server deleting person" person-id)
          (swap! people-db dissoc person-id)))

(def delete-person r/delete-person)

#_(pc/defmutation delete-person [{::keys [db]} {:keys [person-id]}]
    {::pc/params [:person-id]
     ::pc/sym 'cawala.api.mutations/delete-person}
    (do
      (timbre/info "Server deleting person" person-id)
      (swap! db dissoc person-id)
      nil))

Make sure to use the correct defmutation


(ns incise.watcher
  (:require [watchtower.core :refer [watcher rate file-filter extensions
                                     on-change]]))

(defn watch
  [change-fn]
  (watcher ["resources/posts/" "resources/pages/"]
           (rate 300)
           (on-change change-fn)))

(def watching nil)

(defn start-watching [& args]
  (alter-var-root #'watching (fn [& _] (apply watch args))))

(defn stop-watching []
  (when watching
    (future-cancel watching)))

(ns incise.watcher
  (:require [watchtower.core :refer [watcher rate file-filter extensions
                                     on-change]]))

(defn log-exceptions [func & args]
  "Log (i.e. print) exceptions received from the given function."
  (try
    (apply func args)
    (catch Exception e
      (println (.getMessage e)))))

(defn watch
  [change-fn]
  (watcher ["resources/posts/" "resources/pages/"]
           (rate 300)
           (on-change (partial log-exceptions change-fn))))

(def watching nil)

(defn start-watching [& args]
  (alter-var-root #'watching (fn [& _] (apply watch args))))

(defn stop-watching []
  (when watching
    (future-cancel watching)))

Add log-exceptions wrapper to watch.

Add log-exceptions wrapper to watch.


(ns mikron.runtime.core-test2
  "Property based testing namespace."
  (:require [clojure.test :as test]
            [clojure.test.check.clojure-test :as tc.test #?@(:cljs [:include-macros true])]
            [clojure.test.check.properties :as tc.prop #?@(:cljs [:include-macros true])]
            [clojure.test.check.generators :as tc.gen #?@(:cljs [:include-macros true])]
            [macrowbar.core :as macrowbar]
            [mikron.runtime.core :as mikron]
            [mikron.runtime.test-generators :as test-generators]
            [mikron.runtime.test-util :as test-util]

            ;; Load these for macrowbar
            [cljs.js]
            [cljs.env]))

;; Property based testing

(def buffer (mikron/allocate-buffer 100000))

(macrowbar/emit :debug-self-hosted
  (tc.test/defspec core-test 100
    (tc.prop/for-all
      [[schema value]
       (tc.gen/bind
         test-generators/schema-generator
         (fn [schema]
           (tc.gen/tuple (tc.gen/return (macrowbar/eval `(mikron/schema
                                                           ~schema
                                                           :processor-types #{:pack :unpack})))
                         (test-generators/value-generator schema))))]
      (test-util/equal? value (mikron/with-buffer buffer
                                (->> value (mikron/pack schema)
                                           (mikron/unpack schema)))))))

(ns mikron.runtime.core-test2
  "Property based testing namespace."
  (:require [clojure.test :as test]
            [clojure.test.check.clojure-test :as tc.test #?@(:cljs [:include-macros true])]
            [clojure.test.check.properties :as tc.prop #?@(:cljs [:include-macros true])]
            [clojure.test.check.generators :as tc.gen #?@(:cljs [:include-macros true])]

            ;; Load these for macrowbar
            [cljs.js]
            [cljs.env]

            [macrowbar.core :as macrowbar]
            [mikron.runtime.core :as mikron]
            [mikron.runtime.test-generators :as test-generators]
            [mikron.runtime.test-util :as test-util]))

;; Property based testing

(def buffer (mikron/allocate-buffer 100000))

(macrowbar/emit :debug-self-hosted
  (tc.test/defspec core-test 100
    (tc.prop/for-all
      [[schema value]
       (tc.gen/bind
         test-generators/schema-generator
         (fn [schema]
           (tc.gen/tuple (tc.gen/return (macrowbar/eval `(mikron/schema
                                                           ~schema
                                                           :processor-types #{:pack :unpack})))
                         (test-generators/value-generator schema))))]
      (test-util/equal? value (mikron/with-buffer buffer
                                (->> value (mikron/pack schema)
                                           (mikron/unpack schema)))))))

Load cljs.js and cljs.env before macrowbar is loaded (also - Trigger travis build)


(ns route-ccrs.active-routes
  (:require [clojure.java.jdbc :as jdbc]
            [yesql.core :refer [defquery]]))

(defquery active-routes "route_ccrs/sql/active_routes.sql")

(defn route-id [r]
  (select-keys r [:contract
                  :part_no
                  :bom_type_db
                  :routing_revision_no
                  :routing_alternative_no]))

(defn sorted-operations []
  (sorted-set-by
    (fn [x y]
      (compare (:operation_no x)
               (:operation_no y))) ))

(defn transduce-routes [step]
  (let [routes (volatile! {})]
    (fn
      ([] (step))
      ([r]
       (step (reduce step r @routes)))
      ([r o]
       (let [i (route-id o)
             route (conj (get @routes i (sorted-operations)) o)
             c (:operation_count o)]
         (if (and c (= (count route) c))
           (step r route)
           (do
             (vreset! routes (assoc @routes i route))
             r)))))))

(ns route-ccrs.active-routes
  (:require [clojure.java.jdbc :as jdbc]
            [yesql.core :refer [defquery]]))

(defquery active-routes "route_ccrs/sql/active_routes.sql")

(defn route-id [r]
  (select-keys r [:contract
                  :part_no
                  :lowest_level
                  :bom_type_db
                  :routing_revision_no
                  :routing_alternative_no]))

(defn sorted-operations []
  (sorted-set-by
    (fn [x y]
      (compare (:operation_no x)
               (:operation_no y))) ))

(defn transduce-routes [step]
  (let [routes (volatile! {})]
    (fn
      ([] (step))
      ([r]
       (step (reduce step r @routes)))
      ([r o]
       (let [i (route-id o)
             route (conj (get @routes i (sorted-operations)) o)
             c (:operation_count o)]
         (if (and c (= (count route) c))
           (step r route)
           (do
             (vreset! routes (assoc @routes i route))
             r)))))))

Include low level number in route ID

Include low level number in route ID


(do
  (clojure.core/use '[clojure.core])
  (require '[clojure.string :as str])
  (require '[clojure.pprint :as pp])
  (require '[clojure.math.numeric-tower :as math])
)

(let [ res (->> "%s"
                str/split-lines
                (map (fn [x] (str "  \"" (str/replace x "=" "\": \"") \")))
                (str/join ",\n")) ]
  (str "{\n" res "\n}"))

(do
  ;; Imports and aliases
  (clojure.core/use '[clojure.core])
  (require '[clojure.string :as str])
  (require '[clojure.pprint :as pp])
  (require '[clojure.math.numeric-tower :as math])

  ;; Convenience functions
  (defn codeblock [s & { type :type }] (str "```" type "\n" s "\n```"))
)

Add global codeblock function for convenience


(ns braid.search.ui.search-page-styles
  (:require
    [garden.units :refer [rem em px]]
    [braid.core.client.ui.styles.mixins :as mixins]
    [braid.core.client.ui.styles.vars :as vars]))

(def avatar-size (rem 4))

(def card-style
  [:>.card
   {:margin-bottom "50%"
    :max-width (rem 25)}

   [:>.header
    {:overflow "auto"}

    [:>.pill.off
     :>.pill.on
     {:color [["white" "!important"]]}]

    [:>.status
     {:display "inline-block"
      :margin-left (em 0.5)}
     (mixins/mini-text)]

    [:>.badges
     {:display "inline-block"
      :margin [[0 (em 0.5)]]}

     [:>.admin::before
      {:display "inline-block"
       :-webkit-font-smoothing "antialiased"}
      (mixins/fontawesome \uf0e3)]]

    [:>img.avatar
     {:margin-top (px 2)
      :border-radius (px 3)
      :width avatar-size
      :height avatar-size
      :background "white"
      :float "left"}]]

   [:>.local-time

    [:&::after
     (mixins/fontawesome \uf017)
     {:margin-left (em 0.25)}]]])

(def >search-page
  [:>.page.search

   [:>.threads
    card-style]

   [:>.content
    card-style]])

(ns braid.search.ui.search-page-styles)

(def >search-page
  [:>.page.search])

Remove unnecessary search page styles

Remove unnecessary search page styles


(ns status-im.ui.components.text-input.view
  (:require [status-im.ui.components.react :as react]
            [status-im.ui.components.text-input.styles :as styles]
            [status-im.ui.components.colors :as colors]
            [status-im.utils.platform :as platform]
            [status-im.ui.components.tooltip.views :as tooltip]))

(defn text-input-with-label [{:keys [label content error style height container text] :as props}]
  [react/view
   (when label
     [react/text {:style styles/label}
      label])
   [react/view {:style (merge (styles/input-container height) container)}
    [react/text-input
     (merge
      {:style                  (merge styles/input style)
       :placeholder-text-color colors/gray
       :auto-focus             true
       :auto-capitalize        :none}
      (dissoc props :style :height)
      (when-not platform/desktop?
        {:value text}))]
    (when content content)]
   (when error
     [tooltip/tooltip error (styles/error label)])])

(ns status-im.ui.components.text-input.view
  (:require [status-im.ui.components.react :as react]
            [status-im.ui.components.text-input.styles :as styles]
            [status-im.ui.components.colors :as colors]
            [status-im.utils.platform :as platform]
            [status-im.ui.components.tooltip.views :as tooltip]))

(defn text-input-with-label [{:keys [label content error style height container text] :as props}]
  [react/view
   (when label
     [react/text {:style styles/label}
      label])
   [react/view {:style (merge (styles/input-container height) container)}
    [react/text-input
     (merge
      {:style                  (merge styles/input style)
       :placeholder-text-color colors/gray
       :auto-focus             true
       :auto-capitalize        :none}
      (dissoc props :style :height)
      ;; Workaround until `value` TextInput field is available on desktop:
      ;; https://github.com/status-im/react-native-desktop/issues/320
      (when-not platform/desktop?
        {:value text}))]
    (when content content)]
   (when error
     [tooltip/tooltip error (styles/error label)])])

Add comment describing the rationale for the workaround


(ns caesium.crypto.generichash
  (:import (org.abstractj.kalium.crypto Hash)))

(def ^:private sixteen-nuls (byte-array 16))

(defn blake2b
  "Computes the BLAKE2b digest of the given message, with optional
  salt, key and personalization parameters."
  ([message]
     (.blake2 (new Hash) message))
  ([message & {salt :salt key :key personal :personal
               :or {salt sixteen-nuls
                    personal sixteen-nuls
                    key (byte-array 0)}}]
     (.blake2 (new Hash) message key salt personal)))

(ns caesium.crypto.generichash
  (:import (org.abstractj.kalium.crypto Hash)))

(def ^:private empty-byte-array (byte-array 0))
(def ^:private sixteen-nuls (byte-array 16))

(defn blake2b
  "Computes the BLAKE2b digest of the given message, with optional
  salt, key and personalization parameters."
  ([message]
     (.blake2 (new Hash) message))
  ([message & {salt :salt key :key personal :personal
               :or {salt sixteen-nuls
                    personal sixteen-nuls
                    key empty-byte-array}}]
     (.blake2 (new Hash) message key salt personal)))

Make the empty byte array a constant too


(ns user
  (:require [uswitch.bifrost.system :refer (make-system)]
            [clojure.tools.logging :refer (error)]
            [clojure.tools.namespace.repl :refer (refresh)]
            [com.stuartsierra.component :as component]))

(def system nil)

(defn init []
  (alter-var-root #'system
                  (constantly (make-system (read-string (slurp "./etc/config.edn"))))))

(defn start []
  (alter-var-root #'system (fn [s] (try (component/start s)
                                       (catch Exception e
                                         (error e "Error when starting system")
                                         nil))) ))

(defn stop []
  (alter-var-root #'system (fn [s] (when s (try (component/stop s)
                                               (catch Exception e
                                                 (error e "Error when stopping system")
                                                 nil))))))

(defn go []
  (init)
  (start))

(defn reset []
  (stop)
  (refresh :after 'user/go))

(ns user
  (:require [clojure.tools.logging :refer (error)]
            [clojure.tools.namespace.repl :refer (refresh)]
            [com.stuartsierra.component :as component]))

(def system nil)

(defn init []
  ;; We do some gymnastics here to make sure that the REPL can always start
  ;; even in the presence of compilation errors.
  (require '[uswitch.bifrost.system])

  (let [make-system (resolve 'uswitch.bifrost.system/make-system)]
    (alter-var-root #'system
                  (constantly (make-system (read-string (slurp "./etc/config.edn")))))))

(defn start []
  (alter-var-root #'system (fn [s] (try (component/start s)
                                       (catch Exception e
                                         (error e "Error when starting system")
                                         nil))) ))

(defn stop []
  (alter-var-root #'system (fn [s] (when s (try (component/stop s)
                                               (catch Exception e
                                                 (error e "Error when stopping system")
                                                 nil))))))

(defn go []
  (init)
  (start))

(defn reset []
  (stop)
  (refresh :after 'user/go))

Apply 'can always start the repl pattern'.

Actually this can still fail in the presence of aot'd files. have you
tried lein clean?


{:user {:dependencies [[clj-stacktrace "0.2.7"]
                       [im.chit/vinyasa "0.1.0"]
                       [io.aviso/pretty "0.1.8"]
                       [org.clojure/tools.namespace "0.2.4"]
                       [slamhound "1.3.1"]
                       [spyscope "0.1.4"]
                       [criterium "0.4.2"]]

        :plugins [[codox "0.6.6"]
                  [jonase/eastwood "0.0.2"]
                  [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 'spyscope.core
                              'vinyasa.inject
                              'io.aviso.repl
                              'clojure.repl
                              'clojure.main
                              '[criterium.core :refer [bench quick-bench]])

                     (vinyasa.inject/inject
                       'clojure.core
                       '[[vinyasa.inject [inject inject]]
                         [vinyasa.pull [pull pull]]
                         [vinyasa.lein [lein lein]]
                         [clojure.repl apropos dir doc find-doc source
                          [root-cause cause]]
                         [clojure.tools.namespace.repl [refresh refresh]]
                         [clojure.pprint [pprint >pprint]]
                         [io.aviso.binary [write-binary >bin]]])]

        :aliases {"slamhound" ["run" "-m" "slam.hound"]}
        :source-paths ["/Users/jcf/.lein/dev"]
        :search-page-size 30}}

{:user {:dependencies [[clj-stacktrace "0.2.7"]
                       [org.clojure/tools.namespace "0.2.4"]
                       [slamhound "1.3.1"]
                       [spyscope "0.1.4"]
                       [criterium "0.4.2"]]

        :plugins [[codox "0.6.6"]
                  [jonase/eastwood "0.0.2"]
                  [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 'spyscope.core
                              '[criterium.core :refer [bench quick-bench]])]

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

Remove a load of hacky Clojure injections


(ns vip.data-processor.validation.v5.retention-contest
  (:require [korma.core :as korma]
            [vip.data-processor.db.postgres :as postgres]
            [vip.data-processor.validation.v5.util :as util]))

(def validate-no-missing-candidate-ids
  (util/build-xml-tree-value-query-validator
   :errors :retention-contests :missing :missing-candidate-id
   "SELECT xtv.path
    FROM (SELECT DISTINCT subltree(path, 0, 4) || 'CandidateId' AS path
          FROM xml_tree_values WHERE results_id = ?
          AND subltree(path, 0, 4) ~ 'VipObject.0.RetentionContest.*{1}') xtv
    LEFT JOIN (SELECT path FROM xml_tree_values WHERE results_id = ?) xtv2
    ON xtv.path = subltree(xtv2.path, 0, 5)
    WHERE xtv2.path IS NULL"
   util/two-import-ids))

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

(def validate-no-missing-candidate-ids
  (util/build-xml-tree-value-query-validator
   :errors :retention-contests :missing :missing-candidate-id
   "SELECT xtv.path
    FROM (SELECT DISTINCT subltree(path, 0, 4) || 'CandidateId' AS path
          FROM xml_tree_values WHERE results_id = ?
          AND subltree(path, 0, 4) ~ 'VipObject.0.RetentionContest.*{1}') xtv
    LEFT JOIN (SELECT path FROM xml_tree_values WHERE results_id = ?) xtv2
    ON xtv.path = subltree(xtv2.path, 0, 5)
    WHERE xtv2.path IS NULL"
   util/two-import-ids))

Remove unneeded requires in RetentionContest validator


(ns braid.ui.styles.body)

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

(ns braid.ui.styles.body)

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

Add quotes to Open Sans

Add quotes to Open Sans


; https://projecteuler.net/problem=1

(ns euler.001
  (require [clojure.set :refer :all]
           [clojure.test :refer [is]]))

(defn multiple-of-n? [n, num]
  (zero? (mod num n)))

(defn multiple-of-3-or-5? [n]
  (or (multiple-of-n? 3 n)
      (multiple-of-n? 5 n)))

; Produce the entire range of numbers and then filter it down
(defn multiples-3-and-5-sol1 [min max]
  (reduce + (filter multiple-of-3-or-5? (range min max))))

(is (= 233168 (multiples-3-and-5-sol1 0 1000)))

; Use `distinct` instead
(defn multiples-3-and-5-sol2 [min max]
  (reduce + (distinct (concat (range min max 3)
                              (range min max 5)))))

(is (= 233168 (multiples-3-and-5-sol2 0 1000)))

; Produce two ranges and convert to `set` to deduplicate the range
; Apparently slightly more performant (but who cares)
(defn multiples-3-and-5-sol3 [min max]
  (reduce + (set (concat (range min max 3)
                         (range min max 5)))))

(is (= 233168 (multiples-3-and-5-sol3 0 1000)))

; https://projecteuler.net/problem=1

(ns euler.001
  (require [clojure.set :refer :all]
           [clojure.test :refer [is]]))

(defn multiple-of-n? [n, num]
  (zero? (mod num n)))

(defn multiple-of-3-or-5? [n]
  (or (multiple-of-n? 3 n)
      (multiple-of-n? 5 n)))

; Produce the entire range of numbers and then filter it down
(defn multiples-3-and-5-sol1 [min max]
  (reduce + (filter multiple-of-3-or-5? (range min max))))

; Use `distinct` instead
(defn multiples-3-and-5-sol2 [min max]
  (reduce + (distinct (concat (range min max 3)
                              (range min max 5)))))

; Produce two ranges and convert to `set` to deduplicate the range
; Apparently slightly more performant (but who cares)
(defn multiples-3-and-5-sol3 [min max]
  (reduce + (set (concat (range min max 3)
                         (range min max 5)))))

Remove inline tests in favor of dedicated test files


(ns cruncher.config)

(def api {:host "http://localhost:5000/"
          :init "api/init/"
          :base "api/"
          :login "api/login"
          :get-all-pokemon "api/pokemon"
          :toggle-favorite "api/pokemon/favorite"
          :crunch-selected-pokemon "api/pokemon/delete"
          :status-delete "api/status/delete"
          :get-player "api/player"})

(ns cruncher.config)

(def api {:host "http://localhost:5000/"
          :init "api/init/"
          :base "api/"
          :login "api/login"
          :get-all-pokemon "api/pokemon"
          :toggle-favorite "api/pokemon/favorite"
          :crunch-selected-pokemon "api/pokemon/delete"
          :status-delete "api/status/delete"
          :get-player "api/player"
          :api-status "api/status/niantic"})

Add route to ping niantic server

Add route to ping niantic server


(set-env!
  :source-paths #{"src"}
  :dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
                  [adzerk/bootlaces "0.1.13"   :scope "test"]])

(require
  '[adzerk.bootlaces :refer :all]) ;; tasks: build-jar push-snapshot push-release

(def +version+ "1.0.0")

(bootlaces! +version+)

(task-options!
  pom {:project     'afrey/boot-asset-fingerprint
       :version     +version+
       :description "Boot task to fingerprint asset references in html files."
       :url         "https://github.com/AdamFrey/boot-asset-fingerprint"
       :scm         {:url "https://github.com/AdamFrey/boot-asset-fingerprint"}
       :license     {"MIT" "https://opensource.org/licenses/MIT"}})

(deftask dev []
  (comp
    (watch)
    (build-jar)))

(set-env!
  :source-paths #{"src"}
  :dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
                  [adzerk/bootlaces "0.1.13"   :scope "test"]])

(require
  '[adzerk.bootlaces :as deploy])

(def +version+ "1.0.0")

(deploy/bootlaces! +version+)

(task-options!
  pom {:project     'afrey/boot-asset-fingerprint
       :version     +version+
       :description "Boot task to fingerprint asset references in html files."
       :url         "https://github.com/AdamFrey/boot-asset-fingerprint"
       :scm         {:url "https://github.com/AdamFrey/boot-asset-fingerprint"}
       :license     {"MIT" "https://opensource.org/licenses/MIT"}})

(deftask dev []
  (comp
    (watch)
    (deploy/build-jar)))

(deftask push-release []
  (comp
    (deploy/build-jar)
    (#'deploy/collect-clojars-credentials)
    (push
      :tag            true
      :gpg-sign       false
      :ensure-release true
      :repo           "deploy-clojars")))

Add task to push without gpg

Add task to push without gpg


(defproject lambdaui "0.3.3-SNAPSHOT"
  :description "LambdaCD-Plugin that provides a modern UI for your pipeline."
  :url "https://github.com/sroidl/lambda-ui"
  :license {:name "Apache License 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [lambdacd "0.9.3"]
                 [compojure "1.5.0"]
                 [http-kit "2.1.18"]
                 [org.clojure/data.json "0.2.6"]
                 [org.slf4j/slf4j-simple "1.7.22"]
                 [trptcolin/versioneer "0.2.0"]]

  :test-paths ["test"]
  :repositories [["snapshots" { :url "https://clojars.org/repo"
                                :username [:gpg :env]
                                :password [:gpg :env]}]
                 ["releases" { :url "https://clojars.org/repo"
                                               :username [:gpg :env]
                                               :password [:gpg :env]}]]
  :lein-release {:scm :git}
  :profiles {:dev {:dependencies [[lambdacd-git "0.1.2"]
                                  [com.gearswithingears/shrubbery "0.4.1"]
                                  [ring-cors "0.1.8"]
                                  [lambdacd-artifacts "0.2.1"]]
                   :aot          [lambdaui.testpipeline.core]
                   :main         lambdaui.testpipeline.core}})

(defproject lambdaui "0.3.3-SNAPSHOT"
  :description "LambdaCD-Plugin that provides a modern UI for your pipeline."
  :url "https://github.com/sroidl/lambda-ui"
  :license {:name "Apache License 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [lambdacd "0.9.3"]
                 [compojure "1.5.0"]
                 [http-kit "2.2.0"]
                 [org.clojure/data.json "0.2.6"]
                 [org.slf4j/slf4j-simple "1.7.22"]
                 [trptcolin/versioneer "0.2.0"]]

  :test-paths ["test"]
  :repositories [["snapshots" { :url "https://clojars.org/repo"
                                :username [:gpg :env]
                                :password [:gpg :env]}]
                 ["releases" { :url "https://clojars.org/repo"
                                               :username [:gpg :env]
                                               :password [:gpg :env]}]]
  :lein-release {:scm :git}
  :profiles {:dev {:dependencies [[lambdacd-git "0.1.2"]
                                  [com.gearswithingears/shrubbery "0.4.1"]
                                  [ring-cors "0.1.8"]
                                  [lambdacd-artifacts "0.2.1"]]
                   :aot          [lambdaui.testpipeline.core]
                   :main         lambdaui.testpipeline.core}})

Use httpkit 2.2.0 to fix memory leak with websockets (https://github.com/http-kit/http-kit/issues/165)


(ns test-pom
  (:use [leiningen.core :only [read-project defproject]]
        [leiningen.util.maven :only [make-model]]
        [leiningen.pom :only [pom]])
  (:use [clojure.test]
        [clojure.java.io :only [file delete-file]]))

(def test-project (read-project "test_projects/sample/project.clj"))

(deftest test-pom
  (let [pom-file (file (:root test-project) "pom.xml")]
    (delete-file pom-file true)
    (pom test-project)
    (is (.exists pom-file))))

(deftest test-make-model-includes-build-settings
  (let [model (make-model test-project)]
    (is (= "src" (-> model .getBuild .getSourceDirectory)))
    (is (= "test" (-> model .getBuild .getTestSourceDirectory)))))

(deftest test-snapshot-checking
  (is (thrown? Exception (pom (assoc test-project
                                :version "1.0"
                                :dependencies [['clojure "1.0.0-SNAPSHOT"]])))))

(ns test-pom
  (:use [leiningen.core :only [read-project defproject]]
        [leiningen.util.maven :only [make-model]]
        [leiningen.pom :only [pom]])
  (:use [clojure.test]
        [clojure.java.io :only [file delete-file]]))

(def test-project (read-project "test_projects/sample/project.clj"))

(deftest test-pom
  (let [pom-file (file (:root test-project) "pom.xml")]
    (delete-file pom-file true)
    (pom test-project)
    (is (.exists pom-file))))

(deftest test-make-model-includes-build-settings
  (let [model (make-model test-project)]
    (is (= "src" (-> model .getBuild .getSourceDirectory)))
    (is (= "test" (-> model .getBuild .getTestSourceDirectory)))))

(deftest test-snapshot-checking
  (let [aborted? (atom false)]
    (binding [leiningen.core/abort (partial reset! aborted?)]
      (pom (assoc test-project :version "1.0"
                  :dependencies [['clojure "1.0.0-SNAPSHOT"]]))
      (is @aborted?))))

Fix test-pom to watch for abort.

Fix test-pom to watch for abort.


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

{:user {:dependencies [[clj-stacktrace "0.2.5"]
                       [org.clojure/tools.trace "0.7.5"]
                       [org.clojure/tools.namespace "0.2.3"]
                       [redl "0.1.0"]
                       [speclj-tmux "1.0.0"]
                       [spyscope "0.1.3"]
                       [slamhound "1.3.3"]]
        :plugins [[lein-difftest "1.3.7"]
                  [lein-drip "0.1.1-SNAPSHOT"]
                  [lein-exec "0.3.0"]
                  [lein-clojars "0.9.1"]
                  [lein-pprint "1.1.1"]
                  [lein-ring "0.8.0"]
                  [lein-cljsbuild "0.1.9"]
                  [lein-deps-tree "0.1.2"]
                  [lein-marginalia "0.7.1"]]
        :repl-options {:timeout 120000}
        :injections [(require '[redl core complete])
                     (require 'spyscope.core)
                     (require 'clojure.tools.namespace)
                     (let [orig (ns-resolve (doto 'clojure.stacktrace require)
                                            'print-cause-trace)
                           new (ns-resolve (doto 'clj-stacktrace.repl require)
                                           'pst)]
                       (alter-var-root orig (constantly @new)))]
        :vimclojure-opts {:repl true}}}

Add speclj-tmux to lein user profile.

Add speclj-tmux to lein user profile.


(ns engulf.core
  (:gen-class)
  (:require [engulf.benchmark :as benchmark]
            [noir.server :as nr-server])
  (:use aleph.http
        noir.core
        lamina.core))

(defn start-webserver [args]
  (nr-server/load-views "src/engulf/views")

  (let [mode (keyword (or (first args) :dev))
          port (Integer. (get (System/getenv) "PORT" "3000"))
          noir-handler (nr-server/gen-handler {:mode mode})]
      (start-http-server
        (wrap-ring-handler noir-handler)
        {:port port :websocket true})))

(defn -main [& args]
  (start-webserver args)
  (println "Engulf Started!"))

(ns engulf.core
  (:gen-class)
  (:require [engulf.benchmark :as benchmark]
            [noir.server :as nr-server])
  (:use aleph.http
        noir.core
        lamina.core))

(defn start-webserver [args]
  (nr-server/load-views "src/engulf/views")

  (let [mode (keyword (or (first args) :prod))
          port (Integer. (get (System/getenv) "PORT" "3000"))
          noir-handler (nr-server/gen-handler {:mode mode})]
      (start-http-server
        (wrap-ring-handler noir-handler)
        {:port port :websocket true})))

(defn -main [& args]
  (start-webserver args)
  (println "Engulf Started!"))

Make prod mode the default for noir

Make prod mode the default for noir


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

(def render (renderer "lein-quick-om"))

(defn lein-quick-om
  "FIXME: write documentation"
  [name]
  (let [data {:name name
              :sanitized (name-to-path name)}]
    (main/info "Generating fresh 'lein new' lein-quick-om project.")
    (->files data
             ["src/{{sanitized}}/core.cljs" (render "core.cljs" data)]
             ["src/{{sanitized}}/devbar.cljs" (render "devbar.cljs" data)]
             ["src/{{sanitized}}/state_viewer.cljs" (render "state_viewer.cljs" data)]
             ["src/{{sanitized}}/ui.cljs" (render "ui.cljs" data)]
             ["src/{{sanitized}}/example_components.cljs" (render "example_components.cljs" data)]
             ["project.clj" (render "project.clj" data)]
             ["Dockerfile" (render "Dockerfile" data)]
             ["Makefile" (render "Makefile" data)]
             [".dockerignore" (render ".dockerignore" data)]
             ["resources/public/index.html" (render "index.html" data)]
             ["resources/public/css/style.css" (render "style.css" data)]
             )))

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

(def render (renderer "lein-quick-om"))

(defn lein-quick-om
  "FIXME: write documentation"
  [name]
  (let [data {:name name
              :sanitized (name-to-path name)}]
    (main/info "Generating fresh 'lein new' lein-quick-om project.")
    (->files data
             ["src/{{sanitized}}/main.cljs" (render "main.cljs" data)]
             ["src/{{sanitized}}/devbar.cljs" (render "devbar.cljs" data)]
             ["src/{{sanitized}}/state_viewer.cljs" (render "state_viewer.cljs" data)]
             ["src/{{sanitized}}/ui.cljs" (render "ui.cljs" data)]
             ["src/{{sanitized}}/example_components.cljs" (render "example_components.cljs" data)]
             ["project.clj" (render "project.clj" data)]
             ["Dockerfile" (render "Dockerfile" data)]
             ["Makefile" (render "Makefile" data)]
             [".dockerignore" (render ".dockerignore" data)]
             ["resources/public/index.html" (render "index.html" data)]
             ["resources/public/css/style.css" (render "style.css" data)]
             )))

Rename core to main in template code

Rename core to main in template code


(ns tesq.utils
  (:require	[clojure.string :refer [replace capitalize]]))

(defn prettify
  "Turn table name into something more human friendly."
  [s]
  (-> s capitalize (replace #"_" " ")))

(defn singularise
  "Turn plural string into singular."
  [s]
  (replace s #"s$" ""))

(ns tesq.utils
  (:require	[clojure.string :refer [replace capitalize]]))

(defn prettify
  "Turn table name into something more human friendly."
  [s]
  (-> s capitalize (replace #"_" " ")))

(defn singularise
  "Turn plural string into singular."
  [s]
  (cond

   (re-find #"ies$" s)
   (replace s #"ies$" "y")

   :else
   (replace s #"s$" "")

   ))

Handle 'ies' words in singularise fn

Handle 'ies' words in singularise fn


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

(ns uxbox.util.dom
  (:require [goog.dom :as dom]))

(defn get-element-by-class
  ([classname]
   (dom/getElementByClass classname))
  ([classname node]
   (dom/getElementByClass classname node)))

(defn stop-propagation
  [e]
  (.stopPropagation e))

(defn prevent-default
  [e]
  (.preventDefault e))

(defn event->inner-text
  [e]
  (.-innerText (.-target e)))

(defn event->value
  [e]
  (.-value (.-target e)))

(defn event->target
  [e]
  (.-target e))

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

(ns uxbox.util.dom
  (:require [goog.dom :as dom]))

(defn get-element-by-class
  ([classname]
   (dom/getElementByClass classname))
  ([classname node]
   (dom/getElementByClass classname node)))

(defn stop-propagation
  [e]
  (when e
    (.stopPropagation e)))

(defn prevent-default
  [e]
  (when e
    (.preventDefault e)))

(defn event->inner-text
  [e]
  (.-innerText (.-target e)))

(defn event->value
  [e]
  (.-value (.-target e)))

(defn event->target
  [e]
  (.-target e))

Make prevent-default and stop-propagation functions nil safe.


(defproject totem-destroyer "0.0.1-SNAPSHOT"
  :description "FIXME: write description"

  :dependencies [[com.badlogicgames.gdx/gdx "1.9.3"]
                 [com.badlogicgames.gdx/gdx-backend-lwjgl "1.9.3"]
                 [com.badlogicgames.gdx/gdx-box2d "1.9.3"]
                 [com.badlogicgames.gdx/gdx-box2d-platform "1.9.3"
                  :classifier "natives-desktop"]
                 [com.badlogicgames.gdx/gdx-bullet "1.9.3"]
                 [com.badlogicgames.gdx/gdx-bullet-platform "1.9.3"
                  :classifier "natives-desktop"]
                 [com.badlogicgames.gdx/gdx-platform "1.9.3"
                  :classifier "natives-desktop"]
                 [org.clojure/clojure "1.7.0"]
                 [play-clj "1.1.1"]]

  :source-paths ["src" "src-common"]
  :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
  :aot [totem-destroyer.core.desktop-launcher]
  :main totem-destroyer.core.desktop-launcher)

(defproject totem-destroyer "0.0.1-SNAPSHOT"
  :description "FIXME: write description"

  :dependencies [[com.badlogicgames.gdx/gdx "1.9.3"]
                 [com.badlogicgames.gdx/gdx-backend-lwjgl "1.9.3"]
                 [com.badlogicgames.gdx/gdx-box2d "1.9.3"]
                 [com.badlogicgames.gdx/gdx-box2d-platform "1.9.3"
                  :classifier "natives-desktop"]
                 [com.badlogicgames.gdx/gdx-bullet "1.9.3"]
                 [com.badlogicgames.gdx/gdx-bullet-platform "1.9.3"
                  :classifier "natives-desktop"]
                 [com.badlogicgames.gdx/gdx-platform "1.9.3"
                  :classifier "natives-desktop"]
                 [org.clojure/clojure "1.7.0"]
                 [play-clj "1.2.0-SNAPSHOT"]]

  :source-paths ["src" "src-common"]
  :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
  :aot [totem-destroyer.core.desktop-launcher]
  :main totem-destroyer.core.desktop-launcher)

Use local snapshot version of play-clj with fixes


(ns solver.core
  (:gen-class))

(def vowels #{"a" "e" "i" "o" "u"})
(defn contains-at-least-three-vowels [word]
  (>= (count (filter vowels (clojure.string/split word #""))) 3))
(defn contains-repeated-letter [word]
  (re-find #"(\w)\1" word))
(defn contains-forbidden-string [word]
  (re-find #"ab|cd|pq|xy" word))

(defn nice-word [word]
  (and
   (contains-at-least-three-vowels word)
   (contains-repeated-letter word)
   (not
    (contains-forbidden-string word))))

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  (with-open [rdr (clojure.java.io/reader "input")]
    (println (count (filter nice-word (line-seq rdr))))))

(ns solver.core
  (:gen-class))

(def vowels #{"a" "e" "i" "o" "u"})
(defn contains-at-least-three-vowels [word]
  (>= (count (filter vowels (clojure.string/split word #""))) 3))
(defn contains-repeated-letter [word]
  (re-find #"(\w)\1" word))
(defn contains-forbidden-string [word]
  (re-find #"ab|cd|pq|xy" word))

(defn nice-word [word]
  (and
   (contains-at-least-three-vowels word)
   (contains-repeated-letter word)
   (not
    (contains-forbidden-string word))))

(defn contains-repeated-pair [word]
  (re-find #"(\w{2})\w*\1" word))
(defn contains-palindrome-trigram [word]
  (re-find #"(\w)\w\1" word))

(defn nice-word2 [word]
  (and
   (contains-repeated-pair word)
   (contains-palindrome-trigram word)))

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  (with-open [rdr (clojure.java.io/reader "input")]
    (let [words (line-seq rdr)]
      (println (count (filter nice-word words)))
      (println (count (filter nice-word2 words))))))

Solve part two of day 5 puzzle

Solve part two of day 5 puzzle


(set-env!
  :source-paths #{"src"}
  :dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
                  [adzerk/bootlaces "0.1.13"   :scope "test"]])

(require
  '[adzerk.bootlaces :refer :all]) ;; tasks: build-jar push-snapshot push-release

(def +version+ "1.0.0-SNAPSHOT")

(bootlaces! +version+)

(task-options!
  pom {:project 'afrey/boot-asset-fingerprint
       :version +version+
       :description "Boot task to fingerprint asset references in html files."
       :url "https://github.com/pointslope/boot-fingerprint"
       :scm {:url "https://github.com/pointslope/boot-fingerprint"}
       :license {"EPL" "http://www.eclipse.org/legal/epl-v10.html"}})

(set-env!
  :source-paths #{"src"}
  :dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
                  [adzerk/bootlaces "0.1.13"   :scope "test"]])

(require
  '[adzerk.bootlaces :refer :all]) ;; tasks: build-jar push-snapshot push-release

(def +version+ "1.0.0-SNAPSHOT")

(bootlaces! +version+)

(task-options!
  pom {:project 'afrey/boot-asset-fingerprint
       :version +version+
       :description "Boot task to fingerprint asset references in html files."
       :url "https://github.com/AdamFrey/boot-asset-fingerprint"
       :scm {:url "https://github.com/AdamFrey/boot-asset-fingerprint"}
       :license {"EPL" "http://www.eclipse.org/legal/epl-v10.html"}})

Update pom urls for library

Update pom urls for library


(ns subman.helpers
  (:require [net.cgrand.enlive-html :as html]
            [org.httpkit.client :as http]
            [subman.const :as const]))

(defn remove-first-0
  "Remove first 0 from string"
  [query]
  (clojure.string/replace query #"^(0+)" ""))

(defn get-from-line
  "Get parsed html from line"
  [line]
  (html/html-resource (java.io.StringReader. line)))

(defn fetch
  "Fetch url content"
  [url]
  (-> url
      (http/get {:timeout const/conection-timeout})
      deref
      :body
      get-from-line))

(defn nil-to-blank
  "Replace nil with blank string"
  [item]
  (if (nil? item)
    ""
    item))

(defn make-safe
  "Make fnc call safe"
  [fnc fallback]
  (fn [x]
    (try (fnc x)
      (catch Exception e (do (println e)
                           fallback)))))

(defn get-season-episode
  "Add season and episode filters"
  [text]
  (if-let [nums (re-find #"[sS](\d+)[eE](\d+)" text)]
    [(remove-first-0 (get nums 1))
     (remove-first-0 (get nums 2))]
    ["" ""]))

(defn get-from-file
  "Get parsed html from file"
  [path]
  (html/html-resource (java.io.StringReader.
                       (slurp path))))

(ns subman.helpers
  (:require [net.cgrand.enlive-html :as html]
            [org.httpkit.client :as http]
            [subman.const :as const]))

(defn remove-first-0
  "Remove first 0 from string"
  [query]
  (clojure.string/replace query #"^(0+)" ""))

(defn get-from-line
  "Get parsed html from line"
  [line]
  (html/html-resource (java.io.StringReader. line)))

(defn fetch
  "Fetch url content"
  [url]
  (-> url
      (http/get {:timeout const/conection-timeout})
      deref
      :body
      get-from-line))

(defn nil-to-blank
  "Replace nil with blank string"
  [item]
  (if (nil? item)
    ""
    item))

(defn make-safe
  "Make fnc call safe"
  [fnc fallback]
  (fn [x]
    (try (fnc x)
      (catch Exception e (do (println e)
                           fallback)))))

(defn get-season-episode
  "Add season and episode filters"
  [text]
  (if-let [[_ season episode] (re-find #"[sS](\d+)[eE](\d+)" text)]
    [(remove-first-0 season)
     (remove-first-0 episode)]
    ["" ""]))

(defn get-from-file
  "Get parsed html from file"
  [path]
  (html/html-resource (java.io.StringReader.
                       (slurp path))))

Use destruction in getting season-episode part


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

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

Bump jline to handle inputrc problems

Bump jline to handle inputrc problems


(defproject degasolv/degasolv "1.2.0"
  :description "Dependency tracker with an eye toward building and shipping software."
  :url "http://github.com/djhaskin987/degasolv"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :main degasolv.cli
  :dependencies [
                 [org.clojure/clojure "1.9.0-alpha14"]
                 [version-clj "0.1.2"]
                 [org.clojure/tools.cli "0.3.5"]
                 [me.raynes/fs "1.4.6"]
                 [com.velisco/tagged "0.5.0"]
                 ]
  :plugins [[lein-print "0.1.0"]]
  :test-selectors
  {
   :resolve-basic :resolve-basic
   :resolve-harden :resolve-harden
   :string-to-requirement :string-to-requirement
   :repo-aggregation :repo-aggregation
   :resolve-conflict-strat :resolve-conflict-strat
   }
  :profiles {
             :dev {:dependencies [
                                  [org.clojure/core.match "0.3.0-alpha4"]
                                  [version-clj "0.1.2"
                                   :exclusions [org.clojure/clojure]]
                                  ]}
             :uberjar {:aot [degasolv.cli degasolv.resolver]}
             }
  :target-path "target/%s")

(defproject degasolv/degasolv "1.2.1-SNAPSHOT"
  :description "Dependency tracker with an eye toward building and shipping software."
  :url "http://github.com/djhaskin987/degasolv"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :main degasolv.cli
  :dependencies [
                 [org.clojure/clojure "1.9.0-alpha14"]
                 [version-clj "0.1.2"]
                 [org.clojure/tools.cli "0.3.5"]
                 [me.raynes/fs "1.4.6"]
                 [com.velisco/tagged "0.5.0"]
                 ]
  :plugins [[lein-print "0.1.0"]]
  :test-selectors
  {
   :resolve-basic :resolve-basic
   :resolve-harden :resolve-harden
   :string-to-requirement :string-to-requirement
   :repo-aggregation :repo-aggregation
   :resolve-conflict-strat :resolve-conflict-strat
   }
  :profiles {
             :dev {:dependencies [
                                  [org.clojure/core.match "0.3.0-alpha4"]
                                  [version-clj "0.1.2"
                                   :exclusions [org.clojure/clojure]]
                                  ]}
             :uberjar {:aot [degasolv.cli degasolv.resolver]}
             }
  :target-path "target/%s")

Bump version number, fix markdown

Bump version number, fix markdown


(defproject suricatta "0.1.0-SNAPSHOT"
  :description "High level sql toolkit for clojure (backed by jooq library)"
  :url "http://example.com/FIXME"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0.txt"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.jooq/jooq "3.4.2"]
                 [clojure.jdbc "0.3.0"]
                 [postgresql "9.3-1101.jdbc41"]
                 [com.h2database/h2 "1.3.176"]])

(defproject suricatta "0.1.0-SNAPSHOT"
  :description "High level sql toolkit for clojure (backed by jooq library)"
  :url "http://example.com/FIXME"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0.txt"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.jooq/jooq "3.4.4"]
                 [clojure.jdbc "0.3.0"]
                 [postgresql "9.3-1101.jdbc41"]
                 [com.h2database/h2 "1.3.176"]])

Update jOOQ version to 3.4.4

Update jOOQ version to 3.4.4


(defproject cake "0.7.0-beta1"
  :description "Save your fork, there's cake!"
  :dependencies [[clojure "1.2.0"]
                 [clojure-contrib "1.2.0"]
                 [uncle "0.2.3"]
                 [depot "0.1.7"]
                 [classlojure "0.6.3"]
                 [useful "0.7.4-alpha4"]
                 [slingshot "0.7.2"]
                 [org.clojure/tools.namespace "0.1.1" :exclusions [org.clojure/java.classpath]]
                 [org.clojars.ninjudd/java.classpath "0.1.2-SNAPSHOT"]
                 [org.clojars.ninjudd/data.xml "0.0.1-SNAPSHOT"]
                 [com.jcraft/jsch "0.1.42"]
                 [difform "1.1.1"]
                 [org.clojars.rosejn/clansi "1.2.0-SNAPSHOT" :exclusions [org.clojure/clojure]]
                 [clj-stacktrace "0.2.3"]]
  :copy-deps true)

(defproject cake "0.7.0-beta1"
  :description "Save your fork, there's cake!"
  :dependencies [[clojure "1.2.0"]
                 [uncle "0.2.3"]
                 [depot "0.1.7"]
                 [classlojure "0.6.3"]
                 [useful "0.7.4-alpha4"]
                 [slingshot "0.7.2"]
                 [org.clojure/tools.namespace "0.1.1" :exclusions [org.clojure/java.classpath]]
                 [org.clojars.ninjudd/java.classpath "0.1.2-SNAPSHOT"]
                 [org.clojars.ninjudd/data.xml "0.0.1-SNAPSHOT"]
                 [com.jcraft/jsch "0.1.42"]
                 [difform "1.1.1"]
                 [org.clojars.rosejn/clansi "1.2.0-SNAPSHOT" :exclusions [org.clojure/clojure]]
                 [clj-stacktrace "0.2.3"]]
  :copy-deps true)

Remove the contrib dep, since we're no longer depending on it.


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

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

Prepare for next release cycle.

Prepare for next release cycle.


(defproject statuses "1.0.0-SNAPSHOT"
  :description "Statuses app for innoQ"
  :url "https://github.com/innoq/statuses"
  :license {:name "Apache License, Version 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"
            :distribution :repo
            :comments "A business-friendly OSS license"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [ring "1.3.1"]
                 [compojure "1.2.1"]
                 [clj-time "0.8.0"]
                 [org.clojure/data.json "0.2.5"]]
  :pedantic? :abort
  :plugins [[jonase/eastwood "0.1.5"]]
  :profiles {:dev {:dependencies [[ring-mock "0.1.5"]]}
             :uberjar {:aot [statuses.server]}}
  :main statuses.server
  :aliases {"lint" "eastwood"})

(defproject statuses "1.0.0-SNAPSHOT"
  :description "Statuses app for innoQ"
  :url "https://github.com/innoq/statuses"
  :license {:name "Apache License, Version 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"
            :distribution :repo
            :comments "A business-friendly OSS license"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [ring "1.3.1"]
                 [compojure "1.2.1"]
                 [clj-time "0.8.0"]
                 [org.clojure/data.json "0.2.5"]]
  :pedantic? :abort
  :plugins [[jonase/eastwood "0.2.0"]]
  :profiles {:dev {:dependencies [[ring-mock "0.1.5"]]}
             :uberjar {:aot [statuses.server]}}
  :main statuses.server
  :aliases {"lint" "eastwood"}
  :eastwood {:exclude-linters [:constant-test]})

Upgrade eastwood plugin to 0.2.0.

Upgrade eastwood plugin to 0.2.0.

Exclude of linter _constant-test_ is necessary because it evaluates the
expanded _html5_ macro defined by _hiccup_ which produces a warning.


(defproject cli4clj "1.0.0"
;(defproject cli4clj "1.0.1-SNAPSHOT"
  :description "Create simple interactive CLIs for Clojure applications."
  :url "https://github.com/ruedigergad/cli4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [clj-assorted-utils "1.11.0"]
                 [jline/jline "2.13"]]
  :global-vars {*warn-on-reflection* true}
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^cli4clj.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/cli4clj/blob/master"
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :main cli4clj.example
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.1.3"] [lein-html5-docs "3.0.3"]])

;(defproject cli4clj "1.0.0"
(defproject cli4clj "1.0.1-SNAPSHOT"
  :description "Create simple interactive CLIs for Clojure applications."
  :url "https://github.com/ruedigergad/cli4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [clj-assorted-utils "1.11.0"]
                 [jline/jline "2.13"]]
  :global-vars {*warn-on-reflection* true}
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^cli4clj.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/cli4clj/blob/master"
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :main cli4clj.example
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.1.3"] [lein-html5-docs "3.0.3"]])

Revert back to snapshot version.

Revert back to snapshot version.


(defproject reply "0.1.0-SNAPSHOT"
  :description "REPL-y: A fitter, happier, more productive REPL for Clojure."
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojars.trptcolin/jline "2.6-alpha1"]
                 [org.thnetos/cd-client "0.3.1" :exclusions [org.clojure/clojure]]
                 [clj-stacktrace "0.2.4"]
                 [clojure-complete "0.2.1" :exclusions [org.clojure/clojure]]
                 [org.clojure/tools.nrepl "0.2.0-beta1"]]
  :dev-dependencies [[midje "1.3-alpha4" :exclusions [org.clojure/clojure]]
                     [lein-midje "[1.0.0,)"]]
  :aot [reply.reader.jline.JlineInputReader]
  :source-path "src/clj"
  :java-source-path "src/java")

(defproject reply "0.1.0-SNAPSHOT"
  :description "REPL-y: A fitter, happier, more productive REPL for Clojure."
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [jline "2.6"]
                 [org.thnetos/cd-client "0.3.1" :exclusions [org.clojure/clojure]]
                 [clj-stacktrace "0.2.4"]
                 [clojure-complete "0.2.1" :exclusions [org.clojure/clojure]]
                 [org.clojure/tools.nrepl "0.2.0-beta1"]]
  :dev-dependencies [[midje "1.3-alpha4" :exclusions [org.clojure/clojure]]
                     [lein-midje "[1.0.0,)"]]
  :aot [reply.reader.jline.JlineInputReader]
  :source-path "src/clj"
  :java-source-path "src/java")

Use the official jline from central

Use the official jline from central

closes #25


(defproject org.onyxplatform/onyx-metrics "0.8.1.0-0.8.1"
  :description "Instrument Onyx workflows"
  :url "https://github.com/MichaelDrogalis/onyx"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.8.1"]
                 [org.clojure/clojure "1.7.0"]
                 [interval-metrics "1.0.0"]
                 [stylefruits/gniazdo "0.4.0"]]
  :java-opts ^:replace ["-server" "-Xmx3g"]
  :global-vars  {*warn-on-reflection* true
                 *assert* false
                 *unchecked-math* :warn-on-boxed}
  :profiles {:dev {:dependencies [[riemann-clojure-client "0.4.1"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}})

(defproject org.onyxplatform/onyx-metrics "0.8.1.1-SNAPSHOT"
  :description "Instrument Onyx workflows"
  :url "https://github.com/MichaelDrogalis/onyx"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :dependencies [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.8.1"]
                 [org.clojure/clojure "1.7.0"]
                 [interval-metrics "1.0.0"]
                 [stylefruits/gniazdo "0.4.0"]]
  :java-opts ^:replace ["-server" "-Xmx3g"]
  :global-vars  {*warn-on-reflection* true
                 *assert* false
                 *unchecked-math* :warn-on-boxed}
  :profiles {:dev {:dependencies [[riemann-clojure-client "0.4.1"]]
                   :plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}})

Prepare for next release cycle.

Prepare for next release cycle.


(ns tako.core
  (:require [tako.github :as github]
            [tako.slack :as slack]
            [clojure.tools.logging :refer [info]])
  (:gen-class
   :methods [^:static [handler [Object] String]]))

(defn -handler [unused]
  (info (str "Called tako from lambda... " unused))
  (binding [tako.github/github-token "herewego"]
    (slack/publish-notifications (github/poll-notifications))))

(defn -main
  "This function is included for testing purposes. It is NOT used by AWS lambda.
  It is intended to be used with `lein run your-github-token`"
  [& args]
  (info "Running tako from main...")
  (binding [tako.github/github-token (first args)
            tako.slack/slack-webhook-url (second args)]
    (slack/publish-notifications (github/poll-notifications))))

(ns tako.core
  (:require [tako.github :as github]
            [tako.slack :as slack]
            [clojure.tools.logging :refer [info]])
  (:gen-class
   :methods [^:static [handler [Object] String]]))

(def github-token      "PLACE YOUR GITHUB TOKEN HERE")
(def slack-webhook-url "PLACE THE SLACK WEBHOOK URL HERE")

(defn -handler
  "This is the function called by AWS Lambda"
  [unused]
  (info (str "Called tako from lambda... "))
  (binding [tako.github/github-token github-token
            tako.slack/slack-webhook-url slack-webhook-url]
    (slack/publish-notifications (github/poll-notifications))))

(defn -main
  "This function is included for testing purposes. It is NOT used by AWS lambda.
  It is intended to be used with `lein run your-github-token slack-url`"
  [& args]
  (info "Running tako from main...")
  (binding [tako.github/github-token (first args)
            tako.slack/slack-webhook-url (second args)]
    (slack/publish-notifications (github/poll-notifications))))

Move declaration of GH token and Slack URL outside handler fn


(ns circle.system
  (:require [circle.backend.build.run :as run])
  (:require [circle.backend.ec2 :as ec2])
  (:use [clojure.tools.logging :only (infof)]))

(defn graceful-shutdown
  "Shutdown there are no more running builds."
  []
  (letfn [(shutdown []
            (infof "graceful shutdown watcher, count=%s" (count @run/in-progress))
            (when (zero? (count @run/in-progress))
              (let [id (ec2/self-instance-id)]
                (when id
                  (infof "calling self-terminate on %s" id)
                  (ec2/terminate-instances! id)))))]
    (add-watch run/in-progress :shutdown (fn [key in-progress old-state new-state]
                                           (shutdown)))
    (shutdown)))

(ns circle.system
  (:require [circle.backend.build.run :as run])
  (:require [circle.backend.build :as build])
  (:require [circle.backend.ec2 :as ec2])
  (:use [clojure.tools.logging :only (infof)]))

(defn graceful-shutdown
  "Shutdown there are no more running builds."
  []
  (letfn [(shutdown []
            (infof "graceful shutdown watcher, count=%s builds=%s" (count @run/in-progress) (map build/build-name @run/in-progress))

            (when (zero? (count @run/in-progress))
              (let [id (ec2/self-instance-id)]
                (when id
                  (infof "calling self-terminate on %s" id)
                  (ec2/terminate-instances! id)))))]
    (add-watch run/in-progress :shutdown (fn [key in-progress old-state new-state]
                                           (shutdown)))
    (shutdown)))

Improve logging on the graceful shutdown hook.


(defproject buddy/buddy-core "0.9.0"
  :description "Cryptographic Api for Clojure."
  :url "https://github.com/funcool/buddy-core"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
                 [commons-codec/commons-codec "1.10"]
                 [org.bouncycastle/bcprov-jdk15on "1.54"]
                 [org.bouncycastle/bcpkix-jdk15on "1.54"]]
  :source-paths ["src"]
  :test-paths ["test"]
  :jar-exclusions [#"\.cljx|\.swp|\.swo|user.clj"]
  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"])

(defproject buddy/buddy-core "0.9.0"
  :description "Cryptographic Api for Clojure."
  :url "https://github.com/funcool/buddy-core"
  :license {:name "Apache 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
                 [commons-codec/commons-codec "1.10"]
                 [org.bouncycastle/bcprov-jdk15on "1.54"]
                 [org.bouncycastle/bcpkix-jdk15on "1.54"]]
  :source-paths ["src"]
  :test-paths ["test"]
  :jar-exclusions [#"\.cljx|\.swp|\.swo|user.clj"]
  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"])

Set clojure 1.8 as default clj version.

Set clojure 1.8 as default clj version.


;; Copyright © 2015, JUXT LTD.

(defproject aero "0.1.4"
  :description "Light and fluffy configuration"
  :url "http://github.com/juxt/aero"
  :license {:name "The MIT License"
            :url "http://opensource.org/licenses/MIT"}
  :dependencies [[prismatic/schema "1.0.3"]]

  :profiles {:dev {:dependencies [[org.clojure/clojure "1.7.0"]]}})

;; Copyright © 2015, JUXT LTD.

(defproject aero "0.1.5"
  :description "Light and fluffy configuration"
  :url "http://github.com/juxt/aero"
  :license {:name "The MIT License"
            :url "http://opensource.org/licenses/MIT"}
  :dependencies [[prismatic/schema "1.0.3"]]

  :profiles {:dev {:dependencies [[org.clojure/clojure "1.7.0"]]}})

Update version number for release

Update version number for release


(defproject spiral "0.1.1-SNAPSHOT"
  :description "core.async based http server library"
  :url "http://github.com/dgrnbrg/spiral"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :jvm-opts ^:replace ["-Xmx4g" "-server"]
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.logging "0.2.6"]
                 [org.clojure/data.priority-map "0.0.5"]
                 [ring "1.2.2"]
                 [org.clojure/core.async "0.1.303.0-886421-alpha"]]
  :profiles {:dev {:dependencies [[ring/ring-jetty-adapter "1.3.1"]
                                  [hiccup "1.0.5"]
                                  [compojure "1.1.7"]
                                  [clj-time "0.4.4"]
                                  [http-kit "2.1.19"]
                                  [org.immutant/web "2.0.0"]]}})

(defproject spiral "0.1.1-SNAPSHOT"
  :description "core.async based http server library"
  :url "http://github.com/dgrnbrg/spiral"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :jvm-opts ^:replace ["-Xmx4g" "-server"]
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.logging "0.2.6"]
                 [org.clojure/data.priority-map "0.0.5"]
                 [ring "1.2.2"]
                 [org.clojure/core.async "0.1.303.0-886421-alpha"]]
  :profiles {:dev {:dependencies [[ring/ring-jetty-adapter "1.3.1"]
                                  [hiccup "1.0.5"]
                                  [compojure "1.1.7"]
                                  [clj-time "0.4.4"]
                                  [http-kit "2.1.19"]
                                  [org.immutant/web "2.0.0"]]
                   :deploy-repositories  [["releases" :clojars]]}})

Add clojars as default push target

Add clojars as default push target


(ns fivethreeonern.sqlite
  (:require [mount.core :refer-macros [defstate]]))

(def node-module (js/require "react-native-sqlite-storage"))

(defstate sqlite
  :start (.openDatabase node-module #js {:name "531.db" :location "default"} #(js/console.log "sql ok") #(js/console.log "sql error")))

(defn- execute-sql [tx [query & other-queries] final-cb on-error]
  (.executeSql tx query #js []
               (fn [tx results]
                 (if (empty? other-queries)
                   (let [results (-> results .-rows .raw (js->clj :keywordize-keys true))]
                     (final-cb results))
                   (execute-sql tx other-queries final-cb on-error)))
               on-error))

(defn transaction
  ([query-strings final-cb]
   (transaction query-strings final-cb (fn [_])))
  ([query-strings final-cb on-error]
   (.transaction @sqlite
                 (fn [tx]
                   (execute-sql tx query-strings final-cb on-error)))))

(defn query
  ([query-str cb]
   (query query-str cb (fn [_])))
  ([query-str cb on-error]
   (transaction [query-str] cb on-error)))

(defn log-query [query-str]
  (query query-str (fn [result]
                     (js/console.log "Query:" query-str)
                     (js/console.log "Result:" (clj->js result)))))

Add log-query function for repl sql queries


(ns swartz.models.core
  (:require [environ.core :refer [env]]
            [clojure.string :as str]))

(def db {:connection-uri (str/replace (env :database-url)
                                      #":postgres:"
                                      ":postgresql:")
         :classname "org.postgresql.Driver"})

(ns swartz.models.core
  (:require [environ.core :refer [env]]))

(def db {:connection-uri (env :database-url)})

Undo the last couple of useless tweaks

Undo the last couple of useless tweaks


(ns etl
  (:require [clojure.string :as str]))

(defn- pairs [pair]
  (let [[value key] pair]
    (map (fn [k] {(str/lower-case k) value}) key)))

(defn transform [words]
  (into {} (flatten (map pairs words))))

(ns etl
  (:require [clojure.string :as str]))

(defn- pairs [[value key]]
    (map (fn [k] {(str/lower-case k) value}) key))

(defn transform [words]
  (into {} (flatten (map pairs words))))

Use deconstruction in parameters and save the let.


(ns foreclojure.ring
  (:use [compojure.core :only [GET]]
        [ring.util.response :only [response]])
  (:require [clojure.java.io :as io]
            [clojure.string :as s])
  (:import (java.net URL)))

;; copied from compojure.route, modified to use File instead of Stream
(defn resources
  "A route for serving resources on the classpath. Accepts the following
  keys:
    :root - the root prefix to get the resources from. Defaults to 'public'."
  [path & [options]]
  (-> (GET path {{resource-path :*} :route-params}
        (let [root (:root options "public")]
          (when-let [res (io/resource (str root "/" resource-path))]
            (response (io/as-file res)))))))

(defn wrap-url-as-file [handler]
  (fn [request]
    (when-let [{body :body :as resp} (handler request)]
      (if (and (instance? URL body)
               (= "file" (.getProtocol ^URL body)))
        (update-in resp [:body] io/as-file)
        resp))))

(defn wrap-strip-trailing-slash [handler]
  (fn [request]
    (handler (update-in request [:uri] s/replace #"(?<=.)/$" ""))))

(ns foreclojure.ring
  (:use [compojure.core :only [GET]]
        [ring.util.response :only [response]])
  (:require [clojure.java.io :as io]
            [clojure.string :as s])
  (:import (java.net URL)))

;; copied from compojure.route, modified to use File instead of Stream
(defn resources
  "A route for serving resources on the classpath. Accepts the following
  keys:
    :root - the root prefix to get the resources from. Defaults to 'public'."
  [path & [options]]
  (GET path {{resource-path :*} :route-params}
    (let [root (:root options "public")]
      (when-let [res (io/resource (str root "/" resource-path))]
        (response (io/as-file res))))))

(defn wrap-url-as-file [handler]
  (fn [request]
    (when-let [{body :body :as resp} (handler request)]
      (if (and (instance? URL body)
               (= "file" (.getProtocol ^URL body)))
        (update-in resp [:body] io/as-file)
        resp))))

(defn wrap-strip-trailing-slash [handler]
  (fn [request]
    (handler (update-in request [:uri] s/replace #"(?<=.)/$" ""))))

Drop a vestigial (->) form, which had only one arg


(ns leiningen.ring.server-headless
  (:use leiningen.ring.server))

(defn server-headless
  "Start a Ring server without opening a browser."
  ([project]
     (server-task project {:headless? true}))
  ([project port]
     (server-task project {:port (Integer. port), :headless? true})))

(ns leiningen.ring.server-headless
  (:use leiningen.ring.server))

(defn server-headless
  "Start a Ring server without opening a browser."
  ([project]
     (server-task project {:open-browser? false}))
  ([project port]
     (server-task project {:port (Integer. port), :open-browser? false})))

Change to use new open-browser? key from ring-server library


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

(ns user
  (:require [clojure.tools.namespace.repl :as repl]
            [clojure.walk :refer [macroexpand-all]]
            [clojure.pprint :refer [pprint]]
            [clojure.test :as test]))

(defn- run-test
  ([] (run-test #"^suricatta\..*test.*"))
  ([o]
   (repl/refresh)
   (cond
     (instance? java.util.regex.Pattern o)
     (test/run-all-tests o)

     (symbol? o)
     (if-let [sns (namespace o)]
       (do (require (symbol sns))
           (test/test-vars [(resolve o)]))
       (test/test-ns o)))))

(defn -main
  [& args]
  (let [{:keys [fail]} (run-test)]
    (if (pos? fail)
      (System/exit fail)
      (System/exit 0))))

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

(ns user
  (:require [clojure.tools.namespace.repl :as repl]
            [clojure.walk :refer [macroexpand-all]]
            [clojure.pprint :refer [pprint]]
            [clojure.test :as test]))

(defn- run-test
  ([] (run-test #"^suricatta\..*test.*"))
  ([o]
   (repl/refresh)
   (cond
     (instance? java.util.regex.Pattern o)
     (test/run-all-tests o)

     (symbol? o)
     (if-let [sns (namespace o)]
       (do (require (symbol sns))
           (test/test-vars [(resolve o)]))
       (test/test-ns o)))))

(defn -main
  [& args]
  (require 'suricatta.core-test)
  (require 'suricatta.extend-test)
  (require 'suricatta.dsl-test)
  (let [{:keys [fail]} (run-test)]
    (if (pos? fail)
      (System/exit fail)
      (System/exit 0))))

Add missing require's on tests main function.


(ns com.wsscode.pathom.connect.run-graph-readers-test
  (:require [clojure.test :refer :all]
            [com.wsscode.pathom.connect :as pc]
            [com.wsscode.pathom.sugar :as ps]
            [com.wsscode.pathom.core :as p]))

(defn run-parser [{::keys [resolvers query]}]
  (let [parser (ps/connect-serial-parser
                 {::ps/connect-reader pc/reader3}
                 resolvers)]
    (parser {} query)))

(deftest test-runner3
  (testing "simple resolver"
    (is (= (run-parser
             {::resolvers [(pc/resolver 'a
                             {::pc/output [:a]}
                             (fn [_ _] {:a 42}))]
              ::query     [:a]})
           {:a 42}))

    (is (= (run-parser
             {::resolvers [(pc/resolver 'a
                             {::pc/output [:a :b]}
                             (fn [_ _] {:a 42 :b "foo"}))]
              ::query     [:a :b]})
           {:a 42
            :b "foo"})))

  (testing "missed output"
    (is (= (run-parser
             {::resolvers [(pc/resolver 'a
                             {::pc/output [:a]}
                             (fn [_ _] {}))]
              ::query     [:a]})
           {:a ::p/not-found}))))

(ns com.wsscode.pathom.connect.run-graph-readers-test
  (:require [clojure.test :refer :all]
            [com.wsscode.pathom.connect :as pc]
            [com.wsscode.pathom.sugar :as ps]
            [com.wsscode.pathom.core :as p]))

(defn run-parser [{::keys [resolvers query]}]
  (let [parser (ps/connect-serial-parser
                 {::ps/connect-reader pc/reader3}
                 resolvers)]
    (parser {} query)))

(deftest test-runner3
  (testing "single attribute"
    (is (= (run-parser
             {::resolvers [(pc/constantly-resolver :a 42)]
              ::query     [:a]})
           {:a 42}))

    (testing "missed output"
      (is (= (run-parser
               {::resolvers [(pc/resolver 'a
                               {::pc/output [:a]}
                               (fn [_ _] {}))]
                ::query     [:a]})
             {:a ::p/not-found})))

    (testing "resolver error"
      (is (= (run-parser
               {::resolvers [(pc/resolver 'a
                               {::pc/output [:a]}
                               (fn [_ _] (throw (ex-info "Error" {:error "detail"}))))]
                ::query     [:a]})
             {:a                              :com.wsscode.pathom.core/reader-error
              :com.wsscode.pathom.core/errors {[:a] "class clojure.lang.ExceptionInfo: Error - {:error \"detail\"}"}}))))

  (testing "multiple attributes"
    (is (= (run-parser
             {::resolvers [(pc/resolver 'a
                             {::pc/output [:a :b]}
                             (fn [_ _] {:a 42 :b "foo"}))]
              ::query     [:a :b]})
           {:a 42
            :b "foo"}))))

Add tests for missing output and resolver error


(ns audio-utils.web-audio)

(defn audio-context []
  (let [constructor (or js/window.AudioContext
                        js/window.webkitAudioContext)]
    (constructor.)))

(defn create-buffer
  [ctx n-channels size sample-rate]
  (.createBuffer ctx n-channels size sample-rate))

(defn create-buffer-source
  ([ctx]
   (.createBufferSource ctx))
  ([ctx n-channels sample-rate data]
   (let [buf (create-buffer ctx n-channels
                            (count (cond-> data
                                     (> n-channels 1)
                                     first))
                            sample-rate)
         src (create-buffer-source ctx)]
     (doseq [channel (range 0 n-channels)
             :let [channel-data (.getChannelData buf channel)
                   input-data   (cond-> data
                                  (> n-channels 1)
                                  (get channel))]]
       (doseq [[i x] (map-indexed vector input-data)]
         (aset channel-data i x)))
     (set! (.-buffer src) buf)
     src)))

(ns audio-utils.web-audio)

(defn audio-context []
  (let [constructor (or js/window.AudioContext
                        js/window.webkitAudioContext)]
    (constructor.)))

(defn create-buffer
  ([ctx n-channels size sample-rate]
   (.createBuffer ctx n-channels size sample-rate)))

(defn create-buffer-from-data
  [ctx n-channels sample-rate data]
  (let [buf (create-buffer ctx n-channels
                           (count (cond-> data
                                    (> n-channels 1)
                                    first))
                           sample-rate)]
    (doseq [channel (range 0 n-channels)
            :let [channel-data (.getChannelData buf channel)
                  input-data   (cond-> data
                                 (> n-channels 1)
                                 (get channel))]]
      (doseq [[i x] (map-indexed vector input-data)]
        (aset channel-data i x)))
    buf))

(defn create-buffer-source
  ([ctx]
   (.createBufferSource ctx))
  ([ctx n-channels sample-rate data]
   (doto (create-buffer-source ctx)
     (aset "buffer"
           (create-buffer-from-data ctx n-channels
                                    sample-rate data)))))

Add function to create an AudioBuffer from CLJS data