Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add a packages set parameter to the task | (ns radicalzephyr.boot-junit
{:boot/export-tasks true}
(:require '[[boot.core :as core]])
(:import org.junit.runner.JUnitCore))
(deftask junit
"Run the jUnit test runner."
[]
(with-pre-wrap fileset
(let [result (JUnitCore/runClasses
(into-array [#_ (magic goes here to find all test classes)]))]
(when (> (.getFailureCount result) 0)
(throw (ex-info "There were some test failures." {:result result}))))
fileset))
| (ns radicalzephyr.boot-junit
{:boot/export-tasks true}
(:require '[[boot.core :as core]])
(:import org.junit.runner.JUnitCore))
(deftask junit
"Run the jUnit test runner."
[p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
(with-pre-wrap fileset
(let [result (JUnitCore/runClasses
(into-array [#_ (magic goes here to find all test classes)]))]
(when (> (.getFailureCount result) 0)
(throw (ex-info "There were some test failures." {:result result}))))
fileset))
|
Remove test scoping on dependencies | (set-env!
:source-paths #{"src"}
:resource-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.6.0" :scope "provided"]
[boot/core "2.1.0" :scope "provided"]
[junit "4.12" :scope "test"]
[org.reflections/reflections "0.9.10" :scope "test"]
[org.glassfish/javax.servlet "3.0" :scope "test"]
[radicalzephyr/clansi "1.2.0" :scope "test"]])
(require '[radicalzephyr.boot-junit :refer [junit]])
(def +version+ "0.1.0")
(task-options!
pom {:project 'radicalzephyr/boot-junit
:version +version+
:description "Run some jUnit tests in boot!"
:url "https://github.com/radicalzephyr/boot-junit"
:scm {:url "https://github.com/radicalzephyr/boot-junit"}
:license {"Eclipse Public License"
"http://www.eclipse.org/legal/epl-v10.html"}}
junit {:packages '#{radicalzephyr.boot_junit.test}})
| (set-env!
:source-paths #{"src"}
:resource-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.6.0" :scope "provided"]
[boot/core "2.1.0" :scope "provided"]
[junit "4.12" ]
[org.reflections/reflections "0.9.10"]
[org.glassfish/javax.servlet "3.0" ]
[radicalzephyr/clansi "1.2.0" ]])
(require '[radicalzephyr.boot-junit :refer [junit]])
(def +version+ "0.1.0")
(task-options!
pom {:project 'radicalzephyr/boot-junit
:version +version+
:description "Run some jUnit tests in boot!"
:url "https://github.com/radicalzephyr/boot-junit"
:scm {:url "https://github.com/radicalzephyr/boot-junit"}
:license {"Eclipse Public License"
"http://www.eclipse.org/legal/epl-v10.html"}}
junit {:packages '#{radicalzephyr.boot_junit.test}})
|
Add another implementation to Exercise 3.50 | (ns sicp.chapter3.5-1)
;;;; 3.5 Streams
;;; 3.5.1 Streams Are Delayed Lists
;; Exercise 3.50
(defn stream-map [proc & argstreams]
(lazy-seq
(if (empty? (first argstreams))
nil
(cons
(apply proc (map first argstreams))
(apply stream-map
(cons proc (map rest argstreams)))))))
;; Exercise 3.51
(defn show [x]
(println x)
x)
(def x (map show (range 0 (inc 10))))
#_(nth x 5)
#_(nth x 7)
;; Exercise 3.52
(defn display-stream [s]
(run! println s))
(def sum (atom 0))
#_@sum
(defn accum [x]
(swap! sum + x))
#_@sum
(def seq' (map accum (range 1 (inc 20))))
#_@sum
(def y (filter even? seq'))
#_@sum
(def z (filter #(zero? (rem % 5)) seq'))
#_@sum
#_(nth y 7)
#_@sum
#_(display-stream z)
#_@sum
| (ns sicp.chapter3.5-1)
;;;; 3.5 Streams
;;; 3.5.1 Streams Are Delayed Lists
;; Exercise 3.50
(defn stream-map [proc & argstreams]
(lazy-seq
(if (empty? (first argstreams))
nil
(cons
(apply proc (map first argstreams))
(apply stream-map
(cons proc (map rest argstreams)))))))
(defn stream-map' [proc & argstreams]
(lazy-seq
(when (seq (first argstreams))
(cons (apply proc (map first argstreams))
(apply stream-map' proc (map rest argstreams))))))
;; Exercise 3.51
(defn show [x]
(println x)
x)
(def x (map show (range 0 (inc 10))))
#_(nth x 5)
#_(nth x 7)
;; Exercise 3.52
(defn display-stream [s]
(run! println s))
(def sum (atom 0))
#_@sum
(defn accum [x]
(swap! sum + x))
#_@sum
(def seq' (map accum (range 1 (inc 20))))
#_@sum
(def y (filter even? seq'))
#_@sum
(def z (filter #(zero? (rem % 5)) seq'))
#_@sum
#_(nth y 7)
#_@sum
#_(display-stream z)
#_@sum
|
Use getFullPathIndex to list wejars assets | (ns less4clj.webjars
(:import [java.io File]
[org.webjars WebJarAssetLocator]))
(def ^:private webjars-pattern
#"META-INF/resources/webjars/([^/]+)/([^/]+)/(.*)")
(defn- asset-path [resource]
(let [[_ name version path] (re-matches webjars-pattern resource)]
(str name File/separator path)))
(defn asset-map
"Create map of asset path to classpath resource url. Asset path is
the resource url without webjars part."
[]
(->> (.listAssets (WebJarAssetLocator.) "")
(map (juxt asset-path identity))
(into {})))
(comment
(time (asset-map)))
| (ns less4clj.webjars
(:import [java.io File]
[org.webjars WebJarAssetLocator]))
(def ^:private webjars-pattern
#"META-INF/resources/webjars/([^/]+)/([^/]+)/(.*)")
(defn- asset-path [resource]
(let [[_ name version path] (re-matches webjars-pattern resource)]
(str name File/separator path)))
(defn asset-map
"Create map of asset path to classpath resource url. Asset path is
the resource url without webjars part."
[]
(->> (vals (.getFullPathIndex (WebJarAssetLocator.)))
(map (juxt asset-path identity))
(into {})))
(comment
(time (asset-map)))
|
Read writer type from arguments | (ns whitman.core
(:require [whitman.config :as config]
[whitman.crawler :as crawler]
[whitman.db :as db]
[whitman.writer :as writer])
(:gen-class))
(defn exit [code msg]
(binding [*out* *err*]
(do (println msg)
(System/exit code))))
(defn do-crawl [cfg writer]
(let [users (crawler/records cfg)
docs (map #(crawler/sample-docs cfg %) users)]
(doseq [d docs] (writer/write writer cfg (:query d) (:insert d)))))
(defn -main [& args]
(if (< (count args) 1)
(exit 1 "No configuration file specified")
(do-crawl (config/read-config (last args)) :db)))
| (ns whitman.core
(:require [whitman.config :as config]
[whitman.crawler :as crawler]
[whitman.db :as db]
[whitman.writer :as writer])
(:gen-class))
(defn exit [code msg]
(binding [*out* *err*]
(do (println msg)
(System/exit code))))
(defn do-crawl [cfg writer]
(let [users (crawler/records cfg)
docs (map #(crawler/sample-docs cfg %) users)]
(doseq [d docs] (writer/write writer cfg (:query d) (:insert d)))))
(defn writer [args]
:db)
(defn -main [& args]
(if (< (count args) 1)
(exit 1 "No configuration file specified")
(do-crawl (config/read-config (last args)) (writer args))))
|
Add buddy-sign and buddy-hashers dependencies. | (defproject uxbox-backend "0.1.0-SNAPSHOT"
:description "UXBox backend + api"
:url "http://uxbox.github.io"
:license {:name "" :url ""}
:source-paths ["src"]
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.slf4j/slf4j-simple "1.7.16"]
[bouncer "1.0.0"]
[mount "0.1.9"]
[environ "1.0.2"]
[com.github.spullara.mustache.java/compiler "0.9.1"]
[niwinz/migrante "0.1.0-SNAPSHOT"]
[funcool/suricatta "0.8.1"]
[funcool/promesa "0.8.1"]
[hikari-cp "1.5.0"]
[funcool/catacumba "0.11.2-SNAPSHOT"]]
:main ^:skip-aot uxbox.main
:plugins [[lein-ancient "0.6.7"]])
| (defproject uxbox-backend "0.1.0-SNAPSHOT"
:description "UXBox backend."
:url "http://uxbox.github.io"
:license {:name "" :url ""}
:source-paths ["src"]
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.slf4j/slf4j-simple "1.7.16"]
[bouncer "1.0.0"]
[mount "0.1.9"]
[environ "1.0.2"]
[buddy/buddy-sign "0.9.0"]
[buddy/buddy-hashers "0.11.0"]
[com.github.spullara.mustache.java/compiler "0.9.1"]
[niwinz/migrante "0.1.0-SNAPSHOT"]
[funcool/suricatta "0.8.1"]
[funcool/promesa "0.8.1"]
[hikari-cp "1.5.0"]
[funcool/catacumba "0.11.2-SNAPSHOT"]]
:main ^:skip-aot uxbox.main
:plugins [[lein-ancient "0.6.7"]])
|
Remove duplication of listing files | (ns silly-image-store.store
(:require [clojure.java.io :as io]))
(def exists? #(and % (.exists %)))
(def file? #(.isFile %))
(def filename #(.getName %))
(defn load-image [& paths]
(let [file (apply io/file paths)]
(if (exists? file) file)))
(defn list-images [& paths]
(let [image-directory (apply load-image paths)]
(if (exists? image-directory)
(->> image-directory
.listFiles
(filter file?)
(map filename)))))
(defn list-image-dirs [& paths]
(let [image-directory (apply load-image paths)]
(if (exists? image-directory)
(->> image-directory
.listFiles
(filter (complement file?))
(map filename)))))
(defn random-image [basedir]
(let [random-image-name (rand-nth (list-images basedir))]
(load-image basedir random-image-name)))
| (ns silly-image-store.store
(:require [clojure.java.io :as io]))
(def exists? #(and % (.exists %)))
(def file? #(.isFile %))
(def filename #(.getName %))
(defn load-image [& paths]
(let [file (apply io/file paths)]
(if (exists? file) file)))
(defn- filtered-file-names [filter-fn paths]
(let [image-directory (apply load-image paths)]
(if (exists? image-directory)
(->> image-directory
.listFiles
(filter filter-fn)
(map filename)))))
(defn list-images [& paths]
(filtered-file-names file? paths))
(defn list-image-dirs [& paths]
(filtered-file-names (complement file?) paths))
(defn random-image [basedir]
(let [random-image-name (rand-nth (list-images basedir))]
(load-image basedir random-image-name)))
|
Make default port work in quotes app | (ns quotes.routes
(:gen-class)
(:use [quotes.api :only [api-routes]])
(:require [compojure.core :refer :all]
[compojure.route :as route]
[common-utils.core :as utils]
[common-utils.middleware :refer [correlation-id-middleware]]
[clojure.tools.logging :as log]
[ring.adapter.jetty :as jetty]))
(defroutes app-routes
(context "/api" []
(api-routes)))
(def app
(-> app-routes
correlation-id-middleware))
(defn -main []
(let [port (Integer/parseInt (utils/config "APP_PORT" 8080))]
(log/info "Running quotes on port" port)
(future (jetty/run-jetty (var app) {:host "0.0.0.0"
:port port}))))
| (ns quotes.routes
(:gen-class)
(:use [quotes.api :only [api-routes]])
(:require [compojure.core :refer :all]
[compojure.route :as route]
[common-utils.core :as utils]
[common-utils.middleware :refer [correlation-id-middleware]]
[clojure.tools.logging :as log]
[ring.adapter.jetty :as jetty]))
(defroutes app-routes
(context "/api" []
(api-routes)))
(def app
(-> app-routes
correlation-id-middleware))
(defn -main []
(let [port (Integer/parseInt (utils/config "APP_PORT" "8080"))]
(log/info "Running quotes on port" port)
(future (jetty/run-jetty (var app) {:host "0.0.0.0"
:port port}))))
|
Make test names match assertions | (ns rna-transcription.test (:require [clojure.test :refer :all]))
(load-file "rna_transcription.clj")
(deftest transcribes-guanine-to-cytosine
(is (= "G" (rna-transcription/to-rna "C"))))
(deftest transcribes-cytosine-to-guanine
(is (= "C" (rna-transcription/to-rna "G"))))
(deftest transcribes-uracil-to-adenine
(is (= "U" (rna-transcription/to-rna "A"))))
(deftest it-transcribes-thymine-to-uracil
(is (= "A" (rna-transcription/to-rna "T"))))
(deftest it-transcribes-all-nucleotides
(is (= "UGCACCAGAAUU" (rna-transcription/to-rna "ACGTGGTCTTAA"))))
(deftest it-validates-dna-strands
(is (thrown? AssertionError (rna-transcription/to-rna "XCGFGGTDTTAA"))))
(run-tests)
| (ns rna-transcription.test (:require [clojure.test :refer :all]))
(load-file "rna_transcription.clj")
(deftest transcribes-cytosine-to-guanine
(is (= "G" (rna-transcription/to-rna "C"))))
(deftest transcribes-guanine-to-cytosine
(is (= "C" (rna-transcription/to-rna "G"))))
(deftest transcribes-adenine-to-uracil
(is (= "U" (rna-transcription/to-rna "A"))))
(deftest it-transcribes-thymine-to-adenine
(is (= "A" (rna-transcription/to-rna "T"))))
(deftest it-transcribes-all-nucleotides
(is (= "UGCACCAGAAUU" (rna-transcription/to-rna "ACGTGGTCTTAA"))))
(deftest it-validates-dna-strands
(is (thrown? AssertionError (rna-transcription/to-rna "XCGFGGTDTTAA"))))
(run-tests)
|
Fix these tests to actually test | (ns clojars.test.unit.middleware
(:require [clojars.middleware :as middleware]
[clojure.test :refer :all]))
(def trailing-slash (middleware/wrap-ignore-trailing-slash (fn [x] (get x :uri))))
(deftest trailing-slash-doesnt-modify-root
(is (= "/" (trailing-slash {:uri "/"}))))
(deftest trailing-slash-doesnt-modify-sub-routes
(is (= "/artifact/project") (trailing-slash {:uri "/artifact/project"})))
(deftest trailing-slash-removes-trailing-slash
(is (= "/artifact/project") (trailing-slash {:uri "/artifact/project/"})))
(deftest trailing-slash-doesnt-remove-redundant-trailing-slash
(is (= "/artifact/project/") (trailing-slash {:uri "/artifact/project//"})))
| (ns clojars.test.unit.middleware
(:require [clojars.middleware :as middleware]
[clojure.test :refer :all]))
(def trailing-slash (middleware/wrap-ignore-trailing-slash (fn [x] (get x :uri))))
(deftest trailing-slash-doesnt-modify-root
(is (= "/" (trailing-slash {:uri "/"}))))
(deftest trailing-slash-doesnt-modify-sub-routes
(is (= "/artifact/project" (trailing-slash {:uri "/artifact/project"}))))
(deftest trailing-slash-removes-trailing-slash
(is (= "/artifact/project" (trailing-slash {:uri "/artifact/project/"}))))
(deftest trailing-slash-doesnt-remove-redundant-trailing-slash
(is (= "/artifact/project/" (trailing-slash {:uri "/artifact/project//"}))))
|
Improve render function for builtin icons. | (ns uxbox.shapes
(:require [sablono.core :refer-macros [html]]))
(defmulti render
(fn [shape & params]
(:type shape)))
(defmethod render :builtin/icon
[shape & [{:keys [width height] :or {width "500" height "500"}}]]
(let [content (:svg shape)]
(html
[:svg {:width width :height height} content])))
| (ns uxbox.shapes
(:require [sablono.core :refer-macros [html]]))
(defmulti render
(fn [shape & params]
(:type shape)))
(defmethod render :builtin/icon
[{:keys [data width height view-box]} & [attrs]]
(let [attrs (merge
(when width {:width width})
(when height {:height height})
(when view-box {:viewBox (apply str (interpose " " view-box))})
attrs)]
(html
[:svg attrs data])))
|
Update dependency lein-cljfmt:lein-cljfmt to v0.7.0 | (defproject strava-activity-graphs "0.1.0-SNAPSHOT"
:description "Generate statistical charts for Strava activities"
:url "https://github.com/nicokosi/strava-activity-graphs"
:license {:name "Creative Commons Attribution 4.0"
:url "https://creativecommons.org/licenses/by/4.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[incanter/incanter-core "1.9.3"]
[incanter/incanter-charts "1.9.3"]
[incanter/incanter-io "1.9.3"]
[org.clojure/data.json "1.0.0"]
[clj-http "3.10.2"]
[slingshot "0.12.2"]]
:plugins [[lein-cljfmt "0.6.8"]]
:main ^:skip-aot strava-activity-graphs.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
| (defproject strava-activity-graphs "0.1.0-SNAPSHOT"
:description "Generate statistical charts for Strava activities"
:url "https://github.com/nicokosi/strava-activity-graphs"
:license {:name "Creative Commons Attribution 4.0"
:url "https://creativecommons.org/licenses/by/4.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[incanter/incanter-core "1.9.3"]
[incanter/incanter-charts "1.9.3"]
[incanter/incanter-io "1.9.3"]
[org.clojure/data.json "1.0.0"]
[clj-http "3.10.2"]
[slingshot "0.12.2"]]
:plugins [[lein-cljfmt "0.7.0"]]
:main ^:skip-aot strava-activity-graphs.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
|
Remove border on selected tab | (ns faceboard.css.tabs
(:use [faceboard.lib.constants])
(:require [faceboard.lib.helpers :refer [>> mv px]]
[garden.color :as color]))
(def styles
[(>> tab-area
(>> [> *]
[:display :inline-block])
(>> tab
[:padding (px 0 4)
:font-weight :bold
:margin (px 2)
:margin-left (px 8)
:margin-bottom (px 0)
:min-width (px 60)
:cursor :pointer
:position :relative
:border-top-right-radius (px 2)
:border-top-left-radius (px 2)
:top (px 1)
:text-align :center
:background (color/darken signature-color 10)
:color "#fff"]
(>> &.selected
[:color "#000"
:background selected-tab-color
:border-bottom (str "1px solid " selected-tab-color)])))
(>> tab-contents
[:position :relative
:z-index 0
:height "100%"]
(>> tab-view
[:height "100%"]
(>> [> *]
[:height "100%"])
(>> &.dual-mode
(>> [> *]
[:width "50%"
:display :inline-block])
(>> left-side
[:float :left])
(>> right-side
[:float :right]))))]) | (ns faceboard.css.tabs
(:use [faceboard.lib.constants])
(:require [faceboard.lib.helpers :refer [>> mv px]]
[garden.color :as color]))
(def styles
[(>> tab-area
(>> [> *]
[:display :inline-block])
(>> tab
[:padding (px 0 4)
:font-weight :bold
:margin (px 2)
:margin-left (px 8)
:margin-bottom (px 0)
:min-width (px 60)
:cursor :pointer
:position :relative
:border-top-right-radius (px 2)
:border-top-left-radius (px 2)
:top (px 1)
:text-align :center
:background (color/darken signature-color 10)
:color "#fff"]
(>> &.selected
[:color "#000"
:background selected-tab-color])))
(>> tab-contents
[:position :relative
:z-index 0
:height "100%"]
(>> tab-view
[:height "100%"]
(>> [> *]
[:height "100%"])
(>> &.dual-mode
(>> [> *]
[:width "50%"
:display :inline-block])
(>> left-side
[:float :left])
(>> right-side
[:float :right]))))]) |
Set up a chord loop. | (ns overtunes.songs.at-all
(:use
[overtone.live :exclude [scale octave sharp flat sixth unison play]]
[overtone.inst.sampled-piano :only [sampled-piano]]))
(def scale 66)
(defn ground [note] (+ scale note))
(def note# (comp sampled-piano ground))
(defn chord# [chord] (doseq [note (vals chord)] (note# note)))
(def ionian {:i 0, :ii 2, :iii 4, :iv 5, :v 7, :vi 9, :vii 11, :viii 12})
(def i (select-keys ionian [:i :iii :v]))
(def ii (select-keys ionian [:ii :iv :vi]))
(chord# ii)
| (ns overtunes.songs.at-all
(:use
[overtone.live :only [at now]]
[overtone.inst.sampled-piano :only [sampled-piano]]))
(defn bpm [beats-per-minute]
(let [start (now)
ms-per-minute (* 60 1000)
ms-per-beat (/ ms-per-minute beats-per-minute)]
#(+ start (* ms-per-beat %))))
(defn from [timing offset] #(timing (+ offset %)))
(def scale 56)
(defn ground [note] (+ scale note))
(def note# (comp sampled-piano ground))
(defn chord# [chord] (doseq [note (vals chord)] (note# note)))
(def ionian {:i 0, :ii 2, :iii 4, :iv 5, :v 7, :vi 9, :vii 11, :viii 12})
(def I (select-keys ionian [:i :iii :v]))
(def II (select-keys ionian [:ii :iv :vi]))
(def V (select-keys ionian [:v :vii :ii]))
(def progression [I {} II {} II V I V])
(defn rythm-n-bass# [timing chords]
(do
(at (timing 0) (chord# (first chords)))
(rythm-n-bass# (from timing 4) (rest chords))))
; (rythm-n-bass# (bpm 130) (cycle progression))
|
Fix modules config in travis profile | (defproject com.palletops/hyde-pallet "0.1.0-SNAPSHOT"
:description "Parent for hyde-pallet"
:url "https://github.com/paleltops/hyde-pallet"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[com.palletops/hyde-pallet "0.1.0-SNAPSHOT"]]
:plugins [[lein-modules "0.3.1"]]
:aliases {"install" ["modules" "install"]
"deploy" ["modules" "deploy"]
"clean" ["modules" "clean"]}
:profiles {:travis {:module {:subprocess "lein2"}}})
| (defproject com.palletops/hyde-pallet "0.1.0-SNAPSHOT"
:description "Parent for hyde-pallet"
:url "https://github.com/paleltops/hyde-pallet"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[com.palletops/hyde-pallet "0.1.0-SNAPSHOT"]]
:plugins [[lein-modules "0.3.1"]]
:aliases {"install" ["modules" "install"]
"deploy" ["modules" "deploy"]
"clean" ["modules" "clean"]}
:profiles {:travis {:modules {:subprocess "lein2"}}})
|
Update dependency to latest io.aviso:pretty, which includes stack frame filtering | (defproject io.aviso/twixt "0.1.13-SNAPSHOT"
:description "An extensible asset pipeline for Clojure web applications"
:url "https://github.com/AvisoNovate/twixt"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[io.aviso/pretty "0.1.10"]
[io.aviso/tracker "0.1.0"]
[ring/ring-core "1.2.2"]
[org.mozilla/rhino "1.7R4"]
[com.github.sommeri/less4j "1.5.3"]
[de.neuland-bfi/jade4j "0.4.0"]
[hiccup "1.0.4"]]
:codox {:src-dir-uri "https://github.com/AvisoNovate/twixt/blob/master/"
:src-linenum-anchor-prefix "L"
:defaults {:doc/format :markdown}}
:profiles {:dev {:dependencies [[log4j "1.2.17"]
[ring/ring-jetty-adapter "1.2.0"]]}})
| (defproject io.aviso/twixt "0.1.13-SNAPSHOT"
:description "An extensible asset pipeline for Clojure web applications"
:url "https://github.com/AvisoNovate/twixt"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[io.aviso/pretty "0.1.11"]
[io.aviso/tracker "0.1.0"]
[ring/ring-core "1.2.2"]
[org.mozilla/rhino "1.7R4"]
[com.github.sommeri/less4j "1.5.3"]
[de.neuland-bfi/jade4j "0.4.0"]
[hiccup "1.0.4"]]
:codox {:src-dir-uri "https://github.com/AvisoNovate/twixt/blob/master/"
:src-linenum-anchor-prefix "L"
:defaults {:doc/format :markdown}}
:profiles {:dev {:dependencies [[log4j "1.2.17"]
[ring/ring-jetty-adapter "1.2.0"]]}})
|
Add combinatorics and matrix libs | (defproject clojurewerkz/statistiker "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.apache.commons/commons-math3 "3.2"]
[net.mikera/core.matrix "0.20.0"]]
:source-paths ["src/clj"]
:java-source-paths ["src/java"]
:test-paths ["test/clj"])
| (defproject clojurewerkz/statistiker "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/math.combinatorics "0.0.7"]
[org.apache.commons/commons-math3 "3.2"]
[net.mikera/core.matrix "0.20.0"]
[org.jblas/jblas "1.2.3"]]
:source-paths ["src/clj"]
:java-source-paths ["src/java"]
:test-paths ["test/clj"])
|
Set clojurescript compiler version to 1.7.28. | (defproject funcool/cats "0.5.0"
:description "Category Theory abstractions for Clojure"
:url "https://github.com/funcool/cats"
:license {:name "BSD (2 Clause)"
:url "http://opensource.org/licenses/BSD-2-Clause"}
:dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
[org.clojure/clojurescript "0.0-3308" :scope "provided"]]
:deploy-repositories {"releases" :clojars
"snapshots" :clojars}
:source-paths ["src"]
:test-paths ["test"]
:jar-exclusions [#"\.swp|\.swo"]
:profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
:codeina {:sources ["src"]
:reader :clojure
:target "doc/dist/latest/api"
:src-uri "http://github.com/funcool/cats/blob/master/"
:src-uri-prefix "#L"}
:plugins [[funcool/codeina "0.2.0"]]}
:bench [:dev {:dependencies [[criterium "0.4.3"]]
:main ^:skip-aot benchmarks
:jvm-opts ^:replace []
:source-paths ["dev"]}]})
| (defproject funcool/cats "0.5.0"
:description "Category Theory abstractions for Clojure"
:url "https://github.com/funcool/cats"
:license {:name "BSD (2 Clause)"
:url "http://opensource.org/licenses/BSD-2-Clause"}
:dependencies [[org.clojure/clojure "1.7.0" :scope "provided"]
[org.clojure/clojurescript "1.7.28" :scope "provided"]]
:deploy-repositories {"releases" :clojars
"snapshots" :clojars}
:source-paths ["src"]
:test-paths ["test"]
:jar-exclusions [#"\.swp|\.swo"]
:profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
:codeina {:sources ["src"]
:reader :clojure
:target "doc/dist/latest/api"
:src-uri "http://github.com/funcool/cats/blob/master/"
:src-uri-prefix "#L"}
:plugins [[funcool/codeina "0.2.0"]]}
:bench [:dev {:dependencies [[criterium "0.4.3"]]
:main ^:skip-aot benchmarks
:jvm-opts ^:replace []
:source-paths ["dev"]}]})
|
Update difform version to remove dependency on contrib. | (defproject lein-difftest "1.3.4"
:description "Run tests, display better test results."
:dependencies [[org.clojure/clojure "1.2.1"]
[difform "1.1.1"]
[clj-stacktrace "0.2.3"]
[clansi "1.0.0"]]
:eval-in-leiningen true
:hooks [leiningen.hooks.difftest])
| (defproject lein-difftest "1.3.5"
:description "Run tests, display better test results."
:dependencies [[org.clojure/clojure "1.2.1"]
[difform "1.1.2"]
[clj-stacktrace "0.2.3"]
[clansi "1.0.0"]]
:eval-in-leiningen true
:hooks [leiningen.hooks.difftest])
|
Update dependencies to latest stable versions. | (defproject statuses "0.1.0-SNAPSHOT"
:description "Statuses app for innoQ"
:namespaces [statuses]
:dependencies [
[org.clojure/clojure "1.4.0"]
[compojure "1.1.3"]
[clj-time "0.4.4"]
[ring "1.1.6"]
[org.clojure/data.json "0.2.0"]
]
:plugins [[lein-ring "0.7.5"]]
:ring {:handler statuses.views.main/app-routes}
:main statuses.server
:profiles
{:dev {:dependencies [[ring-mock "0.1.3"]]}})
| (defproject statuses "0.1.0-SNAPSHOT"
:description "Statuses app for innoQ"
:namespaces [statuses]
:dependencies [
[org.clojure/clojure "1.6.0"]
[compojure "1.2.1"]
[clj-time "0.8.0"]
[ring "1.3.1"]
[org.clojure/data.json "0.2.5"]
]
:plugins [[lein-ring "0.8.13"]]
:ring {:handler statuses.views.main/app-routes}
:main statuses.server
:profiles
{:dev {:dependencies [[ring-mock "0.1.5"]]}})
|
Upgrade ring from 1.3.1 to 1.3.2. | (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]})
| (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.2"]
[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]})
|
Add dependencies on loom, JDBC and H2 | (def version (clojure.string/trim-newline (slurp "VERSION")))
(defproject io.framed/overseer version
:description "A Clojure framework for defining and running expressive data pipelines"
:url "https://github.com/framed-data/overseer"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:scm {:name "git"
:url "https://github.com/framed-data/overseer"}
:dependencies [[org.clojure/clojure "1.7.0"]
[circleci/clj-yaml "0.5.3"]
[org.clojure/data.fressian "0.2.0"]
[clj-json "0.5.3"]
[org.clojure/tools.cli "0.3.1"]
[com.taoensso/timbre "4.0.2"]
[com.datomic/datomic-free "0.9.5130" :exclusions [joda-time]]
[clj-http "1.1.2"]
[raven-clj "1.1.0"]
[io.framed/std "0.1.2"]]
:aot [overseer.runner]
:plugins [[codox "0.8.13"]]
:codox {:output-dir "doc/api"})
| (def version (clojure.string/trim-newline (slurp "VERSION")))
(defproject io.framed/overseer version
:description "A Clojure framework for defining and running expressive data pipelines"
:url "https://github.com/framed-data/overseer"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:scm {:name "git"
:url "https://github.com/framed-data/overseer"}
:dependencies [[org.clojure/clojure "1.7.0"]
[circleci/clj-yaml "0.5.3"]
[org.clojure/data.fressian "0.2.0"]
[clj-json "0.5.3"]
[org.clojure/tools.cli "0.3.1"]
[com.taoensso/timbre "4.0.2"]
[com.datomic/datomic-free "0.9.5130" :exclusions [joda-time]]
[clj-http "1.1.2"]
[raven-clj "1.1.0"]
[io.framed/std "0.1.2"]
[aysylu/loom "1.0.0"]
[org.clojure/java.jdbc "0.7.0-alpha3"]
[com.h2database/h2 "1.4.195"]]
:aot [overseer.runner]
:plugins [[codox "0.8.13"]]
:codox {:output-dir "doc/api"})
|
Add ring/cljs etc. dependencies and configuration | (defproject comic-reader "0.1.0-SNAPSHOT"
:description "An app for reading comics/manga on or offline"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]]
:main ^:skip-aot comic-reader.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
| (defproject comic-reader "0.1.0-SNAPSHOT"
:description "An app for reading comics/manga on or offline"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/clojurescript "0.0-2371"]
[ring "1.3.1"]
[compojure "1.2.1"]
[fogus/ring-edn "0.2.0"]
[cljs-ajax "0.3.3"]]
:plugins [[lein-ring "0.8.13"]
[lein-cljsbuild "1.0.3"]]
:hooks [leiningen.cljsbuild]
:ring {:handler comic-reader.core/app}
:cljsbuild {:builds [{:source-paths ["src/cljs"]
:compiler {:output-dir "resources/public/js"
:output-to "resources/public/js/main.js"
:source-map "resources/public/js/main.js.map"
:optimizations :whitespace
:pretty-print true}}]}
:main ^:skip-aot comic-reader.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
|
Move onyx dep out of dev depedencies | (defproject org.onyxplatform/onyx-metrics "0.8.1.0-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 [[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 [^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.8.1-alpha8"]
[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.0-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-alpha6"]
[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"]]}})
|
Update Clojure dependency to alpha6 | (defproject neko "3.2.0-preview3"
:description "Neko is a toolkit designed to make Android development using Clojure easier and more fun."
:url "https://github.com/clojure-android/neko"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure-android/clojure "1.7.0-alpha4"]]
:source-paths ["src" "src/clojure"]
:java-source-paths ["src/java" "gen"]
:profiles {:default [:android-common]}
:plugins [[lein-droid "0.3.0"]]
:android {:library true
:target-version 18})
| (defproject neko "3.2.0-preview3"
:description "Neko is a toolkit designed to make Android development using Clojure easier and more fun."
:url "https://github.com/clojure-android/neko"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure-android/clojure "1.7.0-alpha6"]]
:source-paths ["src" "src/clojure"]
:java-source-paths ["src/java" "gen"]
:profiles {:default [:android-common]}
:plugins [[lein-droid "0.3.0"]]
:android {:library true
:target-version 18})
|
Advance version number to 0.1.3 | (defproject io.aviso/twixt "0.1.2"
:description "An extensible asset pipeline for Clojure web applications"
:url "https://github.com/AvisoNovate/twixt"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.logging "0.2.6"]
[ring/ring-core "1.2.0"]
[org.mozilla/rhino "1.7R4"]
[com.github.sommeri/less4j "1.1.2"]
[de.neuland/jade4j "0.3.15"]
[hiccup "1.0.4"]]
:repositories [["jade4j" "https://raw.github.com/neuland/jade4j/master/releases"]]
:repl-options {
:init-ns io.aviso.launch
:port 4001}
;; The Sublime Text nREPL plugin is out of date, so...
:repl-port 4001
:profiles {:dev {:dependencies [[log4j "1.2.17"]
[ring/ring-jetty-adapter "1.2.0"]]}})
| (defproject io.aviso/twixt "0.1.3"
:description "An extensible asset pipeline for Clojure web applications"
:url "https://github.com/AvisoNovate/twixt"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.logging "0.2.6"]
[ring/ring-core "1.2.0"]
[org.mozilla/rhino "1.7R4"]
[com.github.sommeri/less4j "1.1.2"]
[de.neuland/jade4j "0.3.15"]
[hiccup "1.0.4"]]
:repositories [["jade4j" "https://raw.github.com/neuland/jade4j/master/releases"]]
:repl-options {
:init-ns io.aviso.launch
:port 4001}
;; The Sublime Text nREPL plugin is out of date, so...
:repl-port 4001
:profiles {:dev {:dependencies [[log4j "1.2.17"]
[ring/ring-jetty-adapter "1.2.0"]]}})
|
Add overtone dependency for midi library. | (defproject clum "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:plugins [[lein-cljsbuild "1.1.5"]
[lein-auto "0.1.3"]]
:cljsbuild {:builds [{:source-paths ["src/clum/app"]
:compiler {:output-to "public/js/app.js"
:optimizations :whitespace
:pretty-print true}}]}
:auto {:default {:file-pattern #"\.(clj)$"}}
:source-paths ["src/clum/server"]
:dependencies [;; server-side
[org.clojure/clojure "1.8.0"]
[http-kit "2.2.0"]
[com.taoensso/timbre "4.8.0"]
[com.cognitect/transit-clj "0.8.297"]
[ring-transit "0.1.6"]
;; client-side
[reagent "0.6.0"]
[com.cognitect/transit-cljs "0.8.239"]])
| (defproject clum "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:plugins [[lein-cljsbuild "1.1.5"]
[lein-auto "0.1.3"]]
:cljsbuild {:builds [{:source-paths ["src/clum/app"]
:compiler {:output-to "public/js/app.js"
:optimizations :whitespace
:pretty-print true}}]}
:auto {:default {:file-pattern #"\.(clj)$"}}
:source-paths ["src/clum/server"]
:dependencies [;; server-side
[org.clojure/clojure "1.8.0"]
[http-kit "2.2.0"]
[com.taoensso/timbre "4.8.0"]
[com.cognitect/transit-clj "0.8.297"]
[ring-transit "0.1.6"]
[overtone "0.10.1"]
;; client-side
[reagent "0.6.0"]
[com.cognitect/transit-cljs "0.8.239"]])
|
Add support for rendering JSON | (defproject cascade "0.2-SNAPSHOT"
:description "Simple, fast, easy web applications in idiomatic Clojure"
:url "http://github.com/hlship/cascade"
:main main
:warn-on-reflection true
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/algo.monads "0.1.0"]
[compojure "0.6.5"]]
:dev-dependencies [[ring/ring-jetty-adapter "0.3.11"]
[swank-clojure "1.3.1"]
[midje "1.1.1"]
[lein-ring "0.4.6"]]
:ring {:handler main/app})
| (defproject cascade "0.2-SNAPSHOT"
:description "Simple, fast, easy web applications in idiomatic Clojure"
:url "http://github.com/hlship/cascade"
:main main
:warn-on-reflection true
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/algo.monads "0.1.0"]
[clj-json "0.4.3"]
[compojure "0.6.5"]]
:dev-dependencies [[ring/ring-jetty-adapter "0.3.11"]
[swank-clojure "1.3.1"]
[midje "1.1.1"]
[lein-ring "0.4.6"]]
:ring {:handler main/app})
|
Prepare for next release cycle. | (defproject org.onyxplatform/onyx-datomic "0.7.3-beta8"
:description "Onyx plugin for Datomic"
:url "https://github.com/MichaelDrogalis/onyx-datomic"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:dependencies [[org.clojure/clojure "1.7.0"]
^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.7.3-20150902_134205-g8bdc527"]]
:profiles {:dev {:dependencies [[midje "1.7.0"]
[com.datomic/datomic-free "0.9.5153"]]
:plugins [[lein-midje "3.1.3"]
[lein-set-version "0.4.1"]
[lein-pprint "1.1.1"]]}
:circle-ci {:jvm-opts ["-Xmx4g"]}})
| (defproject org.onyxplatform/onyx-datomic "0.7.3-SNAPSHOT"
:description "Onyx plugin for Datomic"
:url "https://github.com/MichaelDrogalis/onyx-datomic"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:dependencies [[org.clojure/clojure "1.7.0"]
^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.7.3-20150902_134205-g8bdc527"]]
:profiles {:dev {:dependencies [[midje "1.7.0"]
[com.datomic/datomic-free "0.9.5153"]]
:plugins [[lein-midje "3.1.3"]
[lein-set-version "0.4.1"]
[lein-pprint "1.1.1"]]}
:circle-ci {:jvm-opts ["-Xmx4g"]}})
|
Drop back to Clojure 1.1.0 until issues with 1.2.0 are resolved. | ;; The only requirement of the project.clj file is that it includes a
;; defproject form. It can have other code in it as well, including
;; loading other task definitions.
(defproject leiningen "1.2.0-SNAPSHOT"
:description "A build tool designed not to set your hair on fire."
:url "http://github.com/technomancy/leiningen"
:dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]
[ant/ant "1.6.5"]
[ant/ant-launcher "1.6.5"]
[jline "0.9.94"]
[org.apache.maven/maven-ant-tasks "2.0.10"]]
:dev-dependencies [[leiningen/lein-swank "1.1.0"]
[autodoc "0.7.0"]]
:main leiningen.core)
| ;; The only requirement of the project.clj file is that it includes a
;; defproject form. It can have other code in it as well, including
;; loading other task definitions.
(defproject leiningen "1.2.0-SNAPSHOT"
:description "A build tool designed not to set your hair on fire."
:url "http://github.com/technomancy/leiningen"
:dependencies [[org.clojure/clojure "1.1.0"]
[org.clojure/clojure-contrib "1.1.0"]
[ant/ant "1.6.5"]
[ant/ant-launcher "1.6.5"]
[jline "0.9.94"]
[org.apache.maven/maven-ant-tasks "2.0.10"]]
:dev-dependencies [[leiningen/lein-swank "1.1.0"]
[autodoc "0.7.0"]]
:main leiningen.core)
|
Add helpers to dev ns | (ns user
(:require [schema.core :as s])
(:use [figwheel-sidecar.repl-api :as ra]))
(s/set-fn-validation! true)
(defn start [] (ra/start-figwheel!))
(defn stop [] (ra/stop-figwheel!))
(defn cljs [] (ra/cljs-repl "dev"))
| (ns user
(:require [schema.core :as s])
(:use [figwheel-sidecar.repl-api :as ra]))
(s/set-fn-validation! true)
(defn start [] (ra/start-figwheel!))
(defn stop [] (ra/stop-figwheel!))
(defn cljs [] (ra/cljs-repl "dev"))
(comment
(let [codes [27 91 49 74]]
#_(map #(format "%x" %) codes)
(String. (int-array codes) 0 (count codes)))
)
|
Use newly-factored mixins to share styles to invite page | (ns braid.core.client.invites.views.invite-page-styles
(:require
[braid.core.client.ui.styles.mixins :as mixins]
[braid.core.client.ui.styles.vars :as vars]
[garden.units :refer [rem em px]]))
(def invite-page
[:>.page.invite
[:>.content
mixins/flex
{:flex-direction "column"
:align-items "center"}
[:>.invite
{:background-color "white"
:border-radius (px 10)
:padding (rem 1)
:font-size (rem 0.9)
:width "50%"}
[:button (mixins/settings-button)]
[:.invite-link
[:>input
{:width "100%"}]]]]])
| (ns braid.core.client.invites.views.invite-page-styles
(:require
[braid.core.client.ui.styles.mixins :as mixins]
[braid.core.client.ui.styles.vars :as vars]
[garden.units :refer [rem em px]]))
(def invite-page
[:>.page.invite
[:>.content
(mixins/settings-container-style)
[:>.invite
(mixins/settings-item-style)]]])
|
Add type hint on prime? | (ns com.hypirion.primes
(:import [com.hypirion.primes Primes])
(:refer-clojure :exclude [take get]))
(defn prime? [n]
(Primes/isPrime n))
(defn take [n]
(Primes/take n))
(defn get [n]
(Primes/get n))
(defn take-below [n]
(Primes/takeUnder n))
| (ns com.hypirion.primes
(:import [com.hypirion.primes Primes])
(:refer-clojure :exclude [take get]))
(defn prime? [^long n]
(Primes/isPrime n))
(defn take [n]
(Primes/take n))
(defn get [n]
(Primes/get n))
(defn take-below [n]
(Primes/takeUnder n))
|
Prepare for next release cycle. | (defproject org.onyxplatform/onyx-bookkeeper "0.8.1.0-alpha8"
:description "Onyx plugin for BookKeeper"
:url "https://github.com/onyx-platform/onyx-bookkeeper"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:dependencies [[org.clojure/clojure "1.7.0"]
^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.8.1-alpha8"]]
:profiles {:dev {:plugins [[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}
:circle-ci {:jvm-opts ["-Xmx4g"]}})
| (defproject org.onyxplatform/onyx-bookkeeper "0.8.1.0-SNAPSHOT"
:description "Onyx plugin for BookKeeper"
:url "https://github.com/onyx-platform/onyx-bookkeeper"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:dependencies [[org.clojure/clojure "1.7.0"]
^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.8.1-alpha8"]]
:profiles {:dev {:plugins [[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}
:circle-ci {:jvm-opts ["-Xmx4g"]}})
|
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.9.8.0-alpha1"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
:license {:name "MIT License"
:url "http://choosealicense.com/licenses/mit/#"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:plugins [[lein-set-version "0.4.1"]]
:profiles {:dev {:plugins [[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}}
:eval-in-leiningen true)
| (defproject onyx-app/lein-template "0.9.8.0-SNAPSHOT"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
:license {:name "MIT License"
:url "http://choosealicense.com/licenses/mit/#"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:plugins [[lein-set-version "0.4.1"]]
:profiles {:dev {:plugins [[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}}
:eval-in-leiningen true)
|
Add :output-dir build property for dev builds. | (defproject tetris "0.1.0-SNAPSHOT"
:description "Tetris implementation in ClojureScript."
:url "http://tetris.temochka.com/"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/clojurescript "0.0-2342"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]]
:plugins [[lein-cljsbuild "1.0.3"]
[com.cemerick/austin "0.1.5"]]
:cljsbuild {:builds [{:id "dev"
:source-paths ["src"]
:compiler {:output-to "resources/public/tetris.js"
:optimizations :none
:source-map true}}
{:id "prod"
:source-paths ["src/tetris"]
:compiler {:output-to "resources/public/tetris.min.js"
:optimizations :advanced
:pretty-print false}}]})
| (defproject tetris "0.1.0-SNAPSHOT"
:description "Tetris implementation in ClojureScript."
:url "http://tetris.temochka.com/"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/clojurescript "0.0-2342"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]]
:plugins [[lein-cljsbuild "1.0.3"]
[com.cemerick/austin "0.1.5"]]
:cljsbuild {:builds [{:id "dev"
:source-paths ["src"]
:compiler {:output-to "resources/public/tetris.js"
:output-dir "resources/public/out"
:optimizations :none
:source-map true}}
{:id "prod"
:source-paths ["src/tetris"]
:compiler {:output-to "resources/public/tetris.min.js"
:optimizations :advanced
:pretty-print false}}]})
|
Add boolean operators. Still need to extend these for matrices. | (ns cavm.query.functions
(:use clojure.core.matrix)
(:use clojure.core.matrix.operators)
(:refer-clojure :exclude [* - + == /])
(:gen-class))
(set-current-implementation :vectorz)
(defn meannan1d [m]
(let [NaN Double/NaN
[sum n] (ereduce
(fn [[acc cnt] x] (if (Double/isNaN x) [acc cnt] [(+ acc x) (inc cnt)]))
[0 0]
m)]
(if (= 0 n) NaN (/ sum n))))
; XXX this handling of dim is wrong for dim > 1
; XXX do we need to fill nan values, like we do in python?
(defn meannan [m dim]
(let [new-shape (assoc (vec (shape m)) (long dim) 1)]
(reshape (matrix (map meannan1d (slices m (- 1 dim)))) new-shape)))
(def functions
{'+ +
'/ /
'* emul
'- -
'mean meannan
'apply apply})
| (ns cavm.query.functions
(:use clojure.core.matrix)
(:use clojure.core.matrix.operators)
(:refer-clojure :exclude [* - + == /])
(:gen-class))
(set-current-implementation :vectorz)
(defn meannan1d [m]
(let [NaN Double/NaN
[sum n] (ereduce
(fn [[acc cnt] x] (if (Double/isNaN x) [acc cnt] [(+ acc x) (inc cnt)]))
[0 0]
m)]
(if (= 0 n) NaN (/ sum n))))
; XXX this handling of dim is wrong for dim > 1
; XXX do we need to fill nan values, like we do in python?
(defn meannan [m dim]
(let [new-shape (assoc (vec (shape m)) (long dim) 1)]
(reshape (matrix (map meannan1d (slices m (- 1 dim)))) new-shape)))
(def functions
{'+ +
'/ /
'* emul
'> >
'< <
'>= >=
'<= <=
'- -
'= ==
'mean meannan
'apply apply}) ; XXX is this a security hole? Can the user pass in clojure symbols?
|
Make cmd line command handling more robust. | (ns lexemic.core
(:require [cljs.nodejs :as node]
[lexemic.sentiment.simple :as sentiment]))
(def ^:private fs
(node/require "fs"))
(def ^:private usage-banner "Usage: lexemic [command] [implementation] [target...]")
(def ^:private supported-commands #{"help" "sentiment"})
(defn- help []
(str usage-banner))
(defn- run [cmd impl text]
(condp = cmd
"sentiment" (sentiment/analyse text)))
(defn -main [& args]
(let [command (first args)
impl (when (.match (second args) #"^-{1,2}")
(second args))
targets (if impl
(drop 2 args)
(drop 1 args))
file? (fn [path]
(.existsSync fs path))
get-string (fn [x]
(if (file? x)
(.readFileSync fs x "utf8")
(identity x)))
contents (map get-string targets)
input (print-str contents)]
(if-let [cmd (supported-commands command)]
(println (run cmd impl input))
(println (help)))))
(set! *main-cli-fn* -main)
| (ns lexemic.core
(:require [cljs.nodejs :as node]
[lexemic.sentiment.simple :as sentiment]))
(def ^:private version
(.-version (node/require "./package.json")))
(def ^:private fs
(node/require "fs"))
(def ^:private spacer "")
(def ^:private version (str "Lexemic v" version))
(def ^:private usage-banner "Usage: lexemic [command] [implementation] [target...]")
(def ^:private supported-commands #{"help" "sentiment"})
(defn- show-help []
(do
(println version)
(println spacer)
(println usage-banner)))
(defn- run [cmd impl text]
(condp = cmd
"sentiment" (prn (sentiment/analyse text))
(show-help)))
(defn -main [& args]
(let [command (first args)
impl (let [impl* (second args)]
(when (and impl* (.match impl* #"^-{1,2}"))
impl*))
targets (if impl
(drop 2 args)
(drop 1 args))
file? (fn [path]
(.existsSync fs path))
get-string (fn [x]
(if (file? x)
(.readFileSync fs x "utf8")
(identity x)))
contents (map get-string targets)
input (print-str contents)]
(if-let [cmd (supported-commands command)]
(run cmd impl input)
(show-help))))
(set! *main-cli-fn* -main)
|
Add option to run in proxied mode | (defproject checkin "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [
[org.clojure/clojure "1.6.0"]
[ring "1.3.2"]
[compojure "1.3.1"]
[ring/ring-defaults "0.1.2"]
[clj-oauth2 "0.2.0"]
[cheshire "5.4.0"]
]
:plugins [[lein-ring "0.9.1"]]
:ring {:handler checkin.handler/app
:uberwar-name "loneworkercheckin.war"})
| (defproject checkin "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [
[org.clojure/clojure "1.6.0"]
[ring "1.3.2"]
[compojure "1.3.1"]
[ring/ring-defaults "0.1.2"]
[clj-oauth2 "0.2.0"]
[cheshire "5.4.0"]
]
:profiles {:proxied
{:jvm-opts ["-Dhttp.proxyHost=127.0.0.1" "-Dhttp.proxyPort=8888" "-Dhttps.proxyHost=127.0.0.1" "-Dhttps.proxyPort=8888"]}}
:plugins [[lein-ring "0.9.1"]]
:ring {:handler checkin.handler/app
:uberwar-name "loneworkercheckin.war"}
:aliases {"run-proxied" ["with-profile" "proxied" "ring" "server"]})
|
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.9.15.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.15.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)
|
Mark changes in rill version number | (defproject rill "0.1.0"
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/core.async "0.1.338.0-5c5012-alpha"]
[org.clojure/tools.logging "0.2.6"]
[prismatic/schema "0.2.2"]
[slingshot "0.10.3"]
[environ "0.5.0"]
[cheshire "5.3.1"]
[clj-http "0.9.1"]
[com.velisco/tagged "0.3.4"]
[me.raynes/conch "0.7.0"]
[identifiers "1.1.0"]
[org.clojure/java.jdbc "0.3.4"]
[postgresql "9.1-901.jdbc4"]
[com.taoensso/nippy "2.6.3"]
[com.mchange/c3p0 "0.9.2.1"]]
:aot [rill.cli])
| (defproject rill "0.1.1"
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/core.async "0.1.338.0-5c5012-alpha"]
[org.clojure/tools.logging "0.2.6"]
[prismatic/schema "0.2.2"]
[slingshot "0.10.3"]
[environ "0.5.0"]
[cheshire "5.3.1"]
[clj-http "0.9.1"]
[com.velisco/tagged "0.3.4"]
[me.raynes/conch "0.7.0"]
[identifiers "1.1.0"]
[org.clojure/java.jdbc "0.3.4"]
[postgresql "9.1-901.jdbc4"]
[com.taoensso/nippy "2.6.3"]
[com.mchange/c3p0 "0.9.2.1"]]
:aot [rill.cli])
|
Bump jackson deps, use latest 1.4 beta for multi-test | (defproject cheshire "2.2.1-SNAPSHOT"
:description "JSON and JSON SMILE encoding, fast."
:url "https://github.com/dakrone/cheshire"
:warn-on-reflection false
:dependencies [[org.clojure/clojure "1.3.0"]
[org.codehaus.jackson/jackson-core-asl "1.9.4"]
[org.codehaus.jackson/jackson-smile "1.9.4"]]
:dev-dependencies [[lein-marginalia "0.6.0"]
[lein-multi "1.1.0"]]
:multi-deps {"1.2.1" [[org.clojure/clojure "1.2.1"]
[org.codehaus.jackson/jackson-core-asl "1.9.4"]
[org.codehaus.jackson/jackson-smile "1.9.4"]]
"1.4.0" [[org.clojure/clojure "1.4.0-beta1"]
[org.codehaus.jackson/jackson-core-asl "1.9.4"]
[org.codehaus.jackson/jackson-smile "1.9.4"]]})
| (defproject cheshire "2.2.1-SNAPSHOT"
:description "JSON and JSON SMILE encoding, fast."
:url "https://github.com/dakrone/cheshire"
:warn-on-reflection false
:dependencies [[org.clojure/clojure "1.3.0"]
[org.codehaus.jackson/jackson-core-asl "1.9.5"]
[org.codehaus.jackson/jackson-smile "1.9.5"]]
:dev-dependencies [[lein-marginalia "0.6.0"]
[lein-multi "1.1.0"]]
:multi-deps {"1.2.1" [[org.clojure/clojure "1.2.1"]
[org.codehaus.jackson/jackson-core-asl "1.9.5"]
[org.codehaus.jackson/jackson-smile "1.9.5"]]
"1.4.0" [[org.clojure/clojure "1.4.0-beta3"]
[org.codehaus.jackson/jackson-core-asl "1.9.5"]
[org.codehaus.jackson/jackson-smile "1.9.5"]]})
|
Add ring 1.2.0 dependency to get middlewares. | (defproject incise "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[speclj "2.1.2"]
[org.clojure/clojure "1.5.1"]
[hiccup "1.0.2"]
[compojure "1.1.5"]
[http-kit "2.1.1"]
[dieter "0.4.1"]]
:plugins [[speclj "2.1.2"]]
:test-paths ["spec/"])
| (defproject incise "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[speclj "2.1.2"]
[ring "1.2.0"]
[hiccup "1.0.2"]
[compojure "1.1.5"]
[http-kit "2.1.1"]
[dieter "0.4.1"]]
:plugins [[speclj "2.1.2"]]
:test-paths ["spec/"])
|
Update GitHub path to clojure-android | (defproject neko "3.0.2-SNAPSHOT"
:description "Neko is a toolkit designed to make Android development using Clojure easier and more fun."
:url "https://github.com/alexander-yakushev/neko"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure-android/clojure "1.5.1-jb"]]
:source-paths ["src" "src/clojure"]
:java-source-paths ["src/java" "gen"]
:android {:library true
:target-sdk :ics})
| (defproject neko "3.0.2-SNAPSHOT"
:description "Neko is a toolkit designed to make Android development using Clojure easier and more fun."
:url "https://github.com/clojure-android/neko"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure-android/clojure "1.5.1-jb"]]
:source-paths ["src" "src/clojure"]
:java-source-paths ["src/java" "gen"]
:android {:library true
:target-sdk :ics})
|
Put in the right magic around `:advanced` Dead Code Elimination | (ns re-frame.interop
(:require [goog.async.nextTick]
[reagent.core]
[reagent.ratom]))
(def next-tick goog.async.nextTick)
(def empty-queue #queue [])
(def after-render reagent.core/after-render)
;; make sure the Google Closure compiler see this as a boolean constatnt
;; https://developers.google.com/closure/compiler/docs/js-for-compiler
(def ^:boolean debug-enabled? "@const @define {boolean}" js/goog.DEBUG)
(defn ratom [x]
(reagent.core/atom x))
(defn ratom? [x]
(satisfies? reagent.ratom/IReactiveAtom x))
(defn deref? [x]
(satisfies? IDeref x))
(defn make-reaction [f]
(reagent.ratom/make-reaction f))
(defn add-on-dispose! [a-ratom f]
(reagent.ratom/add-on-dispose! a-ratom f))
(defn set-timeout! [f ms]
(js/setTimeout f ms))
| (ns re-frame.interop
(:require [goog.async.nextTick]
[reagent.core]
[reagent.ratom]))
(def next-tick goog.async.nextTick)
(def empty-queue #queue [])
(def after-render reagent.core/after-render)
;; Make sure the Google Closure compiler sees this as a boolean constatnt,
;; otherwise Dead Code Elimination won't happen in `:advanced` builds.
;; Type hints have been liberally sprinkled.
;; https://developers.google.com/closure/compiler/docs/js-for-compiler
(def ^boolean DEBUG? "@define {boolean}" ^boolean js/goog.DEBUG)
(defn ratom [x]
(reagent.core/atom x))
(defn ratom? [x]
(satisfies? reagent.ratom/IReactiveAtom x))
(defn deref? [x]
(satisfies? IDeref x))
(defn make-reaction [f]
(reagent.ratom/make-reaction f))
(defn add-on-dispose! [a-ratom f]
(reagent.ratom/add-on-dispose! a-ratom f))
(defn set-timeout! [f ms]
(js/setTimeout f ms))
|
Add secured route to admin page and a login page | (ns todo-repl-webapp.handler
(:require [compojure.core :refer :all]
[compojure.handler :as handler]
[compojure.route :as route]
[cemerick.friend :as friend]
(cemerick.friend [workflows :as workflows]
[credentials :as credentials])
[todo-repl-webapp.views :as views]
[todo-repl-webapp.eval :as e]
[todo-repl-webapp.users :as u]
[todo-repl-webapp.web-repl :as web-repl]))
(defroutes app-routes
(GET "/" [] "Hello World")
(GET "/home" [] (views/home (web-repl/tasks)))
(POST "/eval" [evalInput]
(let [eval-result (e/evaluate evalInput)]
(println "/eval " evalInput " evals to: " eval-result)
(views/display eval-result)))
(route/resources "/")
(route/not-found "Not Found"))
(def app
(handler/site app-routes))
(def secured-app
(-> app
(friend/authenticate {:credential-fn
(partial credentials/bcrypt-credential-fn u/users)
:workflows [(workflows/interactive-form)]})))
| (ns todo-repl-webapp.handler
(:require [compojure.core :refer :all]
[compojure.handler :as handler]
[compojure.route :as route]
[cemerick.friend :as friend]
(cemerick.friend [workflows :as workflows]
[credentials :as credentials])
[todo-repl-webapp.views :as views]
[todo-repl-webapp.eval :as e]
[todo-repl-webapp.users :as u]
[todo-repl-webapp.web-repl :as web-repl]))
(defroutes app-routes
(GET "/" [] "Hello World")
(GET "/home" [] (views/home (web-repl/tasks)))
(POST "/eval" [evalInput]
(let [eval-result (e/evaluate evalInput)]
(println "/eval " evalInput " evals to: " eval-result)
(views/display eval-result)))
(GET "/admin" request (friend/authorize #{::admin}
"Admin page"))
(GET "/login" [] "This is a login page")
(route/resources "/")
(route/not-found "Not Found"))
(def app
(handler/site app-routes))
(def secured-app
(-> app
(friend/authenticate {:credential-fn
(partial credentials/bcrypt-credential-fn u/users)
:workflows [(workflows/interactive-form)]})))
|
Update location of echo script | (ns patavi.worker.main
(:gen-class)
(:require [patavi.worker.task :as tasks :only [initialize]]
[patavi.worker.pirate.core :as pirate]
[clojure.tools.cli :refer [cli]]
[clojure.string :refer [split trim capitalize]]
[clojure.tools.logging :as log]))
(defn -main
[& args]
(let [[options args banner]
(cli args
["-h" "--help" "Show help" :default false :flag true]
["-r" "--rserve" "Start RServe from application" :default false :flag true]
["-n" "--nworkers" "Amount of worker threads to start"
:default (.availableProcessors (Runtime/getRuntime))
:parse-fn #(Integer. %)]
["-m" "--method" "R method name" :default "echo"]
["-p" "--packages" "Comma seperated list of additional R packages to load"
:parse-fn #(split % #",\s?")]
["-f" "--file" "R file to execute" :default "resources/pirate/echo.R"])
method (:method options)
file (:file options)]
(when (:help options)
(println banner)
(System/exit 0))
(pirate/initialize (:file options) (:packages options) (:rserve options))
(tasks/initialize method (:nworkers options) pirate/execute)
(while true (Thread/sleep 100))))
| (ns patavi.worker.main
(:gen-class)
(:require [patavi.worker.task :as tasks :only [initialize]]
[patavi.worker.pirate.core :as pirate]
[clojure.tools.cli :refer [cli]]
[clojure.string :refer [split trim capitalize]]
[clojure.tools.logging :as log]))
(defn -main
[& args]
(let [[options args banner]
(cli args
["-h" "--help" "Show help" :default false :flag true]
["-r" "--rserve" "Start RServe from application" :default false :flag true]
["-n" "--nworkers" "Amount of worker threads to start"
:default (.availableProcessors (Runtime/getRuntime))
:parse-fn #(Integer. %)]
["-m" "--method" "R method name" :default "echo"]
["-p" "--packages" "Comma seperated list of additional R packages to load"
:parse-fn #(split % #",\s?")]
["-f" "--file" "R file to execute" :default "resources-dev/pirate/echo.R"])
method (:method options)
file (:file options)]
(when (:help options)
(println banner)
(System/exit 0))
(pirate/initialize (:file options) (:packages options) (:rserve options))
(tasks/initialize method (:nworkers options) pirate/execute)
(while true (Thread/sleep 100))))
|
Remove println and add sanity-check | ;; Contains database-access code
(ns holston.repository
(:use [clojure.java.jdbc :as jdbc]))
;; If DATABASE_URL environment variable is not set, use
;; local PostgreSQL database on port 5432 named holston
(def db (or (System/getenv "DATABASE_URL")
"postgresql://localhost:5432/holston"))
(defn add-tasting [tasting]
(println tasting)
(jdbc/insert! db :tasting tasting))
(defn get-brewery [name]
(first (jdbc/query db ["SELECT id, name FROM brewery WHERE name = ?" name])))
(defn add-brewery [name]
(jdbc/insert! db :brewery {:name name}))
(defn get-beer [name]
(first (jdbc/query db ["SELECT id, name FROM beer WHERE name = ?" name])))
(defn add-beer [name]
(jdbc/insert! db :beer {:name name}))
| ;; Contains database-access code
(ns holston.repository
(:use [clojure.java.jdbc :as jdbc]))
;; If DATABASE_URL environment variable is not set, use
;; local PostgreSQL database on port 5432 named holston
(def db (or (System/getenv "DATABASE_URL")
"postgresql://localhost:5432/holston"))
(defn add-tasting [tasting]
(jdbc/insert! db :tasting tasting))
(defn get-brewery [name]
(first (jdbc/query db ["SELECT id, name FROM brewery WHERE name = ?" name])))
(defn add-brewery [name]
(jdbc/insert! db :brewery {:name name}))
(defn get-beer [name]
(first (jdbc/query db ["SELECT id, name FROM beer WHERE name = ?" name])))
(defn add-beer [name]
(jdbc/insert! db :beer {:name name}))
(defn db-sanity-check []
(str "Static query from DB value: " (:?column? (first (jdbc/query db
["select 'foobar'"])))))
|
Test request spec with embedded empty request spec | (ns icecap.schema-test
(:require [icecap.schema :refer :all]
[clojure.test :refer :all]
[schema.core :as s]))
(def simple-http-request {:target "http://example.test"})
(def simple-https-request {:target "https://example.test"})
(def simple-ftp-request {:target "ftp://example.test"})
(deftest RequestSpecTests
(testing "Correct request specs validate"
(are [example] (s/validate RequestSpec example)
simple-http-request
simple-https-request
#{simple-http-request simple-https-request}))
(testing "Empty specs don't validate"
(are [example reason] (= (pr-str (s/check RequestSpec example))
(pr-str reason))
[] '(not ("collection of one or more request specs" []))
#{} '(not ("collection of one or more request specs" #{}))))
(testing "Request specs with unknown/unsupported schemes don't validate"
;; Comparing string representations isn't great, but it's the best
;; easily available tool until maybe one day cddr/integrity's
;; humanize function is on Clojars + can humanize these errors :-)
(are [example reason] (= (pr-str (s/check RequestSpec example))
(pr-str reason))
simple-ftp-request {:target '(not ("supported-scheme?" "ftp://example.test"))})))
| (ns icecap.schema-test
(:require [icecap.schema :refer :all]
[clojure.test :refer :all]
[schema.core :as s]))
(def simple-http-request {:target "http://example.test"})
(def simple-https-request {:target "https://example.test"})
(def simple-ftp-request {:target "ftp://example.test"})
(deftest RequestSpecTests
(testing "Correct request specs validate"
(are [example] (s/validate RequestSpec example)
simple-http-request
simple-https-request
#{simple-http-request simple-https-request}))
(testing "Empty specs don't validate"
(are [example reason] (= (pr-str (s/check RequestSpec example))
(pr-str reason))
[] '(not ("collection of one or more request specs" []))
#{} '(not ("collection of one or more request specs" #{}))))
(testing "Specs with embedded empty specs don't validate"
(are [example reason] (= (pr-str (s/check RequestSpec example))
(pr-str reason))
[#{} simple-http-request] ['(not ("collection of one or more request specs" #{})) nil]))
(testing "Request specs with unknown/unsupported schemes don't validate"
;; Comparing string representations isn't great, but it's the best
;; easily available tool until maybe one day cddr/integrity's
;; humanize function is on Clojars + can humanize these errors :-)
(are [example reason] (= (pr-str (s/check RequestSpec example))
(pr-str reason))
simple-ftp-request {:target '(not ("supported-scheme?" "ftp://example.test"))})))
|
Replace cond with if for shorter, clearer code. | (ns prime.clj
(:gen-class))
(require '[clojure.math.numeric-tower :as math])
(defn prime? [x]
(cond
(integer? (math/sqrt x)) false
:else (every?
(fn [y] (not= (mod x y) 0))
(range 2 (math/ceil (math/sqrt x))))))
(defn -main
[& args]
(def v [])
(def i 0)
(while (< (count v) (Integer/parseInt (first args)))
(cond (prime? i) (def v (conj v i)))
(def i (inc i)))
(println v))
| (ns prime.clj
(:gen-class))
(require '[clojure.math.numeric-tower :as math])
(defn prime? [x]
(if
(integer? (math/sqrt x)) false
(every?
(fn [y] (not= (mod x y) 0))
(range 2 (math/ceil (math/sqrt x))))))
(defn -main
[& args]
(def v [])
(def i 0)
(while (< (count v) (Integer/parseInt (first args)))
(cond (prime? i) (def v (conj v i)))
(def i (inc i)))
(println v))
|
Add a fn for finding all tests | (ns radicalzephyr.boot-junit
{:boot/export-tasks true}
(:require [boot.core :as core])
(:import org.junit.runner.JUnitCore))
(defn failure->map [failure]
{:description (.. failure (getDescription) (toString))
:exception (.getException failure)
:message (.getMessage failure)})
(defn result->map [result]
{:successful? (.wasSuccessful result)
:run-time (.getRunTime result)
:run (.getRunCount result)
:ignored (.getIgnoredCount result)
:failed (.getFailureCount result)
:failures (map failure->map (.getFailures result))})
(core/deftask junit
"Run the jUnit test runner."
[p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
(core/with-pre-wrap fileset
(if (seq packages)
(let [result (JUnitCore/runClasses
(into-array Class
[#_ (magic goes here to find all test classes)]))]
(when (> (.getFailureCount result) 0)
(throw (ex-info "There were some test failures."
(result->map result)))))
(println "No packages were tested."))
fileset))
| (ns radicalzephyr.boot-junit
{:boot/export-tasks true}
(:require [boot.core :as core])
(:import org.junit.runner.JUnitCore))
(defn failure->map [failure]
{:description (.. failure (getDescription) (toString))
:exception (.getException failure)
:message (.getMessage failure)})
(defn result->map [result]
{:successful? (.wasSuccessful result)
:run-time (.getRunTime result)
:run (.getRunCount result)
:ignored (.getIgnoredCount result)
:failed (.getFailureCount result)
:failures (map failure->map (.getFailures result))})
(defn find-all-tests [packages]
[])
(core/deftask junit
"Run the jUnit test runner."
[p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
(core/with-pre-wrap fileset
(if (seq packages)
(let [result (JUnitCore/runClasses
(into-array Class
(find-all-tests packages)))]
(when (> (.getFailureCount result) 0)
(throw (ex-info "There were some test failures."
(result->map result)))))
(println "No packages were tested."))
fileset))
|
Fix rendering entries for devsrc and src files | (ns leiningen.new.re-frame
(:require [leiningen.new.templates :refer [renderer name-to-path ->files]]
[leiningen.core.main :as main]))
(def render (renderer "re-frame"))
(defn re-frame
"FIXME: write documentation"
[name]
(let [data {:name name
:sanitized (name-to-path name)}]
(main/info "Generating fresh 'lein new' re-frame project.")
(->files data
["README.md" (render "README.md" data)]
["project.clj" (render "project.clj" data)]
["{{sanitized}}.css" (render "project_name.css" data)]
["{{sanitized}}.html" (render "project_name.html" data)]
["devsrc/{{sanitized}}/dev.cljs" (render "devsrc/project_name/dev.cljs")]
["devsrc/{{sanitized}}/core.cljs" (render "src/project_name/core.cljs")])))
| (ns leiningen.new.re-frame
(:require [leiningen.new.templates :refer [renderer name-to-path ->files]]
[leiningen.core.main :as main]))
(def render (renderer "re-frame"))
(defn re-frame
"FIXME: write documentation"
[name]
(let [data {:name name
:sanitized (name-to-path name)}]
(main/info "Generating fresh 'lein new' re-frame project.")
(->files data
["README.md" (render "README.md" data)]
["project.clj" (render "project.clj" data)]
["{{sanitized}}.css" (render "project_name.css" data)]
["{{sanitized}}.html" (render "project_name.html" data)]
["devsrc/{{sanitized}}/dev.cljs" (render "devsrc/project_name/dev.cljs" data)]
["src/{{sanitized}}/core.cljs" (render "src/project_name/core.cljs" data)])))
|
Make chdir directory agnostic. Now keys off the presence of the Gemfile | (ns circle.init
(:require circle.env) ;; env needs to be loaded before any circle source files containing tests
(:require circle.swank)
(:require circle.db)
(:require circle.repl)
(:require circle.logging)
(:require circle.util.chdir)
(:require fs))
(defn maybe-change-dir
"Change the current working directory to backend/. Although changing it to the project root makes
more conceptual sense, there are lots of entrypoints to the clojure code (for example, tests,
swank, etc) which are hard to get a hook on, but making sure there is a hook into the Rails code
is easy. It makes more code to write this in JRuby, but it's written now, so why change it.cl" []
(when (= (-> (fs/cwd) fs/normpath fs/split last) "CircleCI")
(circle.util.chdir/chdir "backend")
(println "Changing current working directory to" (fs/abspath (fs/cwd)))))
(defonce init*
(delay
(try
(println "circle.init/init")
(circle.logging/init)
(when (System/getenv "CIRCLE_SWANK")
(circle.swank/init))
(circle.db/init)
(circle.repl/init)
(println (java.util.Date.))
true
(catch Exception e
(println "caught exception on startup:")
(.printStackTrace e)
(println "exiting")
(System/exit 1)))))
(defn init
"Start everything up. idempotent."
[]
@init*)
(defn -main []
(init)) | (ns circle.init
(:require circle.env) ;; env needs to be loaded before any circle source files containing tests
(:require circle.swank)
(:require circle.db)
(:require circle.repl)
(:require circle.logging)
(:require circle.util.chdir)
(:require fs))
(defn maybe-change-dir
"Change the current working directory to backend/. Although changing it to the project root makes
more conceptual sense, there are lots of entrypoints to the clojure code (for example, tests,
swank, etc) which are hard to get a hook on, but making sure there is a hook into the Rails code
is easy. It makes more code to write this in JRuby, but it's written now, so why change it.cl" []
(when (= (fs/exists? "Gemfile"))
(circle.util.chdir/chdir "backend")
(println "Changing current working directory to" (fs/abspath (fs/cwd)))))
(defonce init*
(delay
(try
(println "circle.init/init")
(circle.logging/init)
(when (System/getenv "CIRCLE_SWANK")
(circle.swank/init))
(circle.db/init)
(circle.repl/init)
(println (java.util.Date.))
true
(catch Exception e
(println "caught exception on startup:")
(.printStackTrace e)
(println "exiting")
(System/exit 1)))))
(defn init
"Start everything up. idempotent."
[]
@init*)
(defn -main []
(init)) |
Disable verbose matching log statements | ;; Utility functions and functions for manipulating state
(ns robinson.macros)
(defmacro log-time
"Log the time it takes to execute body."
[msg & body]
`(time
(let [result# (do ~@body)]
(println ~msg)
result#)))
(defn vec-match?
[test-expr expr]
(let [arg-match? (fn [[test-term term]]
(cond
(fn? test-term) (test-term term)
(= :* test-term) true
(set? test-term) (contains? test-term term)
:else (= test-term term)))
found-match (every? arg-match? (map vector test-expr expr))]
(if found-match
(println "Found match" test-expr expr)
(println "Did not find match" test-expr expr))
found-match))
(defmacro first-vec-match
[match & body]
`(condp vec-match? ~match
~@body))
| ;; Utility functions and functions for manipulating state
(ns robinson.macros)
(defmacro log-time
"Log the time it takes to execute body."
[msg & body]
`(time
(let [result# (do ~@body)]
(println ~msg)
result#)))
(defn vec-match?
[test-expr expr]
(let [arg-match? (fn [[test-term term]]
(cond
(fn? test-term) (test-term term)
(= :* test-term) true
(set? test-term) (contains? test-term term)
:else (= test-term term)))
found-match (every? arg-match? (map vector test-expr expr))]
#_(if found-match
(println "Found match" test-expr expr)
(println "Did not find match" test-expr expr))
found-match))
(defmacro first-vec-match
[match & body]
`(condp vec-match? ~match
~@body))
|
Update lein-npm version to 0.6.1. | (defproject {{name}} "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.28" :classifier "aot"
:exclusion [org.clojure/data.json]]
[org.clojure/data.json "0.2.6" :classifier "aot"]]
:jvm-opts ^:replace ["-Xmx1g" "-server"]
:node-dependencies [[source-map-support "0.3.2"]]
:plugins [[lein-npm "0.5.0"]]
:source-paths ["src" "target/classes"]
:clean-targets ["out" "release"]
:target-path "target")
| (defproject {{name}} "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.28" :classifier "aot"
:exclusion [org.clojure/data.json]]
[org.clojure/data.json "0.2.6" :classifier "aot"]]
:jvm-opts ^:replace ["-Xmx1g" "-server"]
:plugins [[lein-npm "0.6.1"]]
:npm {:dependencies [[source-map-support "0.3.2"]]}
:source-paths ["src" "target/classes"]
:clean-targets ["out" "release"]
:target-path "target")
|
Add fn to load cards from localStorage | (ns decktouch.card-data)
(def cards []) | (ns decktouch.card-data)
(defn get-card-list-from-storage []
"Get the list of cards from localStorage, or [] if it is empty"
(let [key "card-list"
list (.getItem js/localStorage key)]
(do
(.log js/console key list)
(if (undefined? list)
[]
(.parse (js/JSON))))))
(def cards []) |
Use the same implementation strategy as in the Erlang version: the snake is a list of coordinates instead of linked list | ; Copyright (C) 2008 - 2011 Stefan Marr <mail@stefan-marr.de>
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to
; deal in the Software without restriction, including without limitation the
; rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
; sell copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
; IN THE SOFTWARE.
(ns snake.game-elements)
(defn create-apple
[x y]
{:x x
:y y
:type :apple})
(defn create-snake
[x y]
{:x x
:y y
:next nil
:prev nil
:type :snake})
| ; Copyright (C) 2008 - 2011 Stefan Marr <mail@stefan-marr.de>
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to
; deal in the Software without restriction, including without limitation the
; rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
; sell copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
; IN THE SOFTWARE.
(ns snake.game-elements)
(defn create-apple
[x y]
{:x x
:y y
:type :apple})
(defn create-snake
([x y]
{:x x
:y y
:type :snake})
([[x y]] ; for convenience
(create-snake x y)))
|
Undo temporary change to version (for testing) | (defproject chestnut/lein-template "0.7.1-SNAPSHOT"
:description "A Leiningen template for a ClojureScript setup with Figwheel, Austin, Om."
:url "https://github.com/plexus/chestnut"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:eval-in-leiningen true)
| (defproject chestnut/lein-template "0.7.0-SNAPSHOT"
:description "A Leiningen template for a ClojureScript setup with Figwheel, Austin, Om."
:url "https://github.com/plexus/chestnut"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:eval-in-leiningen true)
|
Add main to uberjar profile | (defproject replme "0.1.0-SNAPSHOT"
:description "repl me"
:url "replme.clojurecup.com"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[http-kit "2.1.16"]
[compojure "1.1.9"]
[liberator "0.12.2"]
[clj-http "1.0.0"]
[javax.servlet/servlet-api "2.5"]
[org.clojure/tools.logging "0.2.6"]
[com.stuartsierra/component "0.2.2"]
[org.clojure/tools.nrepl "0.2.5"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[org.clojure/clojurescript "0.0-2311"]]
:plugins [[lein-cljsbuild "1.0.3"]]
:source-paths ["src"]
:cljsbuild {
:builds [{:id "replme"
:source-paths ["src"]
:compiler {
:output-to "resources/public/replme.js"
:output-dir "resources/public/out"
:optimizations :none
:source-map true}}]})
| (defproject replme "0.1.0-SNAPSHOT"
:description "repl me"
:url "replme.clojurecup.com"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[http-kit "2.1.16"]
[compojure "1.1.9"]
[liberator "0.12.2"]
[clj-http "1.0.0"]
[javax.servlet/servlet-api "2.5"]
[org.clojure/tools.logging "0.2.6"]
[com.stuartsierra/component "0.2.2"]
[org.clojure/tools.nrepl "0.2.5"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[org.clojure/clojurescript "0.0-2311"]]
:plugins [[lein-cljsbuild "1.0.3"]]
:source-paths ["src"]
:profiles {:uberjar {:main replme.core}}
:cljsbuild {
:builds [{:id "replme"
:source-paths ["src"]
:compiler {
:output-to "resources/public/replme.js"
:output-dir "resources/public/out"
:optimizations :none
:source-map true}}]})
|
Add dependency (Expectations 1.4.43 & plugins) | (defproject com.taoensso/faraday "0.5.2"
:description "Clojure DynamoDB client"
:url "https://github.com/ptaoussanis/faraday"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.macro "0.1.1"]
[com.amazonaws/aws-java-sdk "1.4.4.1"]
[com.taoensso/nippy "1.2.1"]
[com.taoensso/timbre "2.0.1"]]
:profiles {:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
:dev {:dependencies []}
:test {:dependencies []}
:bench {:dependencies []}}
:aliases {"test-all" ["with-profile" "test,1.5" "test"]}
:plugins [[codox "0.6.4"]]
:min-lein-version "2.0.0"
:warn-on-reflection true)
| (defproject com.taoensso/faraday "0.5.2"
:description "Clojure DynamoDB client"
:url "https://github.com/ptaoussanis/faraday"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.macro "0.1.1"]
[com.amazonaws/aws-java-sdk "1.4.4.1"]
[expectations "1.4.43"]
[com.taoensso/nippy "1.2.1"]
[com.taoensso/timbre "2.0.1"]]
:profiles {:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
:dev {:dependencies []}
:test {:dependencies []}
:bench {:dependencies []}}
:aliases {"test-all" ["with-profile" "test,1.5" "test"]}
:plugins [[lein-expectations "0.0.7"]
[lein-autoexpect "0.2.5"]
[codox "0.6.4"]]
:min-lein-version "2.0.0"
:warn-on-reflection true)
|
Fix installation of datomic free with http instead of https | (defproject kmg "0.1.0-SNAPSHOT"
:description "Knowledge Media Guide"
:url "https://github.com/alexpetrov/kmg"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[com.datomic/datomic-free "0.9.5078"]
[datomic-schema-grapher "0.0.1"]
[compojure "1.2.2"]
[http-kit "2.1.18"]
[enlive "1.1.6"]
[javax.servlet/servlet-api "2.5"]
[environ "1.0.0"]
[com.taoensso/timbre "3.3.1"]]
:plugins [[datomic-schema-grapher "0.0.1"]
[lein-environ "1.0.0"]]
:ring {:handler kmg.core/app}
:main kmg.core
:aot [kmg.core])
| (require 'cemerick.pomegranate.aether)
(cemerick.pomegranate.aether/register-wagon-factory!
"http" #(org.apache.maven.wagon.providers.http.HttpWagon.))
(defproject kmg "0.1.0-SNAPSHOT"
:description "Knowledge Media Guide"
:url "https://github.com/alexpetrov/kmg"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
;; This version of Datomic free makes me use insecure trick with http instead of https
[com.datomic/datomic-free "0.9.5078"]
[datomic-schema-grapher "0.0.1"]
[compojure "1.2.2"]
[http-kit "2.1.18"]
[enlive "1.1.6"]
[javax.servlet/servlet-api "2.5"]
[environ "1.0.0"]
[com.taoensso/timbre "3.3.1"]]
:plugins [[datomic-schema-grapher "0.0.1"]
[lein-environ "1.0.0"]]
:ring {:handler kmg.core/app}
:main kmg.core
:aot [kmg.core])
|
Change how block-forever! refs core.async | (ns desdemona.launcher.utils
(:require
[clojure.core.async :refer [chan <!!]]))
(defn block-forever!
[]
(<!! (chan)))
| (ns desdemona.launcher.utils
(:require
[clojure.core.async :as a]))
(defn block-forever!
[]
(a/<!! (a/chan)))
|
Fix wrong query on scheduled_jobs ns. | ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.scheduled-jobs.garbage
"Garbage Collector related tasks."
(:require [suricatta.core :as sc]
[uxbox.db :as db]
[uxbox.util.quartz :as qtz]))
;; --- Delete projects
;; TODO: move inline sql into resources/sql directory
(defn clean-deleted-projects
"Task that cleans the deleted projects."
{::qtz/repeat? true
::qtz/interval (* 1000 3600 24)
::qtz/job true}
[]
(with-open [conn (db/connection)]
(sc/atomic conn
(let [sql (str "DELETE FROM projects "
" WHERE deleted=true AND "
" (now()-deleted_at)::interval > '10 day'::interval;")]
(sc/execute conn sql)))))
| ;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.scheduled-jobs.garbage
"Garbage Collector related tasks."
(:require [suricatta.core :as sc]
[uxbox.db :as db]
[uxbox.util.quartz :as qtz]))
;; --- Delete projects
;; TODO: move inline sql into resources/sql directory
(defn clean-deleted-projects
"Task that cleans the deleted projects."
{::qtz/repeat? true
::qtz/interval (* 1000 3600 24)
::qtz/job true}
[]
(with-open [conn (db/connection)]
(sc/atomic conn
(let [sql (str "DELETE FROM projects "
" WHERE deleted_at is not null AND "
" (now()-deleted_at)::interval > '10 day'::interval;")]
(sc/execute conn sql)))))
|
Remove bootlaces usage without dependency declaration | (set-env!
:source-paths #{"src"}
:resource-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
[boot/core "2.1.0" :scope "provided"]
[junit "4.12" :scope "test"]])
(require '[radicalzephyr.boot-junit :refer [junit]])
(def +version+ "0.4.0")
(bootlaces! +version+)
(task-options!
pom {:project 'radicalzephyr/boot-junit
:version +version+
:description "Run some jUnit tests in boot!"
:url "https://github.com/radicalzephyr/boot-junit"
:scm {:url "https://github.com/radicalzephyr/boot-junit"}
:license {"Eclipse Public License"
"http://www.eclipse.org/legal/epl-v10.html"}})
| (set-env!
:source-paths #{"src"}
:resource-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
[boot/core "2.1.0" :scope "provided"]
[junit "4.12" :scope "test"]])
(require '[radicalzephyr.boot-junit :refer [junit]])
(def +version+ "0.4.0")
(task-options!
pom {:project 'radicalzephyr/boot-junit
:version +version+
:description "Run some jUnit tests in boot!"
:url "https://github.com/radicalzephyr/boot-junit"
:scm {:url "https://github.com/radicalzephyr/boot-junit"}
:license {"Eclipse Public License"
"http://www.eclipse.org/legal/epl-v10.html"}})
|
Use artifact list to speed up existence checking | (ns clojars.tools.upload-repo
(:require [clojure.java.io :as io]
[clojars.cloudfiles :as cf])
(:gen-class))
(defn upload-file [conn path file]
(if (cf/artifact-exists? conn path)
(println "==> Remote artifact exists, ignoring:" path)
(cf/put-file conn path file)))
(defn upload-repo [conn repo]
(->> (file-seq repo)
(filter (memfn isFile))
(run! #(upload-file conn
(cf/remote-path
(.getAbsolutePath repo)
(.getAbsolutePath %))
%))))
(defn -main [& args]
(if (not= 4 (count args))
(println "Usage: repo-path container-name user key")
(let [[repo container-name username key] args]
(upload-repo (cf/connect username key container-name) (io/file repo)))))
| (ns clojars.tools.upload-repo
(:require [clojure.java.io :as io]
[clojars.cloudfiles :as cf])
(:gen-class))
(defn upload-file [conn path file existing]
(if (existing path)
(println "!!> Remote artifact exists, ignoring:" path)
(do
(println "==> Uploading:" path)
(cf/put-file conn path file))))
(defn get-existing [conn]
(println "Retrieving current artifact list (this will take a while)")
(into #{} (cf/artifact-seq conn)))
(defn upload-repo [conn repo]
(let [existing (get-existing conn)]
(->> (file-seq repo)
(filter (memfn isFile))
(run! #(upload-file conn
(cf/remote-path
(.getAbsolutePath repo)
(.getAbsolutePath %))
%
existing)))))
(defn -main [& args]
(if (not= 4 (count args))
(println "Usage: repo-path container-name user key")
(let [[repo container-name username key] args]
(upload-repo (cf/connect username key container-name) (io/file repo)))))
|
Upgrade todomvc example karma-junit-reporter to 2.0.1 | {:npm-dev-deps {"shadow-cljs" "2.8.69"
"karma" "4.4.1"
"karma-chrome-launcher" "3.1.0"
"karma-cljs-test" "0.1.0"
"karma-junit-reporter" "1.2.0"}}
| {:npm-dev-deps {"shadow-cljs" "2.8.69"
"karma" "4.4.1"
"karma-chrome-launcher" "3.1.0"
"karma-cljs-test" "0.1.0"
"karma-junit-reporter" "2.0.1"}}
|
Add a filtered type to local-storage-atom | (ns com.palletops.bakery.local-storage-atom
"A component for an atom backed by html5 local storage."
(:require-macros
[com.palletops.api-builder.api :refer [defn-api]]
[schema.macros :refer [protocol]])
(:require
[alandipert.storage-atom :refer [local-storage]]
[schema.core :as schema]))
(defn-api local-storage-atom
"Return a component that is an atom backed by local storage (if supported).
`default` is used to initialise the atom if it is not already in
local storage. The ILifecycle protocol is not implemented."
{:sig [[schema/Any schema/Keyword :- (protocol IDeref)]]}
[default key]
(let [app-state-atom (atom default)]
(if js/localStorage
(local-storage app-state-atom key)
app-state-atom)))
| (ns com.palletops.bakery.local-storage-atom
"A component for an atom backed by html5 local storage."
(:require-macros
[com.palletops.api-builder.api :refer [defn-api]]
[schema.macros :refer [protocol]])
(:require
[alandipert.storage-atom :refer [local-storage]]
[schema.core :as schema]))
(defn-api local-storage-atom
"Return a component that is an atom backed by local storage (if supported).
`default` is used to initialise the atom if it is not already in
local storage. The ILifecycle protocol is not implemented."
{:sig [[schema/Any schema/Keyword :- (protocol IDeref)]]}
[default key]
(let [app-state-atom (atom default)]
(if js/localStorage
(local-storage app-state-atom key)
app-state-atom)))
;; define a value reference type that is serialised as nil
(deftype Filtered [v]
IDeref
(-deref [_] v)
tailrecursion.cljson/EncodeTagged
(-encode [_] nil))
(defn transient-value
"Return a value that when deref'd wil return v, and will not be
stored in local storage."
[v]
(Filtered. v))
|
Use react 10 extern release for "componentWillMount". | (defproject breeze-quiescent "0.1.1-SNAPSHOT"
:description "A minimal, functional ClojureScript wrapper for ReactJS"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2173" :scope "provided"]
[com.facebook/react "0.9.0.2"]]
:source-paths ["src"]
;; development concerns
:profiles {:dev {:source-paths ["src" "examples/src"]
:resource-paths ["examples/resources"]
:plugins [[lein-cljsbuild "1.0.1"]]
:cljsbuild
{:builds
[{:source-paths ["src" "examples/src"]
:compiler
{:output-to "examples/resources/public/main.js"
:output-dir "examples/resources/public/build"
:optimizations :whitespace
:preamble ["react/react.min.js"]
:externs ["react/externs/react.js"]
:pretty-print true
:source-map
"examples/resources/public/main.js.map"
:closure-warnings {:non-standard-jsdoc :off}}}]}}})
| (defproject breeze-quiescent "0.1.1-SNAPSHOT"
:description "A minimal, functional ClojureScript wrapper for ReactJS"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2173" :scope "provided"]
[org.clojars.narma/react "0.10.0"]]
:source-paths ["src"]
;; development concerns
:profiles {:dev {:source-paths ["src" "examples/src"]
:resource-paths ["examples/resources"]
:plugins [[lein-cljsbuild "1.0.1"]]
:cljsbuild
{:builds
[{:source-paths ["src" "examples/src"]
:compiler
{:output-to "examples/resources/public/main.js"
:output-dir "examples/resources/public/build"
:optimizations :whitespace
:preamble ["react/react.min.js"]
:externs ["react/externs/react.js"]
:pretty-print true
:source-map
"examples/resources/public/main.js.map"
:closure-warnings {:non-standard-jsdoc :off}}}]}}})
|
Put my dependency version back the way it belongs | (defproject foreclojure "0.1.3.2"
:description "4clojure - a website for lisp beginners"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.2.0"]
[compojure "0.6.2"]
[hiccup "0.2.4"]
[clojail "0.4.0-SNAPSHOT"]
[sandbar "0.4.0-SNAPSHOT"]
[org.clojars.christophermaier/congomongo "0.1.4-SNAPSHOT"]
[org.jasypt/jasypt "1.7"]
[amalloy/utils "0.3.7"]
[clj-github "1.0.1"]
[ring "0.3.7"]
[clj-config "0.1.0"]
[incanter/incanter-charts "1.2.1"]
[org.apache.commons/commons-email "1.2"]]
:dev-dependencies [[lein-ring "0.4.0"]
[swank-clojure "1.2.1"]]
:main foreclojure.core
:ring {:handler foreclojure.core/app})
| (defproject foreclojure "0.1.3.2"
:description "4clojure - a website for lisp beginners"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.2.0"]
[compojure "0.6.2"]
[hiccup "0.2.4"]
[clojail "0.4.0-SNAPSHOT"]
[sandbar "0.4.0-SNAPSHOT"]
[org.clojars.christophermaier/congomongo "0.1.4-SNAPSHOT"]
[org.jasypt/jasypt "1.7"]
[amalloy/utils "[0.3.7,)"]
[clj-github "1.0.1"]
[ring "0.3.7"]
[clj-config "0.1.0"]
[incanter/incanter-charts "1.2.1"]
[org.apache.commons/commons-email "1.2"]]
:dev-dependencies [[lein-ring "0.4.0"]
[swank-clojure "1.2.1"]]
:main foreclojure.core
:ring {:handler foreclojure.core/app})
|
Add initial round of tests. | (ns multihash.core-test
(:require
[clojure.test :refer :all]
[multihash.core :as multihash]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| (ns multihash.core-test
(:require
[clojure.test :refer :all]
[multihash.core :as multihash]))
(deftest app-specific-codes
(is (false? (multihash/app-code? 0x00)))
(doseq [code (range 0x01 0x10)]
(is (true? (multihash/app-code? code))
(str "Algorithm code " code " is app-specific")))
(doseq [code (range 0x10 0x100)]
(is (false? (multihash/app-code? code))
(str "Algorithm code " code " is not app-specific"))))
(def examples
"Test case examples."
{"11140beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
[0x11 :sha1 20 "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"]
"11040beec7b8"
[0x11 :sha1 4 "0beec7b8"]
"12202c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
[0x12 :sha2-256 32 "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"]
"12042c26b46b"
[0x12 :sha2-256 4 "2c26b46b"]
"40042c26b46b"
[0x40 :blake2b 4 "2c26b46b"]})
(deftest example-decoding
(doseq [[encoded [code algorithm length digest]] examples]
(let [mhash (multihash/decode encoded)]
(is (= code (:code mhash)))
(is (= algorithm (:algorithm mhash)))
(is (= length (:length mhash)))
(is (= digest (:digest mhash))))))
(deftest example-encoding
(doseq [[encoded [code algorithm length digest]] examples]
(let [mhash (multihash/create algorithm digest)]
(is (= encoded (multihash/encode mhash))))))
|
Update secretary dependency in todomvc | (defproject todomvc-re-frame "0.10.5"
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.10.439"]
[reagent "0.8.1"]
[re-frame "0.10.5"]
[binaryage/devtools "0.9.10"]
[secretary "1.2.3"]
[day8.re-frame/tracing "0.5.1"]]
:plugins [[lein-cljsbuild "1.1.7"]
[lein-figwheel "0.5.18"]]
:hooks [leiningen.cljsbuild]
:profiles {:dev {:cljsbuild
{:builds {:client {:compiler {:asset-path "js"
:optimizations :none
:source-map true
:source-map-timestamp true
:main "todomvc.core"}
:figwheel {:on-jsload "todomvc.core/main"}}}}}
:prod {:cljsbuild
{:builds {:client {:compiler {:optimizations :advanced
:elide-asserts true
:pretty-print false}}}}}}
:figwheel {:server-port 3450
:repl true}
:clean-targets ^{:protect false} ["resources/public/js" "target"]
:cljsbuild {:builds {:client {:source-paths ["src" "../../src"]
:compiler {:output-dir "resources/public/js"
:output-to "resources/public/js/client.js"}}}})
| (defproject todomvc-re-frame "0.10.5"
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.10.439"]
[reagent "0.8.1"]
[re-frame "0.10.5"]
[binaryage/devtools "0.9.10"]
[clj-commons/secretary "1.2.4"]
[day8.re-frame/tracing "0.5.1"]]
:plugins [[lein-cljsbuild "1.1.7"]
[lein-figwheel "0.5.18"]]
:hooks [leiningen.cljsbuild]
:profiles {:dev {:cljsbuild
{:builds {:client {:compiler {:asset-path "js"
:optimizations :none
:source-map true
:source-map-timestamp true
:main "todomvc.core"}
:figwheel {:on-jsload "todomvc.core/main"}}}}}
:prod {:cljsbuild
{:builds {:client {:compiler {:optimizations :advanced
:elide-asserts true
:pretty-print false}}}}}}
:figwheel {:server-port 3450
:repl true}
:clean-targets ^{:protect false} ["resources/public/js" "target"]
:cljsbuild {:builds {:client {:source-paths ["src" "../../src"]
:compiler {:output-dir "resources/public/js"
:output-to "resources/public/js/client.js"}}}})
|
Add JDK 9+ module example. | (defproject hello-world "0.23.1"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[uncomplicate/neanderthal "0.23.1"]]
:exclusions [[org.jcuda/jcuda-natives :classifier "apple-x86_64"]
[org.jcuda/jcublas-natives :classifier "apple-x86_64"]])
| (defproject hello-world "0.23.1"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[uncomplicate/neanderthal "0.23.1"]]
:exclusions [[org.jcuda/jcuda-natives :classifier "apple-x86_64"]
[org.jcuda/jcublas-natives :classifier "apple-x86_64"]]
:jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"
#_"--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"])
|
Correct expected data structure for externs | {:foreign-libs [{:file "js/fuse/fuse.min.js"
:provides ["cljsjs.fuse"]}]
:externs "js/fuse/fuse.ext.js"}
| {:foreign-libs [{:file "js/fuse/fuse.min.js"
:provides ["cljsjs.fuse"]}]
:externs ["js/fuse/fuse.ext.js"]}
|
Change version to snapshot again | ;; The Climate Corporation licenses this file to you under under the Apache
;; License, Version 2.0 (the "License"); you may not use this file except in
;; compliance with the License. You may obtain a copy of the License at
;;
;; http://www.apache.org/licenses/LICENSE-2.0
;;
;; See the NOTICE file distributed with this work for additional information
;; regarding copyright ownership. Unless required by applicable law or agreed
;; to in writing, software distributed under the License is distributed on an
;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
;; or implied. See the License for the specific language governing permissions
;; and limitations under the License.
(defproject com.climate/claypoole
"0.3.3"
:description "Claypoole: Threadpool tools for Clojure."
:url "http://github.com/TheClimateCorporation/claypoole/"
:license {:name "Apache License Version 2.0"
:url http://www.apache.org/licenses/LICENSE-2.0
:distribution :repo}
:min-lein-version "2.0.0"
:source-paths ["src/clj"]
:java-source-paths ["src/java"]
:pedantic? :warn
:dependencies [[org.clojure/clojure "1.6.0"]]
:plugins [[jonase/eastwood "0.1.4"]])
| ;; The Climate Corporation licenses this file to you under under the Apache
;; License, Version 2.0 (the "License"); you may not use this file except in
;; compliance with the License. You may obtain a copy of the License at
;;
;; http://www.apache.org/licenses/LICENSE-2.0
;;
;; See the NOTICE file distributed with this work for additional information
;; regarding copyright ownership. Unless required by applicable law or agreed
;; to in writing, software distributed under the License is distributed on an
;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
;; or implied. See the License for the specific language governing permissions
;; and limitations under the License.
(defproject com.climate/claypoole
"0.3.3-SNAPSHOT"
:description "Claypoole: Threadpool tools for Clojure."
:url "http://github.com/TheClimateCorporation/claypoole/"
:license {:name "Apache License Version 2.0"
:url http://www.apache.org/licenses/LICENSE-2.0
:distribution :repo}
:min-lein-version "2.0.0"
:source-paths ["src/clj"]
:java-source-paths ["src/java"]
:pedantic? :warn
:dependencies [[org.clojure/clojure "1.6.0"]]
:plugins [[jonase/eastwood "0.1.4"]])
|
Prepare for next release cycle. | (defproject org.onyxplatform/onyx-datomic "0.7.12"
:description "Onyx plugin for Datomic"
:url "https://github.com/MichaelDrogalis/onyx-datomic"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:dependencies [[org.clojure/clojure "1.7.0"]
^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.7.12"]]
:profiles {:dev {:dependencies [[midje "1.7.0"]
[com.datomic/datomic-free "0.9.5153"]]
:plugins [[lein-midje "3.1.3"]
[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}
:circle-ci {:jvm-opts ["-Xmx4g"]}})
| (defproject org.onyxplatform/onyx-datomic "0.7.13-SNAPSHOT"
:description "Onyx plugin for Datomic"
:url "https://github.com/MichaelDrogalis/onyx-datomic"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:dependencies [[org.clojure/clojure "1.7.0"]
^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
[org.onyxplatform/onyx "0.7.12"]]
:profiles {:dev {:dependencies [[midje "1.7.0"]
[com.datomic/datomic-free "0.9.5153"]]
:plugins [[lein-midje "3.1.3"]
[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}
:circle-ci {:jvm-opts ["-Xmx4g"]}})
|
Prepare 0.7.0: add marginalia and midje. | (defproject
li.elmnt/datapump "0.6.0"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[prismatic/schema "0.4.0"]]
:profiles {:dev {:dependencies [[junit/junit "4.11"]]}}
:plugins [[lein-junit "1.1.8"]
[lein-localrepo "0.5.3"]]
:source-paths ["src/clojure"]
:java-source-paths ["src/java"]
:test-paths ["test/clojure"]
:java-test-paths ["test/java"]
:junit ["test/java"])
| (defproject
li.elmnt/datapump "0.7.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[prismatic/schema "0.4.0"]]
:profiles {:dev {:dependencies [[junit/junit "4.11"]
[midje "1.6.3"]]}}
:plugins [[lein-junit "1.1.8"]
[lein-localrepo "0.5.3"]
[lein-midje "3.1.3"]
[lein-marginalia "0.8.0"]]
:source-paths ["src/clojure"]
:java-source-paths ["src/java"]
:test-paths ["test/clojure"]
:java-test-paths ["test/java"]
:junit ["test/java"])
|
Update to snapshot version before release | (defproject clj-chrome-devtools "20190529"
:description "Clojure API for Chrome DevTools remote"
:license {:name "MIT License"}
:url "https://github.com/tatut/clj-chrome-devtools"
:dependencies [[org.clojure/clojure "1.9.0"]
[http-kit "2.3.0"]
[cheshire "5.8.1"]
[stylefruits/gniazdo "1.1.1"]
[org.clojure/core.async "0.4.490"]
[com.taoensso/timbre "4.10.0"]]
:plugins [[lein-codox "0.10.3"]]
:codox {:output-path "docs/api"
:metadata {:doc/format :markdown}})
| (defproject clj-chrome-devtools "20190530-SNAPSHOT"
:description "Clojure API for Chrome DevTools remote"
:license {:name "MIT License"}
:url "https://github.com/tatut/clj-chrome-devtools"
:dependencies [[org.clojure/clojure "1.9.0"]
[http-kit "2.3.0"]
[cheshire "5.8.1"]
[stylefruits/gniazdo "1.1.1"]
[org.clojure/core.async "0.4.490"]
[com.taoensso/timbre "4.10.0"]]
:plugins [[lein-codox "0.10.3"]]
:codox {:output-path "docs/api"
:metadata {:doc/format :markdown}})
|
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.12.0.0-alpha2"
: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.0.0-SNAPSHOT"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
:license {:name "MIT License"
:url "http://choosealicense.com/licenses/mit/#"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:plugins [[lein-set-version "0.4.1"]]
:profiles {:dev {:plugins [[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}}
:eval-in-leiningen true)
|
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.8.11.2"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
: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}}
: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.8.11.3-SNAPSHOT"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
: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}}
: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)
|
Advance version number to 0.1.3-SNAPSHOT | (defproject io.aviso/rook "0.1.2"
:description "Ruby on Rails-style resource mapping for Clojure/Compojure web apps"
:url "https://github.com/AvisoNovate/rook"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
;; Normally we don't AOT compile; only when tracking down reflection warnings.
:profiles {:reflection-warnings {:aot :all
:global-vars {*warn-on-reflection* true}}}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.logging "0.2.6"]
[compojure "1.1.6"]
[org.clojure/core.memoize "0.5.6"]]
:profiles {:dev {:dependencies [[ring-mock "0.1.5"]]}}
:plugins [[test2junit "1.0.1"]])
| (defproject io.aviso/rook "0.1.3-SNAPSHOT"
:description "Ruby on Rails-style resource mapping for Clojure/Compojure web apps"
:url "https://github.com/AvisoNovate/rook"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
;; Normally we don't AOT compile; only when tracking down reflection warnings.
:profiles {:reflection-warnings {:aot :all
:global-vars {*warn-on-reflection* true}}}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.logging "0.2.6"]
[compojure "1.1.6"]
[org.clojure/core.memoize "0.5.6"]]
:profiles {:dev {:dependencies [[ring-mock "0.1.5"]]}}
:plugins [[test2junit "1.0.1"]])
|
Update to 0.2.0-SNAPSHOT of boot-junit | (set-env!
:source-paths #{"src"}
:dependencies '[[radicalzephyr/boot-junit "0.1.1" :scope "test"]
[jeluard/boot-notify "0.1.2" :scope "test"]
[net.sf.jopt-simple/jopt-simple "4.9"]])
(def +version+ "0.1.0-SNAPSHOT")
(require '[radicalzephyr.boot-junit :refer [junit]]
'[jeluard.boot-notify :refer [notify]])
(task-options!
pom {:project 'http-server
:version +version+
:description "A Java HTTP server."
:url "https://github.com/RadicalZephyr/http-server"
:scm {:url "https://github.com/RadicalZephyr/http-server.git"}
:licens {"MIT" "http://opensource.org/licenses/MIT"}}
jar {:file "server.jar"
:manifest {"Main-Class" "net.zephyrizing.http_server.HttpServer"}})
;;; This prevents a name collision WARNING between the test task and
;;; clojure.core/test, a function that nobody really uses or cares
;;; about.
(if ((loaded-libs) 'boot.user)
(ns-unmap 'boot.user 'test))
(deftask test
"Compile and run my jUnit tests."
[]
(comp (javac)
(junit)))
(deftask build
"Build my http server."
[]
(comp (javac)
(pom)
(jar)))
| (set-env!
:source-paths #{"src"}
:dependencies '[[radicalzephyr/boot-junit "0.2.0-SNAPSHOT" :scope "test"]
[jeluard/boot-notify "0.1.2" :scope "test"]
[net.sf.jopt-simple/jopt-simple "4.9"]])
(def +version+ "0.1.0-SNAPSHOT")
(require '[radicalzephyr.boot-junit :refer [junit]]
'[jeluard.boot-notify :refer [notify]])
(task-options!
pom {:project 'http-server
:version +version+
:description "A Java HTTP server."
:url "https://github.com/RadicalZephyr/http-server"
:scm {:url "https://github.com/RadicalZephyr/http-server.git"}
:licens {"MIT" "http://opensource.org/licenses/MIT"}}
jar {:file "server.jar"
:manifest {"Main-Class" "net.zephyrizing.http_server.HttpServer"}})
;;; This prevents a name collision WARNING between the test task and
;;; clojure.core/test, a function that nobody really uses or cares
;;; about.
(if ((loaded-libs) 'boot.user)
(ns-unmap 'boot.user 'test))
(deftask test
"Compile and run my jUnit tests."
[]
(comp (javac)
(junit)))
(deftask build
"Build my http server."
[]
(comp (javac)
(pom)
(jar)))
|
Update clj compiler to 1.8.0-RC4 in :1.8 profile. | {:dev
{:aliases {"test-all" ["with-profile" "dev,1.8:dev,1.6:dev,1.5:dev" "test"]}
:codeina {:sources ["src"]
:reader :clojure
:target "doc/dist/latest/api"
:src-uri "http://github.com/funcool/buddy-core/blob/master/"
:src-uri-prefix "#L"}
:plugins [[funcool/codeina "0.3.0"]
[lein-ancient "0.6.7"]]}
:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0-beta2"]]}}
| {:dev
{:aliases {"test-all" ["with-profile" "dev,1.8:dev,1.6:dev,1.5:dev" "test"]}
:codeina {:sources ["src"]
:reader :clojure
:target "doc/dist/latest/api"
:src-uri "http://github.com/funcool/buddy-core/blob/master/"
:src-uri-prefix "#L"}
:plugins [[funcool/codeina "0.3.0"]
[lein-ancient "0.6.7"]]}
:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0-RC4"]]}}
|
Add helpers for the reader and int parsing. | (ns uxbox.util.data
"A collection of data transformation utils.")
(defn index-by
"Return a indexed map of the collection
keyed by the result of executing the getter
over each element of the collection."
[coll getter]
(let [data (transient {})]
(run! #(assoc! data (getter %) %) coll)
(persistent! data)))
(def ^:static index-by-id #(index-by % :id))
(defn remove-nil-vals
"Given a map, return a map removing key-value
pairs when value is `nil`."
[data]
(into {} (remove (comp nil? second) data)))
| (ns uxbox.util.data
"A collection of data transformation utils."
(:require [cljs.reader :as r]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Data structure manipulation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn index-by
"Return a indexed map of the collection
keyed by the result of executing the getter
over each element of the collection."
[coll getter]
(let [data (transient {})]
(run! #(assoc! data (getter %) %) coll)
(persistent! data)))
(def ^:static index-by-id #(index-by % :id))
(defn remove-nil-vals
"Given a map, return a map removing key-value
pairs when value is `nil`."
[data]
(into {} (remove (comp nil? second) data)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Numbers Parsing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn read-string
[v]
(r/read-string v))
(defn parse-int
[v]
(js/parseInt v 10))
|
Upgrade Apache Storm to 1.2.1 | (defproject spamscope "2.3.0-SNAPSHOT"
:resource-paths ["_resources"]
:target-path "_build"
:min-lein-version "2.0.0"
:jvm-opts ["-client"]
:dependencies [[org.apache.storm/storm-core "1.1.1"]
[org.apache.storm/flux-core "1.1.1"]]
:jar-exclusions [#"log4j\.properties" #"org\.apache\.storm\.(?!flux)" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
:uberjar-exclusions [#"log4j\.properties" #"org\.apache\.storm\.(?!flux)" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
)
| (defproject spamscope "2.3.0-SNAPSHOT"
:resource-paths ["_resources"]
:target-path "_build"
:min-lein-version "2.0.0"
:jvm-opts ["-client"]
:dependencies [[org.apache.storm/storm-core "1.2.1"]
[org.apache.storm/flux-core "1.2.1"]]
:jar-exclusions [#"log4j\.properties" #"org\.apache\.storm\.(?!flux)" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
:uberjar-exclusions [#"log4j\.properties" #"org\.apache\.storm\.(?!flux)" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
)
|
Add fn to list rooms with nice commas and ands. | (ns isla.talk
(:use [clojure.pprint])
(:require [clojure.string :as str])
(:require [mrc.utils :as utils]))
(defn room-intro [room]
(str "You are in the " (:name room) ". "
(:summary room)))
(defn room-already [name] (str "You are already in the " name "."))
(defn room-not-allowed [name] (str "You cannot go into the " name "."))
| (ns isla.talk
(:use [clojure.pprint])
(:require [clojure.string :as str])
(:require [mrc.utils :as utils]))
(defn room-intro [room]
(declare list-rooms)
(str "You are in the " (:name room) ". "
(:summary room)))
(defn room-already [name] (str "You are already in the " name "."))
(defn room-not-allowed [name] (str "You cannot go into the " name "."))
(defmulti list-rooms (fn [rooms] (count rooms)))
(defmethod list-rooms 0 [rooms] "There is no way out of this room.")
(defmethod list-rooms 1 [rooms] (str "You can see a door to the " (:name (first rooms))))
(defmethod list-rooms :default [rooms]
(let [all-room-list (reduce (fn [string x]
(str string ", the " (:name x)))
"" rooms)
all-but-last-list (rest (butlast (str/split all-room-list #",")))
final (str "You can see a door to"
(str/join "," all-but-last-list)
" and the " (:name (last rooms)) ".")]
final))
|
Add a run-app entry point | (ns bocko-ios.core
(:require bocko.core))
(defn ^:export init
[canvas-view-controller]
(bocko.core/set-create-canvas
(fn [color-map raster width height _ _]
(add-watch raster :monitor
(fn [_ _ old new]
(when-not (= old new)
(doseq [x (range width)]
(let [old-col (nth old x)
new-col (nth new x)]
(when-not (= old-col new-col)
(doseq [y (range height)]
(let [old-color (nth old-col y)
new-color (nth new-col y)]
(when-not (= old-color new-color)
(let [[r g b] (new-color color-map)]
(.plotXYRedGreenBlue canvas-view-controller x y r g b)))))))))))))) | (ns bocko-ios.core
(:require bocko.core))
(defn run-app
[]
(comment "Code here will be run when app launches"))
(defn ^:export init
[canvas-view-controller]
(bocko.core/set-create-canvas
(fn [color-map raster width height _ _]
(add-watch raster :monitor
(fn [_ _ old new]
(when-not (= old new)
(doseq [x (range width)]
(let [old-col (nth old x)
new-col (nth new x)]
(when-not (= old-col new-col)
(doseq [y (range height)]
(let [old-color (nth old-col y)
new-color (nth new-col y)]
(when-not (= old-color new-color)
(let [[r g b] (new-color color-map)]
(.plotXYRedGreenBlue canvas-view-controller x y r g b)))))))))))))
(run-app))
|
Update to newer version of clojure. | (defproject scrabble "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.6.0"]
[thinktopic/cortex "0.1.0-SNAPSHOT"]]
:main scrabble.core)
| (defproject scrabble "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.8.0"]
[thinktopic/cortex "0.1.0-SNAPSHOT"]]
:main scrabble.core)
|
Update aws-sdk-java and other library versions | (defproject java-s3-tests/java-s3-tests "0.0.1"
:dependencies [[org.clojure/clojure "1.5.1"]
[com.reiddraper/clj-aws-s3 "0.4.2"]
[clj-http "0.7.1"]
[cheshire "5.1.0"]]
:profiles {:dev {:dependencies [[midje "1.5.1"]]}}
:min-lein-version "2.0.0"
:plugins [[lein-midje "3.0.1"]]
:description "integration tests for Riak CS using the offical Java SDK")
| (defproject java-s3-tests/java-s3-tests "0.0.2"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/tools.logging "0.3.1"]
;; aws-sdk-java deps
[com.amazonaws/aws-java-sdk "1.10.8" :exclusions [joda-time]]
[joda-time "2.8.1"]
[com.fasterxml.jackson.core/jackson-core "2.5.3"]
[com.fasterxml.jackson.core/jackson-databind "2.5.3"]
;; user_creation deps
[clj-http "2.0.0"]
[cheshire "5.1.0"]]
;; :jvm-opts ["-verbose:class"]
:profiles {:dev {:dependencies [[midje "1.7.0"]]}}
:min-lein-version "2.0.0"
:plugins [[lein-midje "3.1.3"]]
:description "integration tests for Riak CS using the offical Java SDK")
|
Advance version number to 0.1.7 | (defproject io.aviso/twixt "0.1.6"
:description "An extensible asset pipeline for Clojure web applications"
:url "https://github.com/AvisoNovate/twixt"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.logging "0.2.6"]
[ring/ring-core "1.2.1"]
[org.mozilla/rhino "1.7R4"]
[com.github.sommeri/less4j "1.2.1"]
[de.neuland-bfi/jade4j "0.4.0"]
[io.aviso/pretty "0.1.8"]
[hiccup "1.0.4"]]
:codox {:src-dir-uri "https://github.com/AvisoNovate/twixt/blob/master/"
:src-linenum-anchor-prefix "L"}
:profiles {:dev {:dependencies [[log4j "1.2.17"]
[ring/ring-jetty-adapter "1.2.0"]]}})
| (defproject io.aviso/twixt "0.1.7"
:description "An extensible asset pipeline for Clojure web applications"
:url "https://github.com/AvisoNovate/twixt"
:license {:name "Apache Sofware Licencse 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.logging "0.2.6"]
[ring/ring-core "1.2.1"]
[org.mozilla/rhino "1.7R4"]
[com.github.sommeri/less4j "1.2.1"]
[de.neuland-bfi/jade4j "0.4.0"]
[io.aviso/pretty "0.1.8"]
[hiccup "1.0.4"]]
:codox {:src-dir-uri "https://github.com/AvisoNovate/twixt/blob/master/"
:src-linenum-anchor-prefix "L"}
:profiles {:dev {:dependencies [[log4j "1.2.17"]
[ring/ring-jetty-adapter "1.2.0"]]}})
|
Use env for elastic url. | (ns clj-templates.config.main-config
(:require [integrant.core :as ig]
[environ.core :refer [env]]))
(def main-config
{:handler/main {:db (ig/ref :db/postgres)}
:server/jetty {:handler (ig/ref :handler/main)
:opts {:port 3000 :join? false}}
:db/postgres {:jdbc-url (env :database-url)
:driver-class-name "org.postgresql.Driver"}
:logger/timbre {:appenders {:println {:stream :auto}}}
:jobs/scheduled-jobs {:hours-between-jobs 1
:db (ig/ref :db/postgres)
:es-client (ig/ref :search/elastic)}
:search/elastic {:hosts ["http://127.0.0.1:9200"]
:default-headers {:content-type "application/json"}}})
| (ns clj-templates.config.main-config
(:require [integrant.core :as ig]
[environ.core :refer [env]]))
(def main-config
{:handler/main {:db (ig/ref :db/postgres)}
:server/jetty {:handler (ig/ref :handler/main)
:opts {:port 3000 :join? false}}
:db/postgres {:jdbc-url (env :database-url)
:driver-class-name "org.postgresql.Driver"}
:logger/timbre {:appenders {:println {:stream :auto}}}
:jobs/scheduled-jobs {:hours-between-jobs 1
:db (ig/ref :db/postgres)
:es-client (ig/ref :search/elastic)}
:search/elastic {:hosts [(env :elastic-url)]
:default-headers {:content-type "application/json"}}})
|
Fix reply and nREPL versions | (defproject ohpauleez/cmma "0.1.0-SNAPSHOT"
:description "Clojure + Make Managed Applications"
:url "https://github.com/ohpauleez/cmma"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
;; Try nrepl 0.2.5 and reply 0.3.5 - :(
[org.clojure/tools.nrepl "0.2.3"]
[reply "0.3.4" :exclusions [[ring/ring-core]]]
[com.cemerick/pomegranate "0.3.0" :exclusions [[org.apache.httpcomponents/httpclient]
[org.codehaus.plexus/plexus-utils]
[commons-codec]]]
[pedantic "0.2.0"]
[org.eclipse.jgit/org.eclipse.jgit.java7 "3.4.1.201406201815-r"]
;; Patch up deps
[org.apache.httpcomponents/httpclient "4.1.3"]
[org.codehaus.plexus/plexus-utils "3.0"]
[commons-codec "1.5"]]
:global-vars {*warn-on-reflection* true
*assert* true}
:pedantic? :abort)
| (defproject ohpauleez/cmma "0.1.0-SNAPSHOT"
:description "Clojure + Make Managed Applications"
:url "https://github.com/ohpauleez/cmma"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/tools.nrepl "0.2.5"]
[reply "0.3.5" :exclusions [[ring/ring-core]]]
[com.cemerick/pomegranate "0.3.0" :exclusions [[org.apache.httpcomponents/httpclient]
[org.codehaus.plexus/plexus-utils]
[commons-codec]]]
[pedantic "0.2.0"]
[org.eclipse.jgit/org.eclipse.jgit.java7 "3.4.1.201406201815-r"]
;; Patch up deps
[org.apache.httpcomponents/httpclient "4.1.3"]
[org.codehaus.plexus/plexus-utils "3.0"]
[commons-codec "1.5"]]
:global-vars {*warn-on-reflection* true
*assert* true}
:pedantic? :abort)
|
Remove broken test generated by project template | (ns time-tracker.core-test
(:require [clojure.test :refer :all]
[time-tracker.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| (ns time-tracker.core-test
(:require [clojure.test :refer :all]
[time-tracker.core :refer :all]))
|
Revert to older version of commons-codec for compatibility with compojure | (ns such.random
"Random numbers and crypographic hashes"
(:import org.apache.commons.codec.digest.DigestUtils))
(defn guid
"A random almost-certainly-unique identifier"
[]
(str (java.util.UUID/randomUUID)))
(def uuid "Synonym for `guid`" guid)
(defn form-hash
"Returns a SHA-1 hash (encoded as a hex string) from the `prn` representation of the input.
Use for collision avoidance when the highest security is not needed."
[form]
(DigestUtils/sha1Hex (pr-str form)))
| (ns such.random
"Random numbers and crypographic hashes"
(:import org.apache.commons.codec.digest.DigestUtils))
(defn guid
"A random almost-certainly-unique identifier"
[]
(str (java.util.UUID/randomUUID)))
(def uuid "Synonym for `guid`" guid)
(defn form-hash
"Returns a SHA-1 hash (encoded as a hex string) from the `prn` representation of the input.
Use for collision avoidance when the highest security is not needed."
[form]
;; Note: this is deprecated in later versions of commons.codec. However,
;; we're using an old version for compatibility with Compojure.
;; When compojure updates, we can use sha1Hex.
(DigestUtils/shaHex (pr-str form)))
|
Make it easier to separate between jar and uberjar | (defproject inlein/client "0.1.0-SNAPSHOT"
:description "Inlein your dependencies."
:url "https://github.com/hyPiRion/inlein"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies []
:source-paths []
:java-source-paths ["src"]
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
:main inlein.client.Main
:scm {:dir ".."}
:aliases {"javadoc" ["shell" "javadoc" "-d" "javadoc/inlein-${:version}"
"-sourcepath" "src" "inlein.client"]}
:plugins [[lein-shell "0.5.0"]]
:uberjar-name "inlein-%s.jar"
;; to avoid complaints from Leiningen
:profiles {:uberjar {:aot :all}
:dev {:dependencies [[org.clojure/clojure "1.8.0"]]}})
| (defproject inlein/client "0.1.0-SNAPSHOT"
:description "Inlein your dependencies."
:url "https://github.com/hyPiRion/inlein"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies []
:source-paths []
:java-source-paths ["src"]
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
:main inlein.client.Main
:scm {:dir ".."}
:aliases {"javadoc" ["shell" "javadoc" "-d" "javadoc/inlein-${:version}"
"-sourcepath" "src" "inlein.client"]}
:plugins [[lein-shell "0.5.0"]]
:jar-name "inlein-no-deps-%s.jar"
:uberjar-name "inlein-%s.jar"
;; to avoid complaints from Leiningen
:profiles {:uberjar {:aot :all}
:dev {:dependencies [[org.clojure/clojure "1.8.0"]]}})
|
Use DB connection configuration from config.edn | (ns formlogic.db
(:require [yesql.core :refer [defqueries]]))
(def db-spec {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5432/formlogic"
:user "formlogic"})
(defqueries "sql/get.sql" {:connection db-spec})
(defqueries "sql/insert.sql" {:connection db-spec})
| (ns formlogic.db
(:require [yesql.core :refer [defqueries]]
[formlogic.config :refer [cget]]))
(def db-spec {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname (format "//%s:%d/%s"
(cget :db :host)
(cget :db :port)
(cget :db :database))
:user (cget :db :user)})
(defqueries "sql/get.sql" {:connection db-spec})
(defqueries "sql/insert.sql" {:connection db-spec})
|
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.10.0.0-beta16"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
:license {:name "MIT License"
:url "http://choosealicense.com/licenses/mit/#"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:plugins [[lein-set-version "0.4.1"]]
:profiles {:dev {:plugins [[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}}
:eval-in-leiningen true)
| (defproject onyx-app/lein-template "0.10.0.0-SNAPSHOT"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
:license {:name "MIT License"
:url "http://choosealicense.com/licenses/mit/#"}
:repositories {"snapshots" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}
"releases" {:url "https://clojars.org/repo"
:username :env
:password :env
:sign-releases false}}
:plugins [[lein-set-version "0.4.1"]]
:profiles {:dev {:plugins [[lein-set-version "0.4.1"]
[lein-update-dependency "0.1.2"]
[lein-pprint "1.1.1"]]}}
:eval-in-leiningen true)
|
Enable assertions in development mode | (defproject {{app-name}} "0.1.0-SNAPSHOT"
:description ""
:url ""
:license {:name ""
:url ""}
:dependencies [[aero "1.0.0-beta2"]
[org.clojure/clojure "1.8.0"]
[org.clojure/tools.cli "0.3.5"]
[org.onyxplatform/onyx "{{onyx-version}}{{onyx-version-post}}"]
[org.onyxplatform/lib-onyx "{{onyx-version}}.{{lib-onyx-minor}}"]]
:source-paths ["src"]
:profiles {:dev {:jvm-opts ["-XX:-OmitStackTraceInFastThrow"]
:global-vars {*assert* false}}
:dependencies [[org.clojure/tools.namespace "0.2.11"]
[lein-project-version "0.1.0"]]
:uberjar {:aot [lib-onyx.media-driver
{{app-name}}.core]
:uberjar-name "peer.jar"
:global-vars {*assert* false}}})
| (defproject {{app-name}} "0.1.0-SNAPSHOT"
:description ""
:url ""
:license {:name ""
:url ""}
:dependencies [[aero "1.0.0-beta2"]
[org.clojure/clojure "1.8.0"]
[org.clojure/tools.cli "0.3.5"]
[org.onyxplatform/onyx "{{onyx-version}}{{onyx-version-post}}"]
[org.onyxplatform/lib-onyx "{{onyx-version}}.{{lib-onyx-minor}}"]]
:source-paths ["src"]
:profiles {:dev {:jvm-opts ["-XX:-OmitStackTraceInFastThrow"]
:global-vars {*assert* true}}
:dependencies [[org.clojure/tools.namespace "0.2.11"]
[lein-project-version "0.1.0"]]
:uberjar {:aot [lib-onyx.media-driver
{{app-name}}.core]
:uberjar-name "peer.jar"
:global-vars {*assert* false}}})
|
Reduce ZK timeout back to default for zookeeper-clj | (ns onyx.static.default-vals)
(def defaults
{; input task defaults
:onyx/input-retry-timeout 1000
:onyx/pending-timeout 60000
:onyx/max-pending 10000
; task defaults
:onyx/batch-timeout 1000
; zookeeper defaults
:onyx.peer/zookeeper-timeout 50000
; peer defaults
:onyx.peer/inbox-capacity 1000
:onyx.peer/outbox-capacity 1000
:onyx.peer/drained-back-off 400
:onyx.peer/sequential-back-off 2000
:onyx.peer/job-not-ready-back-off 500
; messaging defaults
:onyx.messaging.aeron/embedded-driver? true
:onyx.messaging.netty/thread-pool-sizes 1
:onyx.messaging.netty/connect-timeout-millis 1000
:onyx.messaging.netty/pending-buffer-size 10000
:onyx.messaging/completion-buffer-size 50000
:onyx.messaging/release-ch-buffer-size 10000
:onyx.messaging/retry-ch-buffer-size 10000})
| (ns onyx.static.default-vals)
(def defaults
{; input task defaults
:onyx/input-retry-timeout 1000
:onyx/pending-timeout 60000
:onyx/max-pending 10000
; task defaults
:onyx/batch-timeout 1000
; zookeeper defaults
:onyx.peer/zookeeper-timeout 6000
; peer defaults
:onyx.peer/inbox-capacity 1000
:onyx.peer/outbox-capacity 1000
:onyx.peer/drained-back-off 400
:onyx.peer/sequential-back-off 2000
:onyx.peer/job-not-ready-back-off 500
; messaging defaults
:onyx.messaging.aeron/embedded-driver? true
:onyx.messaging.netty/thread-pool-sizes 1
:onyx.messaging.netty/connect-timeout-millis 1000
:onyx.messaging.netty/pending-buffer-size 10000
:onyx.messaging/completion-buffer-size 50000
:onyx.messaging/release-ch-buffer-size 10000
:onyx.messaging/retry-ch-buffer-size 10000})
|
Update MP3 encoder to operate on JS arrays/data | (ns audio-utils.mp3-encoder
(:require [cljsjs.lamejs]
[audio-utils.worker :as w]))
(defrecord MP3Encoder [bit-rate sample-rate next]
w/IWorkerAudioNode
(connect [this destination]
(reset! next destination))
(disconnect [this]
(reset! next nil))
(process-audio [this data]
(let [int-data (mapv (fn [samples]
(into-array (map #(* 32768 %) samples)))
data)
encoder (js/lamejs.Mp3Encoder. (count data) sample-rate
bit-rate)
encoded #js []]
(doto encoded
(.push (apply (aget encoder "encodeBuffer") int-data))
(.push (.flush encoder)))
(some-> @next (w/process-audio encoded)))))
(defn mp3-encoder
[{:keys [bit-rate
sample-rate]
:or {bit-rate 128
sample-rate 44100}}]
(map->MP3Encoder {:bit-rate bit-rate
:sample-rate sample-rate
:next (atom nil)}))
| (ns audio-utils.mp3-encoder
(:require [cljsjs.lamejs]
[audio-utils.util :as u]
[audio-utils.worker :as w]))
(defrecord MP3Encoder [bit-rate sample-rate next]
w/IWorkerAudioNode
(connect [this destination]
(reset! next destination))
(disconnect [this]
(reset! next nil))
(process-audio [this data]
(let [int-data (u/amap (fn [samples]
(u/amap #(* 32768 %) samples))
data)
encoder (js/lamejs.Mp3Encoder. (u/acount data) sample-rate
bit-rate)
encoded #js []]
(doto encoded
(.push (apply (.-encodeBuffer encoder) int-data))
(.push (.flush encoder)))
(some-> @next (w/process-audio encoded)))))
(defn mp3-encoder
[{:keys [bit-rate
sample-rate]
:or {bit-rate 128
sample-rate 44100}}]
(map->MP3Encoder {:bit-rate bit-rate
:sample-rate sample-rate
:next (atom nil)}))
|
Fix creating directory instead of file. | (ns leiningen.new.vdom-app
(:use [leiningen.new.templates :only [renderer name-to-path ->files]]))
(def render (renderer "vdom-app"))
(defn vdom-app [name]
(let [data {:name name
:path (name-to-path name)}]
(->files data
["index.html" (render "index.html" data)]
["dev.html" (render "dev.html" data)]
["project.clj" (render "project.clj" data)]
"externs"
["externs/vdom.js" (render "externs/vdom.js" data)]
"src/{{path}}"
["src/{{path}}/core.cljs" (render "src/vdom_app/core.cljs" data)]
"resources/public/js"
["resources/public/js/vdom.js" (render "resources/public/js/vdom.js" data)]
"resources/public/css"
"resources/public/css/{{path}}.css" (render "resources/public/css/styles.css" data))))
| (ns leiningen.new.vdom-app
(:use [leiningen.new.templates :only [renderer name-to-path ->files]]))
(def render (renderer "vdom-app"))
(defn vdom-app [name]
(let [data {:name name
:path (name-to-path name)}]
(->files data
["index.html" (render "index.html" data)]
["dev.html" (render "dev.html" data)]
["project.clj" (render "project.clj" data)]
"externs"
["externs/vdom.js" (render "externs/vdom.js" data)]
"src/{{path}}"
["src/{{path}}/core.cljs" (render "src/vdom_app/core.cljs" data)]
"resources/public/js"
["resources/public/js/vdom.js" (render "resources/public/js/vdom.js" data)]
"resources/public/css"
["resources/public/css/{{path}}.css" (render "resources/public/css/styles.css" data)])))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.