Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add onchange handler for simple view input
(ns cglossa.search-inputs (:require [clojure.string :as str])) (defn cwb-search-inputs [{:keys [search-query]}] (let [displayed-query (-> @search-query :query (str/replace #"\[\(?\w+=\"(.+?)\"(?:\s+%c)?\)?\]" "$1"))] [:div.row-fluid [:form.form-inline.span12 [:div.span10 [:input.span12 {:ref "searchfield" :type "text" :value displayed-query}]]]])) (def components {:cwb cwb-search-inputs :cwb-speech (fn [] [:div "CWB-SPEECHE"])})
(ns cglossa.search-inputs (:require [clojure.string :as str])) (defn cwb-search-inputs [{:keys [search-query]}] (let [query (:query @search-query) displayed-query (str/replace query #"\[\(?\w+=\"(.+?)\"(?:\s+%c)?\)?\]" "$1") phonetic? (not= -1 (.indexOf query "phon="))] [:div.row-fluid [:form.form-inline.span12 [:div.span10 [:input.span12 {:type "text" :value displayed-query :on-change #(swap! search-query assoc-in [:query] (aget % "target" "value"))}] [:label {:style {:marginTop 5}}] [:input {:name "phonetic" :type "checkbox" :style {:marginTop -3} :checked phonetic?} " Phonetic form"]]]])) (def components {:cwb cwb-search-inputs :cwb-speech (fn [] [:div "CWB-SPEECHE"])})
Add lein kibit for code suggestion/linter
{:user {:plugins [[lein-vanity "0.2.0" :exclusions [org.clojure/clojure]] [lein-ancient "0.6.5"] [jonase/eastwood "0.2.0"] ;;[com.billpiel/sayid "0.0.10"] ] :dependencies [[slamhound "1.5.5"]] :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}
{:user {:plugins [[lein-vanity "0.2.0" :exclusions [org.clojure/clojure]] [lein-ancient "0.6.5"] [lein-kibit "0.1.3"] [jonase/eastwood "0.2.0"] ;;[com.billpiel/sayid "0.0.10"] ] :dependencies [[slamhound "1.5.5"]] :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}
Fix "env var has been cast-to-string" issue.
{:user {:env {:squiggly {:checkers [:eastwood] :eastwood-exclude-linters [:kibit]}} :plugin-repositories [["private-plugins" {:url "private repo url"}]] :singing {:gpg-key "matthew.russell@wormbase.org"} :dependencies [[clojure-ini "0.0.2"] [me.raynes/fs "1.4.6"]] :plugins [[jonase/eastwood "0.2.3"] [lein-ancient "0.6.10"] [lein-bikeshed "0.4.1"] [lein-ns-dep-graph "0.1.0-SNAPSHOT"] [refactor-nrepl "2.2.0"]] ;; VisualVM profiling opts ;; :jvm-opts ["-Dcom.sun.management.jmxremote" ;; "-Dcom.sun.management.jmxremote.ssl=false" ;; "-Dcom.sun.management.jmxremote.authenticate=false" ;; "-Dcom.sun.management.jmxremote.port=43210"]} :repl {:dependencies [[acyclic/squiggly-clojure "0.1.6"] [cider/cider-nrepl "0.15.0-SNAPSHOT"] [datomic-schema-grapher "0.0.1"] [org.clojure/tools.nrepl "0.2.12"]] :plugins [[cider/cider-nrepl "0.15.0-SNAPSHOT"]]} :repl-options {:init (set! *print-length* 10)}}}
{:user {:env {:squiggly "{:checkers [:eastwood]}"} :plugin-repositories [["private-plugins" {:url "private repo url"}]] :singing {:gpg-key "matthew.russell@wormbase.org"} :dependencies [[clojure-ini "0.0.2"] [me.raynes/fs "1.4.6"]] :plugins [[jonase/eastwood "0.2.3"] [lein-ancient "0.6.10"] [lein-bikeshed "0.4.1"] [lein-ns-dep-graph "0.1.0-SNAPSHOT"] [refactor-nrepl "2.2.0"]] ;; VisualVM profiling opts ;; :jvm-opts ["-Dcom.sun.management.jmxremote" ;; "-Dcom.sun.management.jmxremote.ssl=false" ;; "-Dcom.sun.management.jmxremote.authenticate=false" ;; "-Dcom.sun.management.jmxremote.port=43210"]} } :repl {:dependencies [[acyclic/squiggly-clojure "0.1.6"] [cider/cider-nrepl "0.15.0-SNAPSHOT"] [datomic-schema-grapher "0.0.1"] [org.clojure/tools.nrepl "0.2.12"]] :plugins [[cider/cider-nrepl "0.15.0-SNAPSHOT"]]} :repl-options {:init (set! *print-length* 10)}}
Correct Seesaw dep was lost in recent merge. Fixed.
(defproject overtone "0.7.0-SNAPSHOT" :description "Programmable Music." :url "http://project-overtone.org" :dependencies [[org.clojure/clojure "1.3.0"] [org.clojure/core.incubator "0.1.0"] [org.clojure/data.json "0.1.2"] [overtone/scsynth-jna "0.1.2-SNAPSHOT"] [overtone/at-at "0.2.1"] [overtone/osc-clj "0.7.1"] [overtone/byte-spec "0.3.1"] [overtone/midi-clj "0.2.1"] [clj-glob "1.0.0"] [org.clojure/core.match "0.2.0-alpha6"] [seesaw "1.3.0"]] :jvm-opts ["-Xms256m" "-Xmx1g" "-XX:+UseConcMarkSweepGC"])
(defproject overtone "0.7.0-SNAPSHOT" :description "Programmable Music." :url "http://project-overtone.org" :dependencies [[org.clojure/clojure "1.3.0"] [org.clojure/core.incubator "0.1.0"] [org.clojure/data.json "0.1.2"] [overtone/scsynth-jna "0.1.2-SNAPSHOT"] [overtone/at-at "0.2.1"] [overtone/osc-clj "0.7.1"] [overtone/byte-spec "0.3.1"] [overtone/midi-clj "0.2.1"] [clj-glob "1.0.0"] [org.clojure/core.match "0.2.0-alpha6"] [seesaw "1.3.1-SNAPSHOT"]] :jvm-opts ["-Xms256m" "-Xmx1g" "-XX:+UseConcMarkSweepGC"])
Prepare for next release cycle.
(defproject onyx-app/lein-template "0.10.0.0-beta6" :description "Onyx Leiningen application template" :url "https://github.com/onyx-platform/onyx-template" :license {:name "MIT License" :url "http://choosealicense.com/licenses/mit/#"} :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :plugins [[lein-set-version "0.4.1"]] :profiles {:dev {:plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}} :eval-in-leiningen true)
(defproject onyx-app/lein-template "0.10.0.0-SNAPSHOT" :description "Onyx Leiningen application template" :url "https://github.com/onyx-platform/onyx-template" :license {:name "MIT License" :url "http://choosealicense.com/licenses/mit/#"} :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :plugins [[lein-set-version "0.4.1"]] :profiles {:dev {:plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}} :eval-in-leiningen true)
Prepare for next development iteration (0.3.0-SNAPSHOT)
(defproject jungerer "0.2.0" :description "Clojure network/graph library wrapping JUNG" :url "https://github.com/totakke/jungerer" :license {:name "The BSD 3-Clause License" :url "https://opensource.org/licenses/BSD-3-Clause"} :dependencies [[org.clojure/clojure "1.7.0"] [net.sf.jung/jung-algorithms "2.1.1"] [net.sf.jung/jung-api "2.1.1"] [net.sf.jung/jung-graph-impl "2.1.1"] [net.sf.jung/jung-io "2.1.1"] [net.sf.jung/jung-visualization "2.1.1"]] :profiles {:dev {:global-vars {*warn-on-reflection* true} :resource-paths ["dev-resources"]} :1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha12"]] :resource-paths ["dev-resources"]} :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]] :resource-paths ["dev-resources"]}} :deploy-repositories [["snapshots" {:url "https://clojars.org/repo/" :username [:env/clojars_username :gpg] :password [:env/clojars_password :gpg]}]] :codox {:source-uri "https://github.com/totakke/jungerer/blob/{version}/{filepath}#L{line}"})
(defproject jungerer "0.3.0-SNAPSHOT" :description "Clojure network/graph library wrapping JUNG" :url "https://github.com/totakke/jungerer" :license {:name "The BSD 3-Clause License" :url "https://opensource.org/licenses/BSD-3-Clause"} :dependencies [[org.clojure/clojure "1.7.0"] [net.sf.jung/jung-algorithms "2.1.1"] [net.sf.jung/jung-api "2.1.1"] [net.sf.jung/jung-graph-impl "2.1.1"] [net.sf.jung/jung-io "2.1.1"] [net.sf.jung/jung-visualization "2.1.1"]] :profiles {:dev {:global-vars {*warn-on-reflection* true} :resource-paths ["dev-resources"]} :1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha12"]] :resource-paths ["dev-resources"]} :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]] :resource-paths ["dev-resources"]}} :deploy-repositories [["snapshots" {:url "https://clojars.org/repo/" :username [:env/clojars_username :gpg] :password [:env/clojars_password :gpg]}]] :codox {:source-uri "https://github.com/totakke/jungerer/blob/{version}/{filepath}#L{line}"})
Prepare for next release cycle.
(defproject onyx-app/lein-template "0.11.1.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.11.1.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 sonatype snapshots again for tools.nrepl
(defproject reply "0.1.0-SNAPSHOT" :description "REPL-y: A fitter, happier, more productive REPL for Clojure." :dependencies [[org.clojure/clojure "1.3.0"] [org.clojars.trptcolin/jline "2.6-SNAPSHOT"] [org.thnetos/cd-client "0.3.1" :exclusions [org.clojure/clojure]] [clj-stacktrace "0.2.4"] [clojure-complete "0.1.4" :exclusions [org.clojure/clojure]] [org.clojure/tools.nrepl "0.0.6-SNAPSHOT"]] :dev-dependencies [[midje "1.3-alpha4" :exclusions [org.clojure/clojure]] [lein-midje "[1.0.0,)"]] :aot [reply.reader.jline.JlineInputReader] :source-path "src/clj" :java-source-path "src/java")
(defproject reply "0.1.0-SNAPSHOT" :description "REPL-y: A fitter, happier, more productive REPL for Clojure." :dependencies [[org.clojure/clojure "1.3.0"] [org.clojars.trptcolin/jline "2.6-SNAPSHOT"] [org.thnetos/cd-client "0.3.1" :exclusions [org.clojure/clojure]] [clj-stacktrace "0.2.4"] [clojure-complete "0.1.4" :exclusions [org.clojure/clojure]] [org.clojure/tools.nrepl "0.0.6-SNAPSHOT"]] :dev-dependencies [[midje "1.3-alpha4" :exclusions [org.clojure/clojure]] [lein-midje "[1.0.0,)"]] :repositories { "sonatype" {:url "http://oss.sonatype.org/content/repositories/snapshots" } } :aot [reply.reader.jline.JlineInputReader] :source-path "src/clj" :java-source-path "src/java")
Add check to mil-add ugen to avoid server crashes when rates aren't similar
(ns overtone.sc.machinery.ugen.metadata.basicops (:use [overtone.sc.machinery.ugen common check])) ;;see binaryopugen.clj and unaryopugen.clj for detailed docspecs for binary and unary opugens. (def specs [ {:name "UnaryOpUGen", :args [{:name "a" :doc "input"}], :rates #{:dr :ir :ar :kr} :default-rate :auto :categories [["Unary Operations"]] :doc "Multi-function unary ugen representing many operations (e.g. neg, abs, floor, sqrt, midicps, etc...)"} {:name "BinaryOpUGen", :args [{:name "a" :doc "First input"} {:name "b" :doc "Second input"}], :rates #{:dr :ir :ar :kr} :default-rate :auto :doc "Multi-function binary ugen representing many operations (e.g. +, *, <, min, max, etc...)"} {:name "MulAdd", :args [{:name "in" :doc "Input to modify"} {:name "mul" :doc "Multiplier Value"} {:name "add" :doc "Addition Value"}], :rates #{:dr :ir :ar :kr} :default-rate :auto :doc "Multiply the input source by mul then add the add value. Equivalent to, but more efficient than, (+ add (* mul in))"} ])
(ns overtone.sc.machinery.ugen.metadata.basicops (:use [overtone.sc.machinery.ugen common check])) ;;see binaryopugen.clj and unaryopugen.clj for detailed docspecs for binary and unary opugens. (def specs [ {:name "UnaryOpUGen", :args [{:name "a" :doc "input"}], :rates #{:dr :ir :ar :kr} :default-rate :auto :categories [["Unary Operations"]] :doc "Multi-function unary ugen representing many operations (e.g. neg, abs, floor, sqrt, midicps, etc...)"} {:name "BinaryOpUGen", :args [{:name "a" :doc "First input"} {:name "b" :doc "Second input"}], :rates #{:dr :ir :ar :kr} :default-rate :auto :doc "Multi-function binary ugen representing many operations (e.g. +, *, <, min, max, etc...)"} {:name "MulAdd", :args [{:name "in" :doc "Input to modify"} {:name "mul" :doc "Multiplier Value"} {:name "add" :doc "Addition Value"}], :rates #{:dr :ir :ar :kr} :default-rate :auto :check (same-rate-as-first-input) :doc "Multiply the input source by mul then add the add value. Equivalent to, but more efficient than, (+ add (* mul in))"} ])
Make the web tests init first.
(ns circleci.web.test-web (:require [clj-http.client :as http]) (:use midje.sweet)) (def site "http://localhost:8080") (fact "/ returns 200" (http/get site) => (contains {:status 200}))
(ns circleci.web.test-web (:require circleci.init) (:require [clj-http.client :as http]) (:use midje.sweet)) (circleci.init/init) (def site "http://localhost:8080") (fact "/ returns 200" (http/get site) => (contains {:status 200}))
Prepare for next release cycle.
(defproject org.onyxplatform/onyx-datomic "0.8.1.0-alpha9" :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.8.1-alpha9"]] :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.8.1.0-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.8.1-alpha9"]] :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"]}})
Add the ability to start a daemon called blinken.
(defproject govuk/blinken "0.1.0-SNAPSHOT" :description "Dashboard to integrate multiple alert systems" :url "https://github.com/alphagov/blinken" :license {:name "MIT" :url "http://opensource.org/licenses/MIT"} :dependencies [[org.clojure/clojure "1.5.1"] [docopt "0.6.1"] [http-kit "2.1.16"] [cheshire "5.2.0"] [hiccup "1.0.4"] [clj-yaml "0.4.0"] [compojure "1.1.6"] [lein-daemon "0.5.4"] [org.clojure/core.async "0.1.267.0-0d7780-alpha"] [org.clojure/tools.logging "0.2.6"]] :plugins [[lein-daemon "0.5.4"]] :main govuk.blinken)
(defproject govuk/blinken "0.1.0-SNAPSHOT" :description "Dashboard to integrate multiple alert systems" :url "https://github.com/alphagov/blinken" :license {:name "MIT" :url "http://opensource.org/licenses/MIT"} :dependencies [[org.clojure/clojure "1.5.1"] [docopt "0.6.1"] [http-kit "2.1.16"] [cheshire "5.2.0"] [hiccup "1.0.4"] [clj-yaml "0.4.0"] [compojure "1.1.6"] [lein-daemon "0.5.4"] [org.clojure/core.async "0.1.267.0-0d7780-alpha"] [org.clojure/tools.logging "0.2.6"]] :daemon {:blinken {:ns govuk.blinken}} :plugins [[lein-daemon "0.5.4"]] :main govuk.blinken)
Increase card width (to better fit alert messages)
(ns braid.client.ui.styles.vars (:require [garden.units :refer [rem px]] [garden.arithmetic :as m])) (def avatar-size (rem 2)) (def pad (rem 1)) (def card-width (rem 17)) (def top-bar-height (rem 2)) (def sidebar-width (m/+ top-bar-height (m/* pad 2))) (def grey-text "#888") (def dark-bg-color "#3A4767") (def border-radius (px 3)) (def private-thread-accent-color "#5f7997") (def limbo-thread-accent-color "#CA1414") (def archived-thread-accent-color "#AAAAAA")
(ns braid.client.ui.styles.vars (:require [garden.units :refer [rem px]] [garden.arithmetic :as m])) (def avatar-size (rem 2)) (def pad (rem 1)) (def card-width (rem 18)) (def top-bar-height (rem 2)) (def sidebar-width (m/+ top-bar-height (m/* pad 2))) (def grey-text "#888") (def dark-bg-color "#3A4767") (def border-radius (px 3)) (def private-thread-accent-color "#5f7997") (def limbo-thread-accent-color "#CA1414") (def archived-thread-accent-color "#AAAAAA")
Improve placement of cookie message.
(ns staircase.views.footer (:require [staircase.views.header :refer (tool-list)] [hiccup.element :refer (link-to unordered-list mail-to)])) (defn snippet [config] [:section.footer.dark {:ng-controller "FooterCtrl"} [:div.panel.panel-info {:ng-show "showCookieMessage"} [:div.panel-heading "Cookies"] [:div.panel-body [:button.btn.btn-warning.pull-right {:ng-click "showCookieMessage = false"} "understood"] [:p "This site uses cookies to provide essential functionality, such as remembering your identity. You can find out details of what information we store here " (link-to "/cookies" "here") ". By dismissing this message you agree to let this application store the data it needs to operate."] ]] [:div.row [:div.col-sm-8.site-map [:ul [:li (link-to "/" "Home")] [:li (link-to "/about" "Help")] [:li "Tools" [:ul.row (tool-list {:class "col-sm-6"})]]]] [:div.col-sm-4.contacts (unordered-list (for [[icon addr text] (:contacts config)] (link-to addr [:i.fa.fa-fw.fa-2x {:class icon}] " " text)))] ] ])
(ns staircase.views.footer (:require [staircase.views.header :refer (tool-list)] [hiccup.element :refer (link-to unordered-list mail-to)])) (defn snippet [config] [:section.footer.dark {:ng-controller "FooterCtrl"} [:div.row [:div.col-sm-8.site-map [:ul [:li (link-to "/" "Home")] [:li (link-to "/about" "Help")] [:li "Tools" [:ul.row (tool-list {:class "col-sm-6"})]]]] [:div.col-sm-4.contacts (unordered-list (for [[icon addr text] (:contacts config)] (link-to addr [:i.fa.fa-fw.fa-2x {:class icon}] " " text)))] ] [:div.row.panel.panel-info {:ng-show "showCookieMessage"} [:div.panel-heading "Cookies"] [:div.panel-body [:button.btn.btn-warning.pull-right {:ng-click "showCookieMessage = false"} "understood"] [:p "This site uses cookies to provide essential functionality, such as remembering your identity. You can find out details of what information we store here " (link-to "/cookies" "here") ". By dismissing this message you agree to let this application store the data it needs to operate."] ]] ])
Add a reset function to frontend-dev ns
(ns comic-reader.frontend-dev (:require [clojure.java.browse :refer [browse-url]] [clojure.repl :refer :all] [comic-reader.system :refer [go start stop]] [figwheel-sidecar.repl-api :refer :all])) (defn- cwd [] (.getCanonicalPath (java.io.File. "."))) (def figwheel-config {:figwheel-options {:http-server-root "public" :css-dirs ["resources/public/css"]} :build-ids ["dev"] :all-builds [{:id "dev" :source-paths ["src/cljs" "test/cljs"] :figwheel {:devcards true} :compiler {:main "comic-reader.devcards" :optimizations :none :source-map true :source-map-timestamp true :output-to "resources/public/js/compiled/devcards.js" :output-dir (str (cwd) "/resources/public/js/compiled/devcards_out") :asset-path "js/compiled/devcards_out"}}]}) (defn start-dev! [& args] (apply go args) (start-figwheel! figwheel-config) (start-autobuild) (browse-url "http://localhost:10555/devcards")) (defn stop-dev! [] (stop-autobuild) (stop-figwheel!) (stop))
(ns comic-reader.frontend-dev (:require [clojure.java.browse :refer [browse-url]] [clojure.repl :refer :all] [clojure.tools.namespace.repl :refer [refresh]] [comic-reader.system :refer [go start stop]] [figwheel-sidecar.repl-api :refer :all])) (defn- cwd [] (.getCanonicalPath (java.io.File. "."))) (def figwheel-config {:figwheel-options {:http-server-root "public" :css-dirs ["resources/public/css"]} :build-ids ["dev"] :all-builds [{:id "dev" :source-paths ["src/cljs" "test/cljs"] :figwheel {:devcards true} :compiler {:main "comic-reader.devcards" :optimizations :none :source-map true :source-map-timestamp true :output-to "resources/public/js/compiled/devcards.js" :output-dir (str (cwd) "/resources/public/js/compiled/devcards_out") :asset-path "js/compiled/devcards_out"}}]}) (defn start-dev! [& args] (apply go args) (start-figwheel! figwheel-config) (start-autobuild) (browse-url "http://localhost:10555/devcards")) (defn stop-dev! [] (stop-autobuild) (stop-figwheel!) (stop)) (defn reset [] (stop-dev!) (refresh :after 'comic-reader.frontend-dev/start-dev!))
Add common plugins for leiningen project
;; https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md {:user {:plugins [[lein-pprint "1.3.2" lein-ancient "0.7.0" lein-cloverage "1.2.2"]] :dependencies [[alembic "0.3.2"] [clj-kondo "RELEASE"] [antq "RELEASE"] [vvvvalvalval/scope-capture "0.3.2"]] :injections [(require 'sc.api)] :aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"] "outdated" ["run" "-m" "antq.core"]}}}
;; https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md {:user {:plugins [[cider/cider-nrepl "0.25.9"] [lein-ancient "0.7.0"] [lein-check-namespace-decls "1.0.4"] [lein-cljfmt "0.8.0"] [lein-nsorg "0.3.0"] [refactor-nrepl/refactor-nrepl "3.0.0-alpha13"]]} :dependencies [#_[alembic "0.3.2"] [clj-kondo "RELEASE"] [antq "RELEASE"] [vvvvalvalval/scope-capture "0.3.2"]] :injections [(require 'sc.api)] :aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"] "outdated" ["run" "-m" "antq.core"]}}
Use minified version of scripts
(ns subman.views (:use [hiccup core page])) (defn index-page [] (html5 {:ng-app "subman"} [:head [:title "Subman - subtitle search service with api"] (include-css "/components/bootstrap/dist/css/bootstrap.css" "/components/bootstrap/dist/css/bootstrap-theme.css" "/components/font-awesome/css/font-awesome.css") (include-js "/components/jquery/jquery.js" "/components/bootstrap/dist/js/bootstrap.js" "/main.js")] [:body [:script "subman.core.run();"]]))
(ns subman.views (:use [hiccup core page])) (defn index-page [] (html5 {:ng-app "subman"} [:head [:title "Subman - subtitle search service with api"] (include-css "/components/bootstrap/dist/css/bootstrap.css" "/components/bootstrap/dist/css/bootstrap-theme.css" "/components/font-awesome/css/font-awesome.css") (include-js "/components/jquery/jquery.min.js" "/components/bootstrap/dist/js/bootstrap.min.js" "/main.js")] [:body [:script "subman.core.run();"]]))
Fix path to the minified rxjs bundled file.
{:foreign-libs [{:file "_rxjs/rx.all.js" :file-min "_rxjs/rx.all.minjs" :provides ["beicon.extern.rxjs"]}] :externs ["_rxjs/externs.js"]}
{:foreign-libs [{:file "_rxjs/rx.all.js" :file-min "_rxjs/rx.all.min.js" :provides ["beicon.extern.rxjs"]}] :externs ["_rxjs/externs.js"]}
Add a "seam" for an external likelihood function.
(ns bayes-table.core) (def model-ids [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]) (def models (map #(hash-map :b-wins (- 1 %) :a-wins %) model-ids)) (def priors [0.0, 0.02, 0.03, 0.05, 0.10, 0.15, 0.20, 0.25, 0.15, 0.05, 0.0]) (defn likelihoods [data models] (map #(data %) models)) (defn posteriors [data models priors] (let [products (map #(* %1 %2) (likelihoods data models) priors) total-probability (reduce + products)] (map #(/ % total-probability) products))) (enable-console-print!) (println) "Hello world!"
(ns bayes-table.core) (def model-ids [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]) (def models (map #(hash-map :b-wins (- 1 %) :a-wins %) model-ids)) (def priors [0.0, 0.02, 0.03, 0.05, 0.10, 0.15, 0.20, 0.25, 0.15, 0.05, 0.0]) (defn likelihoods [data models] (map #(data %) models)) (defn posteriors ([data models priors] (posteriors data models priors likelihoods)) ([data models priors likelihood-fn] (let [products (map #(* %1 %2) (likelihood-fn data models) priors) total-probability (reduce + products)] (map #(/ % total-probability) products)))) (enable-console-print!) (println) "Hello world!"
Add support bezier-vertex to with-shape macro.
(ns cljs.quil.helpers.tools (:require [clojure.string :as string])) (defn bind-handler [prc processing-name handler] `(set! (~processing-name ~prc) (fn [] (~'with-applet ~prc (~@(if (list? handler) handler (list handler))))))) (defmacro bind-handlers [prc & opts] (map #(apply bind-handler (concat (list prc) %)) (partition 2 opts))) (defmacro with-shape [mode & body] `(do (cljs.quil.core/begin-shape ~mode) ~@body (cljs.quil.core/end-shape)))
(ns cljs.quil.helpers.tools (:require [clojure.string :as string])) (defn bind-handler [prc processing-name handler] `(set! (~processing-name ~prc) (fn [] (~'with-applet ~prc (~@(if (list? handler) handler (list handler))))))) (defmacro bind-handlers [prc & opts] (map #(apply bind-handler (concat (list prc) %)) (partition 2 opts))) (defmacro with-shape [mode & body] (if (keyword? mode) `(do (cljs.quil.core/begin-shape ~mode) ~@body (cljs.quil.core/end-shape)) `(do (cljs.quil.core/begin-shape) ~mode ~@body (cljs.quil.core/end-shape))))
Fix load-game-file so it doesn't rely on the classloader
(ns nightmod.public (:require [clojail.core :as jail] [clojure.java.io :as io] [nightmod.screens :as s] [nightmod.utils :as u] [play-clj.core :refer :all])) (defn set-game-screen! [& screens] (->> (conj (vec screens) s/overlay-screen) (apply set-screen! s/nightmod) on-gl)) (defmacro load-game-file [n] (some->> (or (io/resource n) (throw (Throwable. (str "File not found: " n)))) slurp (format "(do %s\n)") jail/safe-read))
(ns nightmod.public (:require [clojail.core :as jail] [clojure.java.io :as io] [nightmod.screens :as s] [nightmod.utils :as u] [play-clj.core :refer :all])) (defn set-game-screen! [& screens] (->> (conj (vec screens) s/overlay-screen) (apply set-screen! s/nightmod) on-gl)) (defmacro load-game-file [n] (some->> (io/file @u/project-dir n) slurp (format "(do %s\n)") jail/safe-read))
Split app into a few basic components
(ns ^:figwheel-always flux-challenge-re-frame.core (:require [reagent.core :as reagent :refer [atom]])) (enable-console-print!) (println "Edits to this text should show up in your developer console.") ;; define your app data so that it doesn't get over-written on reload (defonce app-state (atom {:text "Hello world!"})) (defn hello-world [] [:h1 (:text @app-state)]) #_(reagent/render-component [hello-world] (. js/document (getElementById "app"))) (defn on-js-reload [] ;; optionally touch your app-state to force rerendering depending on ;; your application ;; (swap! app-state update-in [:__figwheel_counter] inc) )
(ns ^:figwheel-always flux-challenge-re-frame.core (:require [reagent.core :as reagent :refer [atom]])) (enable-console-print!) ;; define your app data so that it doesn't get over-written on reload (defonce app-state (atom {:planet "Tatooine" :jedis [{:name "Jorak Uln" :homeworld "Korriban"} {:name "Exar Kun" :homeworld "Coruscant"} {:name "Skere Kaan" :homeworld "Coruscant"} {:name "Na'daz" :homeworld "Ryloth"} {:name "Darth Bane" :homeworld "Apatros"}]})) (defn planet-monitor [planet] [:h1 {:class "css-planet-monitor"} (str "Obi-Wan currently on " planet)]) (defn jedi-slot [jedi] [:li {:class "css-slot"} [:h3 (:name jedi)] [:h6 (str "Homeworld: " (:homeworld jedi))]]) (defn dark-jedi-list [] [:div {:class "css-root"} [planet-monitor (:planet @app-state)] [:section {:class "css-scrollable-list"} [:ul {:class "css-slots"} (for [jedi (:jedis @app-state)] ^{:key (:name jedi)} [jedi-slot jedi])] [:div {:class "css-scroll-buttons"} [:button {:class "css-button-up"}] [:button {:class "css-button-down"}]]]]) (reagent/render-component [dark-jedi-list] (. js/document (getElementById "app"))) (defn on-js-reload [] ;; optionally touch your app-state to force rerendering depending on ;; your application ;; (swap! app-state update-in [:__figwheel_counter] inc) )
Update dependency clj-http:clj-http to v3.11.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.3"] [slingshot "0.12.2"]] :plugins [[lein-cljfmt "0.7.0"]] :main ^:skip-aot strava-activity-graphs.core :target-path "target/%s" :profiles {:uberjar {:aot :all}})
(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.11.0"] [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}})
Bump fetch to get rid of cljs warning
(defproject lighttable "0.1.0" :description "Light Table is a new interactive IDE that lets you modify running programs and embed anything from websites to games. It provides the real time feedback we need to not only answer questions about our code, but to understand how our programs really work." :url "http://www.lighttable.com/" :dependencies [[org.clojure/clojure "1.5.1"] [crate "0.2.5"] [fetch "0.1.1" :exclusions [org.clojure/clojure]] ;[core.async "0.1.0-SNAPSHOT"] [org.clojure/clojurescript "0.0-2138" :exclusions [org.apache.ant/ant]] ] :jvm-opts ["-Xmx1g" "-XX:+UseConcMarkSweepGC"] ; cljsbuild eats memory :cljsbuild {:builds [{:source-paths ["src"] :compiler {:optimizations :simple :externs ["externs/jquery.js" "externs/throttle.js" "externs/codemirror.js"] :source-map "deploy/core/node_modules/lighttable/bootstrap.js.map" :output-to "deploy/core/node_modules/lighttable/bootstrap.js" :output-dir "deploy/core/node_modules/lighttable/cljs/" :pretty-print true}}]} :plugins [[lein-cljsbuild "1.0.1"]] :source-paths ["src/"] )
(defproject lighttable "0.1.0" :description "Light Table is a new interactive IDE that lets you modify running programs and embed anything from websites to games. It provides the real time feedback we need to not only answer questions about our code, but to understand how our programs really work." :url "http://www.lighttable.com/" :dependencies [[org.clojure/clojure "1.5.1"] [crate "0.2.5"] [fetch "0.2.0" :exclusions [org.clojure/clojure noir]] [org.clojure/clojurescript "0.0-2138" :exclusions [org.apache.ant/ant]] ] :jvm-opts ["-Xmx1g" "-XX:+UseConcMarkSweepGC"] ; cljsbuild eats memory :cljsbuild {:builds [{:source-paths ["src"] :compiler {:optimizations :simple :externs ["externs/jquery.js" "externs/throttle.js" "externs/codemirror.js"] :source-map "deploy/core/node_modules/lighttable/bootstrap.js.map" :output-to "deploy/core/node_modules/lighttable/bootstrap.js" :output-dir "deploy/core/node_modules/lighttable/cljs/" :pretty-print true}}]} :plugins [[lein-cljsbuild "1.0.1"]] :source-paths ["src/"] )
Add apache commons io dependency.
(defproject uxbox-backend "0.1.0-SNAPSHOT" :description "UXBox backend." :url "http://uxbox.github.io" :license {:name "MPL 2.0" :url "https://www.mozilla.org/en-US/MPL/2.0/"} :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.18"] [bouncer "1.0.0"] [mount "0.1.10"] [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"] [org.postgresql/postgresql "9.4.1208" :scope "provided"] [niwinz/migrante "0.1.0"] [funcool/suricatta "0.8.1"] [funcool/promesa "0.8.1"] [hikari-cp "1.6.1"] [funcool/catacumba "0.11.3-SNAPSHOT"]])
(defproject uxbox-backend "0.1.0-SNAPSHOT" :description "UXBox backend." :url "http://uxbox.github.io" :license {:name "MPL 2.0" :url "https://www.mozilla.org/en-US/MPL/2.0/"} :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.18"] [bouncer "1.0.0"] [mount "0.1.10"] [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"] [org.postgresql/postgresql "9.4.1208" :scope "provided"] [niwinz/migrante "0.1.0"] [commons-io/commons-io "2.4"] [funcool/suricatta "0.8.1"] [funcool/promesa "0.8.1"] [hikari-cp "1.6.1"] [funcool/catacumba "0.11.3-SNAPSHOT"]])
Use primary domain in link.
(ns clj-templates.components.footer.component) (defn footer [] [:footer [:div.content [:div [:span "By " [:a.dxtr-link {:href "http://www.dxtr.se/" :target "_blank"} "Dexter Gramfors"]]]]])
(ns clj-templates.components.footer.component) (defn footer [] [:footer [:div.content [:div [:span "By " [:a.dxtr-link {:href "https://dxtr.se/" :target "_blank"} "Dexter Gramfors"]]]]])
Update catacumba version on interceptor example.
(defproject interceptor "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://github.com/funcool/catacumba" :license {:name "BSD (2-Clause)" :url "http://opensource.org/licenses/BSD-2-Clause"} :dependencies [[org.clojure/clojure "1.7.0-RC1"] [funcool/catacumba "0.2.0-SNAPSHOT"]] :main ^:skip-aot interceptor.core :target-path "target/%s" :profiles {:uberjar {:aot :all}})
(defproject interceptor "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://github.com/funcool/catacumba" :license {:name "BSD (2-Clause)" :url "http://opensource.org/licenses/BSD-2-Clause"} :dependencies [[org.clojure/clojure "1.7.0-RC1"] [funcool/catacumba "0.2.0"]] :main ^:skip-aot interceptor.core :target-path "target/%s" :profiles {:uberjar {:aot :all}})
Prepare for next release cycle.
(defproject onyx-app/lein-template "0.9.11.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.11.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.12.6.0" :description "Onyx Leiningen application template" :url "https://github.com/onyx-platform/onyx-template" :license {:name "MIT License" :url "http://choosealicense.com/licenses/mit/#"} :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :plugins [[lein-set-version "0.4.1"]] :profiles {:dev {:plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}} :eval-in-leiningen true)
(defproject onyx-app/lein-template "0.12.6.1-SNAPSHOT" :description "Onyx Leiningen application template" :url "https://github.com/onyx-platform/onyx-template" :license {:name "MIT License" :url "http://choosealicense.com/licenses/mit/#"} :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :plugins [[lein-set-version "0.4.1"]] :profiles {:dev {:plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}} :eval-in-leiningen true)
Prepare for next release cycle.
(defproject org.onyxplatform/onyx-datomic "0.7.3-beta9" :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"]}})
Prepare for next release cycle.
(defproject onyx-app/lein-template "0.12.2.2" :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.2.3-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 org.onyxplatform/onyx-datomic "0.7.13" :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.13"]] :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.14-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.13"]] :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"]}})
Change to using a version file and a bump script
(defproject me.arrdem/oxcart "0.1.0-SNAPSHOT" :description "An experimental optimizing compiler for Clojure code" :url "http://github.com/arrdem/oxcart" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [ [org.clojure/clojure "1.5.1"] [org.clojure/tools.analyzer.jvm "0.1.0-SNAPSHOT"] [org.clojure/tools.emitter.jvm "0.0.1-SNAPSHOT"] [org.clojure/tools.reader "0.8.4"] ])
(defproject me.arrdem/oxcart (slurp "VERSION") :description "An experimental optimizing compiler for Clojure code" :url "http://github.com/arrdem/oxcart" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [ [org.clojure/clojure "1.5.1"] [org.clojure/tools.analyzer.jvm "0.1.0-SNAPSHOT"] [org.clojure/tools.emitter.jvm "0.0.1-SNAPSHOT"] [org.clojure/tools.reader "0.8.4"] ])
Change version back to 0.0.0-SNAPSHOT.
(defproject ezglib "0.1.5" :description "Make WebGL games in ClojureScript." :url "https://github.com/bakpakin/ezglib" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :scm {:name "git" :url "https://github.com/bakpakin/ezglib"})
(defproject ezglib "0.0.0-SNAPSHOT" :description "Make WebGL games in ClojureScript." :url "https://github.com/bakpakin/ezglib" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :scm {:name "git" :url "https://github.com/bakpakin/ezglib"})
Set proper version of buddy-core module.
(defproject buddy/buddy-hashers "0.3.0-SNAPSHOT" :description "Security library for Clojure" :url "https://github.com/niwibe/buddy" :license {:name "BSD (2-Clause)" :url "http://opensource.org/licenses/BSD-2-Clause"} :dependencies [[org.clojure/clojure "1.6.0"] [buddy/buddy-core "0.3.0-SNAPSHOT"] [clojurewerkz/scrypt "1.2.0"]] :source-paths ["src/clojure"] :java-source-paths ["src/java"] :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"] :test-paths ["test"] :profiles {:speclj {:dependencies [[speclj "3.1.0"]] :test-paths ["spec"] :plugins [[speclj "3.1.0"]]}})
(defproject buddy/buddy-hashers "0.3.0-SNAPSHOT" :description "Security library for Clojure" :url "https://github.com/niwibe/buddy" :license {:name "BSD (2-Clause)" :url "http://opensource.org/licenses/BSD-2-Clause"} :dependencies [[org.clojure/clojure "1.6.0"] [buddy/buddy-core "0.3.0"] [clojurewerkz/scrypt "1.2.0"]] :source-paths ["src/clojure"] :java-source-paths ["src/java"] :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"] :test-paths ["test"] :profiles {:speclj {:dependencies [[speclj "3.1.0"]] :test-paths ["spec"] :plugins [[speclj "3.1.0"]]}})
Use my 1.3-ready version of difform until an official release is made.
(defproject cake "0.7.0-beta1" :description "Save your fork, there's cake!" :dependencies [[clojure "1.2.0"] [uncle "0.2.3"] [depot "0.1.7"] [classlojure "0.6.3"] [useful "0.7.4-alpha4"] [slingshot "0.7.2"] [org.clojure/tools.namespace "0.1.1" :exclusions [org.clojure/java.classpath]] [org.clojars.ninjudd/java.classpath "0.1.2-SNAPSHOT"] [org.clojars.ninjudd/data.xml "0.0.1-SNAPSHOT"] [com.jcraft/jsch "0.1.42"] [difform "1.1.1"] [org.clojars.rosejn/clansi "1.2.0-SNAPSHOT" :exclusions [org.clojure/clojure]] [clj-stacktrace "0.2.3"]] :copy-deps true)
(defproject cake "0.7.0-beta1" :description "Save your fork, there's cake!" :dependencies [[clojure "1.2.0"] [uncle "0.2.3"] [depot "0.1.7"] [classlojure "0.6.3"] [useful "0.7.4-alpha4"] [slingshot "0.7.2"] [org.clojure/tools.namespace "0.1.1" :exclusions [org.clojure/java.classpath]] [org.clojars.ninjudd/java.classpath "0.1.2-SNAPSHOT"] [org.clojars.ninjudd/data.xml "0.0.1-SNAPSHOT"] [com.jcraft/jsch "0.1.42"] [flatland/difform "1.1.2"] [org.clojars.rosejn/clansi "1.2.0-SNAPSHOT" :exclusions [org.clojure/clojure]] [clj-stacktrace "0.2.3"]] :copy-deps true)
Update Ring dependency to 1.3.2
(defproject compojure "1.2.1" :description "A concise routing library for Ring" :url "https://github.com/weavejester/compojure" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/tools.macro "0.1.5"] [clout "2.0.0"] [medley "0.5.3"] [ring/ring-core "1.3.1"] [ring/ring-codec "1.0.0"]] :plugins [[codox "0.8.10"]] :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.2.1/" :src-linenum-anchor-prefix "L"} :profiles {:dev {:dependencies [[ring-mock "0.1.5"] [javax.servlet/servlet-api "2.5"]]} :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]} :1.7 {:dependencies [[org.clojure/clojure "1.7.0-alpha2"]]}})
(defproject compojure "1.2.1" :description "A concise routing library for Ring" :url "https://github.com/weavejester/compojure" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/tools.macro "0.1.5"] [clout "2.0.0"] [medley "0.5.3"] [ring/ring-core "1.3.2"] [ring/ring-codec "1.0.0"]] :plugins [[codox "0.8.10"]] :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.2.1/" :src-linenum-anchor-prefix "L"} :profiles {:dev {:dependencies [[ring-mock "0.1.5"] [javax.servlet/servlet-api "2.5"]]} :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]} :1.7 {:dependencies [[org.clojure/clojure "1.7.0-alpha2"]]}})
Make Blockly the default editor
(ns webapp.framework.client.init (:require [goog.net.cookies :as cookie] [om.core :as om :include-macros true] [om.dom :as dom :include-macros true] [webapp.framework.client.coreclient :as c :include-macros true] [cljs.core.async :refer [put! chan <! pub timeout]] [clojure.data :as data] [clojure.string :as string] [ankha.core :as ankha]) (:use [myappshare.mainapp :only [main-view]] [webapp.framework.client.system-globals :only [app-state]]) (:require-macros [cljs.core.async.macros :refer [go]])) (c/ns-coils 'webapp.framework.client.init) (defn setup-properties [] { :start-component main-view :setup-fn (fn[] (do (reset! app-state (assoc-in @app-state [:ui] { })) (reset! app-state (assoc-in @app-state [:editor] "text" )) ))}) (def ^:export setup (setup-properties))
(ns webapp.framework.client.init (:require [goog.net.cookies :as cookie] [om.core :as om :include-macros true] [om.dom :as dom :include-macros true] [webapp.framework.client.coreclient :as c :include-macros true] [cljs.core.async :refer [put! chan <! pub timeout]] [clojure.data :as data] [clojure.string :as string] [ankha.core :as ankha]) (:use [myappshare.mainapp :only [main-view]] [webapp.framework.client.system-globals :only [app-state]]) (:require-macros [cljs.core.async.macros :refer [go]])) (c/ns-coils 'webapp.framework.client.init) (defn setup-properties [] { :start-component main-view :setup-fn (fn[] (do (reset! app-state (assoc-in @app-state [:ui] { })) (reset! app-state (assoc-in @app-state [:editor] "blockly" )) ))}) (def ^:export setup (setup-properties))
Update testall alias to match clojure version
(defproject org.flatland/useful "0.10.1" :description "A collection of generally-useful Clojure utility functions" :license {:name "Eclipse Public License - v 1.0" :url "http://www.eclipse.org/legal/epl-v10.html" :distribution :repo} :url "https://github.com/flatland/useful" :dependencies [[org.clojure/clojure "1.5.0"] [org.clojure/tools.macro "0.1.1"] [org.clojure/tools.reader "0.7.2"]] :aliases {"testall" ["with-profile" "dev,default:dev,1.3,default:dev,1.5,default" "test"]} :profiles {:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]} :1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}})
(defproject org.flatland/useful "0.10.1" :description "A collection of generally-useful Clojure utility functions" :license {:name "Eclipse Public License - v 1.0" :url "http://www.eclipse.org/legal/epl-v10.html" :distribution :repo} :url "https://github.com/flatland/useful" :dependencies [[org.clojure/clojure "1.5.0"] [org.clojure/tools.macro "0.1.1"] [org.clojure/tools.reader "0.7.2"]] :aliases {"testall" ["with-profile" "dev,default:dev,1.3,default:dev,1.4,default" "test"]} :profiles {:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]} :1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}})
Revert "added test for ad blocking"
(defproject sparkledriver "0.2.1" :description "A clojure wrapper for jBrowserDriver, which is a Selenium-compatible wrapper around JFX embedded WebKit." :url "https://github.com/jackrusher/sparkledriver" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] [com.machinepublishers/jbrowserdriver "0.17.9"] [org.clojure/math.numeric-tower "0.0.4"]] :profiles {:dev {:dependencies [[org.slf4j/slf4j-simple "1.7.25"] [http-kit "2.3.0-alpha2"] [compojure "1.6.0"] [hiccup "1.0.5"]]} :codox {:dependencies [[codox-theme-rdash "0.1.2"]] :plugins [[lein-codox "0.10.3"]] :codox {:project {:name "sparkledriver"} :metadata {:doc/format :markdown} :themes [:rdash] :output-path "gh-pages"}}} :aliases {"codox" ["with-profile" "codox,dev" "codox"]} :deploy-repositories [["releases" :clojars]])
(defproject sparkledriver "0.2.0" :description "A clojure wrapper for jBrowserDriver, which is a Selenium-compatible wrapper around JFX embedded WebKit." :url "https://github.com/jackrusher/sparkledriver" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] [com.machinepublishers/jbrowserdriver "0.17.9"] [org.clojure/math.numeric-tower "0.0.4"]] :profiles {:dev {:dependencies [[org.slf4j/slf4j-simple "1.7.25"] [http-kit "2.3.0-alpha2"] [compojure "1.6.0"] [hiccup "1.0.5"]]} :codox {:dependencies [[codox-theme-rdash "0.1.2"]] :plugins [[lein-codox "0.10.3"]] :codox {:project {:name "sparkledriver"} :metadata {:doc/format :markdown} :themes [:rdash] :output-path "gh-pages"}}} :aliases {"codox" ["with-profile" "codox,dev" "codox"]} :deploy-repositories [["releases" :clojars]])
Use insert instead of save when adding a user.
(ns cadence.model (:refer-clojure :exclude [identity]) (:require [monger.core :as mg] [monger.collection :as mc] [cadence.model.validators :as is-valid] [noir.validation :as vali] [cemerick.friend :as friend]) (:use clojure.walk [cemerick.friend.credentials :only [hash-bcrypt]])) (defn- ensure-indexes [] (mc/ensure-index "users" {:username 1} {:unique 1 :dropDups 1})) (defn connect [connection-info] (if (:uri connection-info) (mg/connect-via-uri! (:uri connection-info)) (mg/connect!)) (let [db-name (:db-name connection-info)] (mg/authenticate db-name (:username connection-info) (into-array Character/TYPE (:password connection-info))) (mg/set-db! (mg/get-db db-name)) (ensure-indexes))) (defn get-user [username] (mc/find-one-as-map "users" {:username username})) (defn add-user [user] (mc/save "users" (assoc (select-keys user (for [[k v] user :when (vali/has-value? v)] k)) :password (hash-bcrypt (:password user))))) (def identity #(get friend/*identity* :current)) (defn get-phrase [] "completing this phrase is fun")
(ns cadence.model (:refer-clojure :exclude [identity]) (:require [monger.core :as mg] [monger.collection :as mc] [cadence.model.validators :as is-valid] [noir.validation :as vali] [cemerick.friend :as friend]) (:use clojure.walk [cemerick.friend.credentials :only [hash-bcrypt]])) (defn- ensure-indexes [] (mc/ensure-index "users" {:username 1} {:unique 1 :dropDups 1})) (defn connect [connection-info] (if (:uri connection-info) (mg/connect-via-uri! (:uri connection-info)) (mg/connect!)) (let [db-name (:db-name connection-info)] (mg/authenticate db-name (:username connection-info) (into-array Character/TYPE (:password connection-info))) (mg/set-db! (mg/get-db db-name)) (ensure-indexes))) (defn get-user [username] (mc/find-one-as-map "users" {:username username})) (defn add-user [user] (mc/insert "users" (assoc (select-keys user (for [[k v] user :when (vali/has-value? v)] k)) :password (hash-bcrypt (:password user))))) (def identity #(get friend/*identity* :current)) (defn get-phrase [] "completing this phrase is fun")
Remove get-possibly-unbound-var; just use bound?
(ns lazytest.testable) (defprotocol Testable (get-tests [this] "Returns a seq of RunnableTest objects. Processes the :focus metadata flag. Default implementation recurses on all Vars in a namespace, unless that namespace has :get-tests metadata.")) (defn focused? "True if x has :focus metadata set to true." [x] (boolean (:focused (meta x)))) (defn filter-focused "If any items in sequence s are focused, return them; else return s." [s] (or (seq (filter focused? s)) s)) (defn- get-possibly-unbound-var [v] (when (bound? v) (var-get v))) (extend-protocol Testable clojure.lang.Namespace (get-tests [this-ns] (if-let [f (:get-tests (meta this-ns))] (do (assert (fn? f)) (f)) (filter-focused (mapcat get-tests (vals (ns-interns this-ns)))))) clojure.lang.Var (get-tests [this-var] (let [value (get-possibly-unbound-var this-var)] (when (extends? Testable (type value)) (filter-focused (get-tests value))))) java.util.Collection (get-tests [coll] (filter-focused (mapcat get-tests coll))))
(ns lazytest.testable) (defprotocol Testable (get-tests [this] "Returns a seq of RunnableTest objects. Processes the :focus metadata flag. Default implementation recurses on all Vars in a namespace, unless that namespace has :get-tests metadata.")) (defn focused? "True if x has :focus metadata set to true." [x] (boolean (:focused (meta x)))) (defn filter-focused "If any items in sequence s are focused, return them; else return s." [s] (or (seq (filter focused? s)) s)) (extend-protocol Testable clojure.lang.Namespace (get-tests [this-ns] (if-let [f (:get-tests (meta this-ns))] (do (assert (fn? f)) (f)) (filter-focused (mapcat get-tests (vals (ns-interns this-ns)))))) clojure.lang.Var (get-tests [this-var] (when (bound? this-var) (let [value (var-get this-var)] (when (extends? Testable (type value)) (filter-focused (get-tests value)))))) java.util.Collection (get-tests [coll] (filter-focused (mapcat get-tests coll))))
Add delay between tests so frame can be cleaned up before new test starts.
(ns quil.snippet (:require [quil.core :as q] [quil.util :refer [no-fn]] [clojure.test :refer [is]])) (def default-size [500 500]) (defmacro snippet-as-test [name opts & draw-fn-body] `(let [result# (promise)] (q/sketch :title (str '~name) :size default-size :renderer ~(:renderer opts :java2d) :setup (fn [] ~(:setup opts) (q/frame-rate 5)) :draw (fn [] (try ~@draw-fn-body (catch Exception e# (println "Error" e#) (.printStackTrace e#) (deliver result# e#)) (finally (delay 100) (q/exit)))) :on-close #(deliver result# nil)) (is (nil? @result#)))) (defmacro defsnippet [name opts & body] `(def ~(vary-meta name assoc :test `(fn [] (snippet-as-test ~name ~opts ~@body))) (fn [] (q/sketch :title (str '~name) :size ~default-size :setup (fn [] (q/frame-rate 5) ~(:setup opts)) :renderer ~(:renderer opts :java2d) :draw (fn [] ~@body)))))
(ns quil.snippet (:require [quil.core :as q] [quil.util :refer [no-fn]] [clojure.test :refer [is]])) (def default-size [500 500]) (defmacro snippet-as-test [name opts & draw-fn-body] `(let [result# (promise)] (Thread/sleep 100) (q/sketch :title (str '~name) :size default-size :renderer ~(:renderer opts :java2d) :setup (fn [] ~(:setup opts) (q/frame-rate 5)) :draw (fn [] (try ~@draw-fn-body (catch Exception e# (println "Error" e#) (.printStackTrace e#) (deliver result# e#)) (finally (q/exit)))) :on-close #(deliver result# nil)) (is (nil? @result#)))) (defmacro defsnippet [name opts & body] `(def ~(vary-meta name assoc :test `(fn [] (snippet-as-test ~name ~opts ~@body))) (fn [] (q/sketch :title (str '~name) :size ~default-size :setup (fn [] (q/frame-rate 5) ~(:setup opts)) :renderer ~(:renderer opts :java2d) :draw (fn [] ~@body)))))
Include match tests in runner.
(ns active.clojure.test-runner (:require [doo.runner :refer-macros [doo-tests]] [active.clojure.condition-test] [active.clojure.debug-test] [active.clojure.lens-test] [active.clojure.monad-test] [active.clojure.record-test] [active.clojure.config-test])) (doo-tests 'active.clojure.condition-test 'active.clojure.debug-test 'active.clojure.lens-test 'active.clojure.monad-test 'active.clojure.record-test 'active.clojure.config-test)
(ns active.clojure.test-runner (:require [doo.runner :refer-macros [doo-tests]] [active.clojure.condition-test] [active.clojure.debug-test] [active.clojure.lens-test] [active.clojure.monad-test] [active.clojure.record-test] [active.clojure.match-test] [active.clojure.config-test])) (doo-tests 'active.clojure.condition-test 'active.clojure.debug-test 'active.clojure.lens-test 'active.clojure.monad-test 'active.clojure.record-test 'active.clojure.match-test 'active.clojure.config-test)
Test list command shows error when there are not any classes loaded
(ns app.test.interactive (:use [app.interactive] [conjure.core] [clojure.test])) (deftest can-quit (let [input-command "quit\r"] (with-in-str input-command (interactive []))))
(ns app.test.interactive (:use [app.interactive] [conjure.core] [clojure.test])) (deftest can-quit (let [input-command "quit\r"] (with-in-str input-command (interactive [])))) (deftest list-shows-error-if-no-classes-loaded (let [command-sequence ["list" "quit"] input-string (clojure.string/join "\r" command-sequence)] (with-in-str input-string (mocking [println print flush] (interactive []) (verify-call-times-for println 2) (verify-first-call-args-for println "No classes loaded. Use <load> first")))))
Use node REPL instead of Nashorn
(require '[cljs.repl :as repl] '[cljs.repl.nashorn :as nashorn]) (cljs.repl/repl (cljs.repl.nashorn/repl-env) :output-dir "out" :cache-analysis true)
(require '[cljs.repl :as repl] '[cljs.repl.node :as node]) (cljs.repl/repl (node/repl-env) :output-dir "out" :cache-analysis true)
Add dev alias for vault.blob.core as blob.
(ns user (:require [clojure.java.io :as io] [clojure.string :as str]))
(ns user (:require [clojure.java.io :as io] [clojure.string :as str] (puget data [printer :as puget]) [vault.blob.core :as blob]))
Add a map? which considers java.util.Map, for keywordize-keys
(ns runbld.util.data) ;; http://dev.clojure.org/jira/browse/CLJ-1468 (defn deep-merge "Like merge, but merges maps recursively." {:added "1.7"} [& maps] (if (every? map? maps) (apply merge-with deep-merge maps) (last maps))) (defn deep-merge-with "Like merge-with, but merges maps recursively, applying the given fn only when there's a non-map at a particular level." {:added "1.7"} [f & maps] (apply (fn m [& maps] (if (every? map? maps) (apply merge-with m maps) (apply f maps))) maps))
(ns runbld.util.data (:refer-clojure :exclude [map?]) (:require [clojure.walk :refer [postwalk]])) (defn map? [x] (or (instance? clojure.lang.IPersistentMap x) (instance? java.util.Map x))) ;; http://dev.clojure.org/jira/browse/CLJ-1468 (defn deep-merge "Like merge, but merges maps recursively." {:added "1.7"} [& maps] (if (every? map? maps) (apply merge-with deep-merge maps) (last maps))) (defn deep-merge-with "Like merge-with, but merges maps recursively, applying the given fn only when there's a non-map at a particular level." {:added "1.7"} [f & maps] (apply (fn m [& maps] (if (every? map? maps) (apply merge-with m maps) (apply f maps))) maps)) (defn keywordize-keys "clojure.walk/keywordize-keys breaks when a map is actually a j.u.LinkedHashMap, which is what happens with interop, in our case Yaml#load()" [m] (with-redefs [clojure.core/map? map?] (clojure.walk/keywordize-keys m)))
Use correct namespace... confused about this one
(ns io.perun.gravatar (:require [io.perun.core :as perun] [gravatar :as gr])) (defn add-gravatar [file source-prop target-prop] (if-let [email (get file source-prop)] (assoc file target-prop (gr/avatar-url email)) file)) (defn find-gravatar [files source-prop target-prop] (let [updated-files (map #(add-gravatar % source-prop target-prop) files)] (perun/report-info "gravatar" "added gravatar to %s files" (count updated-files)) updated-files))
(ns io.perun.gravatar (:require [io.perun.core :as perun] [gravatar.core :as gr])) (defn add-gravatar [file source-prop target-prop] (if-let [email (get file source-prop)] (assoc file target-prop (gr/avatar-url email)) file)) (defn find-gravatar [files source-prop target-prop] (let [updated-files (map #(add-gravatar % source-prop target-prop) files)] (perun/report-info "gravatar" "added gravatar to %s files" (count updated-files)) updated-files))
Use the namespaced keys being returned by the API now
(ns comic-reader.ui.site-list (:refer-clojure :exclude [get set]) (:require [re-frame.core :as re-frame] [comic-reader.ui.base :as base])) (defn get* [db] (clojure.core/get db :site-list)) (defn set* [db sites] (assoc db :site-list sites)) (defn setup! [] (re-frame/reg-sub :site-list (fn [app-db _] (get* app-db))) (re-frame/reg-event-db :set-site-list (fn [db [_ sites]] (set* db sites)))) (defn get [] (re-frame/subscribe [:site-list])) (defn set [sites] (re-frame/dispatch [:set-site-list sites])) (defn site-list [view-site sites] (base/list-with-loading {:heading "Comic Sites" :list-element [:ul.inline-list] :item->li (fn [site] [:a.large.button.radius {:on-click #(view-site (:id site))} (:name site)])} sites)) (defn site-list-container [] (let [sites (re-frame/subscribe [:site-list])] (fn [] [site-list (fn [site-id] (re-frame/dispatch [:view-comics site-id])) (deref sites)])))
(ns comic-reader.ui.site-list (:refer-clojure :exclude [get set]) (:require [re-frame.core :as re-frame] [comic-reader.ui.base :as base])) (defn get* [db] (clojure.core/get db :site-list)) (defn set* [db sites] (assoc db :site-list sites)) (defn setup! [] (re-frame/reg-sub :site-list (fn [app-db _] (get* app-db))) (re-frame/reg-event-db :set-site-list (fn [db [_ sites]] (set* db sites)))) (defn get [] (re-frame/subscribe [:site-list])) (defn set [sites] (re-frame/dispatch [:set-site-list sites])) (defn site-list [view-site sites] (base/list-with-loading {:heading "Comic Sites" :list-element [:ul.inline-list] :item->li (fn [site] [:a.large.button.radius {:on-click #(view-site (:site/id site))} (:site/name site)])} sites)) (defn site-list-container [] (let [sites (re-frame/subscribe [:site-list])] (fn [] [site-list (fn [site-id] (re-frame/dispatch [:view-comics site-id])) (deref sites)])))
Add some comments for fun
(ns ember-cljs.core (:require [clojure.string :as string] [jquery] [ember])) (def Ember js/Ember) (def HomeRoute (.extend (.-Route Ember) #js {:model (fn [] "Dynamic Data")})) (def SmallComponentComponent (.extend (.-Component Ember) #js {:dynamicAttribute "foo" :thing "123" :actions #js {:myAction (fn [] (this-as this (.set this "dynamicAttribute" "abc")))}})) (let [application (.create (.-Application Ember)) router (.-Router application)] (set! (.-HomeRoute application) HomeRoute) (set! (.-SmallComponentComponent application) SmallComponentComponent) (.map router (fn [] (this-as r (.route r "home" #js {:path "/"}) (.route r "foo" #js {:path "/foo"})))))
(ns ember-cljs.core (:require [clojure.string :as string] [jquery] [ember])) ;; set Ember as a variable so I don't have to ;; type 'js/Ember' all the time. (def Ember js/Ember) (def HomeRoute (.extend (.-Route Ember) #js {:model (fn [] "Dynamic Data")})) (def SmallComponentComponent (.extend (.-Component Ember) #js {:dynamicAttribute "foo" :thing "123" :actions #js {:myAction (fn [] (this-as this (.set this "dynamicAttribute" "abc")))}})) (let [application (.create (.-Application Ember)) router (.-Router application)] ;; Attach route and component to the application (set! (.-HomeRoute application) HomeRoute) (set! (.-SmallComponentComponent application) SmallComponentComponent) ;; Set up the router (.map router (fn [] (this-as r (.route r "home" #js {:path "/"}) (.route r "foo" #js {:path "/foo"})))))
Change CCScrapeTripReport to a deftype instead of defrecord.
(ns scrape-trs.cascade-climbers.core (:require [scrape-trs.cascade-climbers [extract-pager-urls :refer [extract-all-pager-urls]] [extract-tr-urls :refer [extract-tr-urls]] [extract-trip-report :refer [extract-trip-report]]]) (:import scrape_trs.protocol.ScrapeTripReport)) (def base-url "http://cascadeclimbers.com/") (defrecord CCScrapeTripReport [] ScrapeTripReport (extract-pager-urls [this list-page] (extract-all-pager-urls list-page)) (extract-trip-report-urls [this list-page] (extract-tr-urls base-url list-page)) (extract-trip-report [this trip-report-url trip-report-page] (extract-trip-report trip-report-url trip-report-page)))
(ns scrape-trs.cascade-climbers.core (:require [scrape-trs.cascade-climbers [extract-pager-urls :refer [extract-all-pager-urls]] [extract-tr-urls :refer [extract-tr-urls]] [extract-trip-report :refer [extract-trip-report]]]) (:import scrape_trs.protocol.ScrapeTripReport)) (def base-url "http://cascadeclimbers.com/") (deftype CCScrapeTripReport [] ScrapeTripReport (extract-pager-urls [this list-page] (extract-all-pager-urls list-page)) (extract-trip-report-urls [this list-page] (extract-tr-urls base-url list-page)) (extract-trip-report [this trip-report-url trip-report-page] (extract-trip-report trip-report-url trip-report-page)))
Disable button while typing and doing remote validations
(ns braid.client.gateway.subs (:require [re-frame.core :refer [reg-sub]] [braid.client.gateway.user-auth.subs] [braid.client.gateway.create-group.subs])) (reg-sub :gateway/field-value (fn [state [_ field]] (get-in state [:fields field :value]))) (reg-sub :gateway/field-errors (fn [state [_ field]] (get-in state [:fields field :errors]))) (reg-sub :gateway/field-status (fn [state [_ field]] (cond (get-in state [:fields field :typing?]) :typing (get-in state [:fields field :untouched?]) :untouched (not (empty? (get-in state [:fields field :errors]))) :invalid (< 0 (get-in state [:fields field :validations-left])) :loading :else :valid))) (reg-sub :gateway/fields-valid? (fn [state [_ fields]] (->> fields (map (fn [field] (empty? (get-in state [:fields field :errors])))) (every? true?)))) (reg-sub :gateway/action-mode (fn [state _] (get-in state [:action :mode])))
(ns braid.client.gateway.subs (:require [re-frame.core :refer [reg-sub]] [braid.client.gateway.user-auth.subs] [braid.client.gateway.create-group.subs])) (reg-sub :gateway/field-value (fn [state [_ field]] (get-in state [:fields field :value]))) (reg-sub :gateway/field-errors (fn [state [_ field]] (get-in state [:fields field :errors]))) (reg-sub :gateway/field-status (fn [state [_ field]] (cond (get-in state [:fields field :typing?]) :typing (get-in state [:fields field :untouched?]) :untouched (not (empty? (get-in state [:fields field :errors]))) :invalid (< 0 (get-in state [:fields field :validations-left])) :loading :else :valid))) (reg-sub :gateway/fields-valid? (fn [state [_ fields]] (->> fields (map (fn [field] (and (empty? (get-in state [:fields field :errors])) (= 0 (get-in state [:fields field :validations-left])) (not (get-in state [:fields field :typing?]))))) (every? true?)))) (reg-sub :gateway/action-mode (fn [state _] (get-in state [:action :mode])))
Add the first entry iterator.
(ns lab-notebook.core (:require [om.core :as om] [om.dom :as dom])) (defonce appstate (atom {})) (defn app-container [cursor component] (reify om/IRender (render [this] (apply dom/div nil (dom/h1 nil "Lab notebook") nil (for [x (range 10)] (str x " ")))))) (om/root app-container appstate {:target (. js/document (getElementById "app"))})
(ns lab-notebook.core (:require [om.core :as om] [om.dom :as dom])) (defonce appstate (atom {})) (defn app-container [cursor component] (reify om/IRender (render [this] (apply dom/div nil (dom/h1 nil "Lab notebook") nil (for [entry (:entries cursor)] (dom/div nil (dom/div nil (:summary entry)) (dom/div nil (:date-time entry)) (dom/div nil (:notes entry)))))))) (om/root app-container appstate {:target (. js/document (getElementById "app"))})
Add the license and some more docs
(ns oxcart.pattern) (defn def? "λ AST -> Boolean Indicates whether the top level form of the argument AST is a def form." [ast] (-> ast :op (= :def))) (defn def->symbol "λ AST -> (Option Symbol) If the argument form was a def, returns the defined symbol. Otherwise the return value is garbage." [ast] (when (def? ast) (:name ast)))
;; Copyright (c) Reid McKenzie, Rich Hickey & contributors. The use ;; and distribution terms for this software are covered by the ;; Eclipse Public License 1.0 ;; (http://opensource.org/licenses/eclipse-1.0.php) which can be ;; found in the file epl-v10.html at the root of this distribution. ;; By using this software in any fashion, you are agreeing to be ;; bound by the terms of this license. You must not remove this ;; notice, or any other, from this software. (ns oxcart.pattern {:doc "Implements a number of pattern matching predicates and utility functions over the clojure.tools.analyzer.jvm AST structure." :added "0.0.1" :author "Reid McKenzie"}) ;; TODO: ;; Depending on benchmarking and API changes it may make sense to ;; make core.match a dependency of this project rather than hard ;; coding datastructure dependant paths and equality checks. (defn def? "λ AST -> Boolean Indicates whether the top level form of the argument AST is a def form." [ast] (-> ast :op (= :def))) (defn def->symbol "λ AST -> (Option Symbol) If the argument form was a def, returns the defined symbol. Otherwise the return value is garbage." [ast] (when (def? ast) (:name ast)))
Fix up indentation in kairosdb test
(ns riemann.kairosdb-test (:use riemann.kairosdb [riemann.time :only [unix-time]] clojure.test) (:require [riemann.logging :as logging])) (logging/init) (deftest ^:kairosdb ^:integration kairosdb-test (let [k (kairosdb {:block-start true})] (k {:host "riemann.local" :service "kairosdb test" :state "ok" :description "all clear, uh, situation normal" :metric -2 :time (unix-time)})) (let [k (kairosdb {:block-start true})] (k {:service "kairosdb test" :state "ok" :description "all clear, uh, situation normal" :metric 3.14159 :time (unix-time)})) (let [k (kairosdb {:block-start true})] (k {:host "no-service.riemann.local" :state "ok" :description "Missing service, not transmitted" :metric 4 :time (unix-time)})))
(ns riemann.kairosdb-test (:use riemann.kairosdb [riemann.time :only [unix-time]] clojure.test) (:require [riemann.logging :as logging])) (logging/init) (deftest ^:kairosdb ^:integration kairosdb-test (let [k (kairosdb {:block-start true})] (k {:host "riemann.local" :service "kairosdb test" :state "ok" :description "all clear, uh, situation normal" :metric -2 :time (unix-time)})) (let [k (kairosdb {:block-start true})] (k {:service "kairosdb test" :state "ok" :description "all clear, uh, situation normal" :metric 3.14159 :time (unix-time)})) (let [k (kairosdb {:block-start true})] (k {:host "no-service.riemann.local" :state "ok" :description "Missing service, not transmitted" :metric 4 :time (unix-time)})))
Update to released version of Clojure
(defproject replete "0.1.0" :dependencies [[org.clojure/clojure "1.7.0-RC2"] [org.clojure/clojurescript "0.0-3422"] [org.clojure/tools.reader "0.10.0-SNAPSHOT" :exclusions [org.clojure/clojure]]])
(defproject replete "0.1.0" :dependencies [[org.clojure/clojure "1.7.0"] [org.clojure/clojurescript "0.0-3422"] [org.clojure/tools.reader "0.10.0-SNAPSHOT" :exclusions [org.clojure/clojure]]])
Rename variable to z for consistency.
(ns analyze-data.naive-bayes.predict (:require [clojure.core.matrix :as m] [analyze-data.greatest :refer [greatest]])) (defn predict "parameters: map produced by analyze-data.naive-bayes.train/train x: vector of term weights representing a document Return a vector of [most-likely-label score]" [parameters x] (let [{:keys [log-phi log-phi-y]} parameters log-probs (->> (m/mul log-phi x) (map m/esum) (m/add log-phi-y)) indexed-log-probs (map-indexed #(vector %1 %2) log-probs)] (reduce greatest indexed-log-probs)))
(ns analyze-data.naive-bayes.predict (:require [clojure.core.matrix :as m] [analyze-data.greatest :refer [greatest]])) (defn predict "parameters: map produced by analyze-data.naive-bayes.train/train z: vector of term weights representing a document Return a vector of [most-likely-label score]" [parameters z] (let [{:keys [log-phi log-phi-y]} parameters log-probs (->> (m/mul log-phi z) (map m/esum) (m/add log-phi-y)) indexed-log-probs (map-indexed #(vector %1 %2) log-probs)] (reduce greatest indexed-log-probs)))
Make the filter-fn the first arg to be consistent with filter
(ns play-clj.repl (:require [play-clj.core :refer :all])) (defn s "Returns the screen map in `screen-object`. (s main-screen)" [screen-object] (-> screen-object :screen deref)) (defn s! "Associates values to the screen map in `screen-object`. Returns the new screen map. (s! main-screen :camera (orthographic))" [screen-object & args] (apply swap! (:screen screen-object) assoc args)) (defn e "Returns the entities in `screen-object`, optionally filtered by a supplied function. (e main-screen :player?)" ([screen-object] (-> screen-object :entities deref)) ([screen-object filter-fn] (vec (filter filter-fn (e screen-object))))) (defn e! "Resets the entities in `screen-object`, or associates values to the entities in `screen-object` that match the supplied function. Returns the entities that were changed. (e! main-screen []) (e! main-screen :player? :health 10)" ([screen-object new-entities] (reset! (:entities screen-object) new-entities)) ([screen-object filter-fn & args] (swap! (:entities screen-object) (fn [entities] (vec (for [e entities] (if (filter-fn e) (apply assoc e args) e))))) (e screen-object filter-fn)))
(ns play-clj.repl (:require [play-clj.core :refer :all])) (defn s "Returns the screen map in `screen-object`. (s main-screen)" [screen-object] (-> screen-object :screen deref)) (defn s! "Associates values to the screen map in `screen-object`. Returns the new screen map. (s! main-screen :camera (orthographic))" [screen-object & args] (apply swap! (:screen screen-object) assoc args)) (defn e "Returns the entities in `screen-object`, optionally filtered by a supplied function. (e :player? main-screen) (e texture? main-screen)" ([screen-object] (-> screen-object :entities deref)) ([filter-fn screen-object] (vec (filter filter-fn (e screen-object))))) (defn e! "Associates values to the entities in `screen-object` that match the supplied function. Returns the entities that were changed. (e! :player? main-screen :health 10)" [filter-fn screen-object & args] (swap! (:entities screen-object) (fn [entities] (vec (for [e entities] (if (filter-fn e) (apply assoc e args) e))))) (e filter-fn screen-object))
Fix and annotate cli tests
(ns mirthsync.cli-test (:require [mirthsync.cli :refer :all] [clojure.test :refer :all] [clojure.tools [cli :refer [parse-opts]]])) (deftest configuration (are [args] (let [conf (config args)] (is (seq (:exit-msg conf))) (is (= 1 (:exit-code conf)))) ["blah"] ["-z"] [""] ["-f"] nil) (is (= 3 (:verbosity (config ["-vvv" "push"])))) (let [conf {:errors nil, :exit-code 0, :verbosity 0, :password "", :arguments ["push"], :server "https://localhost:8443/api", :username "admin", :action "push", :target ".", :exit-msg nil}] (is (= conf (config ["push"])))) (let [conf {:errors nil, :exit-code 0, :force true, :verbosity 0, :password "", :arguments ["pull"], :server "https://localhost:8443/api", :username "admin", :action "pull", :target ".", :exit-msg nil}] (is (= conf (config ["-f" "pull"])))) (is (nil? (:force (config ["pull"])))))
(ns mirthsync.cli-test (:require [mirthsync.cli :refer :all] [clojure.test :refer :all] [clojure.tools [cli :refer [parse-opts]]])) (deftest configuration (testing "Fail on invalid arguments" (are [args] (let [conf (config args)] (is (seq (:exit-msg conf))) (is (= 1 (:exit-code conf)))) ["blah"] ["-z"] [""] ["-f"] nil)) (testing "Verbosity increases with extra v's" (is (= 3 (:verbosity (config ["-vvv" "push"]))))) (testing "Sensible push defaults" (let [conf {:errors nil, :exit-code 0, :verbosity 0, :password "", :server "https://localhost:8443/api", :username "admin", :action "push", :target ".", :exit-msg nil}] (is (= conf (config ["push"]))))) (testing "Sensible pull defaults" (let [conf {:errors nil, :exit-code 0, :force true, :verbosity 0, :password "", :server "https://localhost:8443/api", :username "admin", :action "pull", :target ".", :exit-msg nil}] (is (= conf (config ["-f" "pull"]))))) (testing "Force defaults to nil" (is (nil? (:force (config ["pull"]))))))
Add compilation support for dtbs using 'make dtbs'
zreladdr-y += 0x00008000 params_phys-y := 0x00000100 initrd_phys-y := 0x00800000
zreladdr-y += 0x00008000 params_phys-y := 0x00000100 initrd_phys-y := 0x00800000 dtb-$(CONFIG_BOARD_SPEAR600_DT) += spear600-evb.dtb
Remove www. from urls when filtering
(ns tabswitcher.utils) (defn format-result [url] (clojure.string/replace url #"(^https?://)|(\?.+)" ""))
(ns tabswitcher.utils) (defn format-result [url] (clojure.string/replace url #"(^https?://(www\.)?)|(\?.+)" ""))
Test with lists instead of vectors
(ns magician.list-test (:require [clojure.test :refer :all] [magician.list :refer :all])) (deftest numerics-test (is (= [1 2.0 -3] (numerics [1 2.0 -3]))) (is (= [] (numerics ["string"]))) (is (= [] (numerics []))) (is (= [1 3] (numerics [1, "two", 3, "four"]))))
(ns magician.list-test (:require [clojure.test :refer :all] [magician.list :refer :all])) (deftest numerics-test (is (= '(1 2.0 -3) (numerics '(1 2.0 -3)))) (is (= () (numerics '("string")))) (is (= () (numerics ()))) (is (= '(1 3) (numerics '(1 "two" 3 "four")))))
Disable pretty printing on benchmark build.
(require '[cljs.build.api :as b]) (b/watch (b/inputs "test" "src") {:main 'bide.tests.benchmarks :target :nodejs :output-to "out/benchmarks.js" :output-dir "out/benchmarks" :optimizations :none :pretty-print true :verbose true})
(require '[cljs.build.api :as b]) (b/watch (b/inputs "test" "src") {:main 'bide.tests.benchmarks :target :nodejs :output-to "out/benchmarks.js" :output-dir "out/benchmarks" :optimizations :none :pretty-print false :verbose true})
Save all the maps attached to a wallet as well.
(ns asid.wallet-repository (:require [clojurewerkz.neocons.rest :as nr] [clojurewerkz.neocons.rest.nodes :as nn] [clojurewerkz.neocons.rest.relationships :as nrl])) (defn initialize! [] (nr/connect! "http://localhost:7474/db/data/") (let [root (nn/get 0) asid-rels (nrl/outgoing-for root :types [:asid])] (if (seq asid-rels) {:root (-> asid-rels first :end nn/fetch-from)} (let [asid-root (nn/create {:name "asid root"})] (nrl/create root asid-root :asid) {:root asid-root})))) (defn save [ctxt wallet] (let [node (nn/create {:identity (:identity wallet)})] (nrl/create (:root ctxt) node :wallet) wallet))
(ns asid.wallet-repository (:require [clojurewerkz.neocons.rest :as nr] [clojurewerkz.neocons.rest.nodes :as nn] [clojurewerkz.neocons.rest.relationships :as nrl])) (defn initialize! [] (nr/connect! "http://localhost:7474/db/data/") (let [root (nn/get 0) asid-rels (nrl/outgoing-for root :types [:asid])] (if (seq asid-rels) {:root (-> asid-rels first :end nn/fetch-from)} (let [asid-root (nn/create {:name "asid root"})] (nrl/create root asid-root :asid) {:root asid-root})))) (defn attach-to-node [node link data] (let [data-node (nn/create data)] (nrl/create node data-node link))) (defn save [ctxt wallet] (let [node (nn/create {:identity (:identity wallet)})] (doseq [data [:bag :signatures :key]] (attach-to-node node data (get wallet data))) (nrl/create (:root ctxt) node :wallet) wallet))
Modify roles migration to make me an admin.
(ns cadence.migrations "Define some migrations yo." (:require [cadence.model.migration :refer [defmigration]] (monger [collection :as mc] [operators :refer :all])) (:import (org.bson.types ObjectId))) (defn str-id "Helper function for generating an id when adding migrations." [] (str (ObjectId.))) ;; ## Define some migrations. (defmigration "Add roles to users" "5108749844ae8febda9c2ed4" (mc/update "users" {} {$set {:roles [:user]}} :multi true) (mc/update "users" {} {$unset {:roles ""}} :multi true))
(ns cadence.migrations "Define some migrations yo." (:require [cadence.model.migration :refer [defmigration]] (monger [collection :as mc] [operators :refer :all])) (:import (org.bson.types ObjectId))) (defn- str-id "Helper function for generating an id when adding migrations." [] (str (ObjectId.))) ;; ## Define some migrations. (defmigration "Add roles to users" "5108749844ae8febda9c2ed4" (do (mc/update "users" {} {$set {:roles [:user]}} :multi true) (mc/update "users" {:username "RyanMcG"} {$push {:roles :admin}})) (mc/update "users" {} {$unset {:roles ""}} :multi true))
Change expected implementation file name for consistency
(ns word-count.test (:require [clojure.test :refer :all])) (load-file "word_count.clj") (deftest count-one-word (is (= {"word" 1} (phrase/word-count "word")))) (deftest count-one-of-each (is (= {"one" 1 "of" 1 "each" 1} (phrase/word-count "one of each")))) (deftest count-multiple-occurrences (is (= {"one" 1 "fish" 4 "two" 1 "red" 1 "blue" 1} (phrase/word-count "one fish two fish red fish blue fish")))) (deftest ignore-punctuation (is (= {"car" 1, "carpet" 1 "as" 1 "java" 1 "javascript" 1} (phrase/word-count "car : carpet as java : javascript!!&@$%^&")))) (deftest include-numbers (is (= {"testing" 2 "1" 1 "2" 1} (phrase/word-count "testing, 1, 2 testing")))) (deftest normalize-case (is (= {"go" 3} (phrase/word-count "go Go GO")))) (run-tests)
(ns word-count.test (:require [clojure.test :refer :all])) (load-file "word-count.clj") (deftest count-one-word (is (= {"word" 1} (phrase/word-count "word")))) (deftest count-one-of-each (is (= {"one" 1 "of" 1 "each" 1} (phrase/word-count "one of each")))) (deftest count-multiple-occurrences (is (= {"one" 1 "fish" 4 "two" 1 "red" 1 "blue" 1} (phrase/word-count "one fish two fish red fish blue fish")))) (deftest ignore-punctuation (is (= {"car" 1, "carpet" 1 "as" 1 "java" 1 "javascript" 1} (phrase/word-count "car : carpet as java : javascript!!&@$%^&")))) (deftest include-numbers (is (= {"testing" 2 "1" 1 "2" 1} (phrase/word-count "testing, 1, 2 testing")))) (deftest normalize-case (is (= {"go" 3} (phrase/word-count "go Go GO")))) (run-tests)
Add basic tests for success futures
(ns beehive.future-test)
;; Copyright 2015 Timothy Brooks ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. ;; You may obtain a copy of the License at ;; ;; http://www.apache.org/licenses/LICENSE-2.0 ;; ;; Unless required by applicable law or agreed to in writing, software ;; distributed under the License is distributed on an "AS IS" BASIS, ;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ;; See the License for the specific language governing permissions and ;; limitations under the License. (ns beehive.future-test (:require [clojure.test :refer :all] [beehive.future :as f]) (:import (net.uncontended.precipice.concurrent Eventual))) (defn remove-false [f & ks] (filter (fn [func] (func f)) ks)) (deftest future-status (testing "Test that statuses work correctly." (let [eventual (Eventual.) future (f/->BeehiveFuture eventual)] (is (= :pending (:status future))) (is (:pending? future)) (.complete eventual 4) (is (= :success (:status future))) (is (:success? future)) (is (= [] (remove-false future :pending?))))))
Use more reasonable memory settings
(defproject kevin "0.1.0-SNAPSHOT" :description "It's like Kevin Bacon is right here!" :url "http://imdb.com" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.5.1"] [com.datomic/datomic-pro "0.9.4556"] [hiccup "1.0.5"] [environ "0.4.0"] [ring-server "0.3.1"] [compojure "1.1.6"]] :plugins [[lein-ring "0.8.10"] [lein-beanstalk "0.2.7"]] :aws {:access-key ~(System/getenv "AWS_ACCESS_KEY_ID") :secret-key ~(System/getenv "AWS_SECRET_KEY") } :ring {:handler kevin.system/handler :init kevin.system/init :destroy kevin.system/destroy } :profiles {:production {:ring {:open-browser? false :stacktraces? false :auto-reload? false}} :dev {:source-paths ["dev"] :dependencies [[org.clojure/tools.namespace "0.2.4"] [org.clojure/java.classpath "0.2.2"] [javax.servlet/servlet-api "2.5"] [ring-mock "0.1.5"]]}} :jvm-opts ["-Xmx1g" "-server"] )
(defproject kevin "0.1.0-SNAPSHOT" :description "It's like Kevin Bacon is right here!" :url "http://imdb.com" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.5.1"] [com.datomic/datomic-pro "0.9.4556"] [hiccup "1.0.5"] [environ "0.4.0"] [ring-server "0.3.1"] [compojure "1.1.6"]] :plugins [[lein-ring "0.8.10"] [lein-beanstalk "0.2.7"]] :aws {:access-key ~(System/getenv "AWS_ACCESS_KEY_ID") :secret-key ~(System/getenv "AWS_SECRET_KEY") } :ring {:handler kevin.system/handler :init kevin.system/init :destroy kevin.system/destroy } :profiles {:production {:ring {:open-browser? false :stacktraces? false :auto-reload? false}} :dev {:source-paths ["dev"] :dependencies [[org.clojure/tools.namespace "0.2.4"] [org.clojure/java.classpath "0.2.2"] [javax.servlet/servlet-api "2.5"] [ring-mock "0.1.5"]]}} :jvm-opts ["-Xmx4g" "-server"] )
Remove dev dependency on old lein-javac plugin
(defproject clj-json "0.4.3" :description "Fast JSON encoding and decoding for Clojure via the Jackson library." :url "http://github.com/mmcgrana/clj-json" :source-path "src/clj" :java-source-path "src/jvm" :javac-fork "true" :dependencies [[org.clojure/clojure "1.2.0"] [org.codehaus.jackson/jackson-core-asl "1.5.0"]] :dev-dependencies [[org.clojars.mmcgrana/lein-javac "1.2.1"]])
(defproject clj-json "0.4.3" :description "Fast JSON encoding and decoding for Clojure via the Jackson library." :url "http://github.com/mmcgrana/clj-json" :source-path "src/clj" :java-source-path "src/jvm" :javac-fork "true" :dependencies [[org.clojure/clojure "1.2.0"] [org.codehaus.jackson/jackson-core-asl "1.5.0"]])
Prepare for next release cycle.
(defproject org.onyxplatform/onyx-peer-http-query "0.10.0.0-beta3" :description "An Onyx health and query HTTP server" :url "https://github.com/onyx-platform/onyx-peer-http-query" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] [ring/ring-core "1.5.1"] [org.clojure/java.jmx "0.3.3"] [ring-jetty-component "0.3.1"] [cheshire "5.7.0"] ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}} [org.onyxplatform/onyx "0.10.0-beta3"]] :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :profiles {:dev {:dependencies [[clj-http "3.4.1"]] :plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}})
(defproject org.onyxplatform/onyx-peer-http-query "0.10.0.0-SNAPSHOT" :description "An Onyx health and query HTTP server" :url "https://github.com/onyx-platform/onyx-peer-http-query" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] [ring/ring-core "1.5.1"] [org.clojure/java.jmx "0.3.3"] [ring-jetty-component "0.3.1"] [cheshire "5.7.0"] ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}} [org.onyxplatform/onyx "0.10.0-beta3"]] :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :profiles {:dev {:dependencies [[clj-http "3.4.1"]] :plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}})
Upgrade todomvc example shadow-cljs to 2.8.59
(defproject todomvc-re-frame "0.11.0-rc2-SNAPSHOT" :dependencies [[org.clojure/clojure "1.10.1"] [org.clojure/clojurescript "1.10.520" :exclusions [com.google.javascript/closure-compiler-unshaded org.clojure/google-closure-library]] [thheller/shadow-cljs "2.8.52"] [reagent "0.9.0-rc1"] [re-frame "0.11.0-rc2-SNAPSHOT"] [binaryage/devtools "0.9.10"] [clj-commons/secretary "1.2.4"] [day8.re-frame/tracing "0.5.3"]] :plugins [[lein-shadow "0.1.6"]] :clean-targets ^{:protect false} [:target-path "shadow-cljs.edn" "package.json" "package-lock.json" "resources/public/js"] :shadow-cljs {:nrepl {:port 8777} :builds {:client {:target :browser :output-dir "resources/public/js" :modules {:client {:init-fn todomvc.core/main}} :devtools {:http-root "resources/public" :http-port 8280}}}} :aliases {"dev-auto" ["shadow" "watch" "client"]})
(defproject todomvc-re-frame "0.11.0-rc2-SNAPSHOT" :dependencies [[org.clojure/clojure "1.10.1"] [org.clojure/clojurescript "1.10.520" :exclusions [com.google.javascript/closure-compiler-unshaded org.clojure/google-closure-library]] [thheller/shadow-cljs "2.8.59"] [reagent "0.9.0-rc1"] [re-frame "0.11.0-rc2-SNAPSHOT"] [binaryage/devtools "0.9.10"] [clj-commons/secretary "1.2.4"] [day8.re-frame/tracing "0.5.3"]] :plugins [[lein-shadow "0.1.6"]] :clean-targets ^{:protect false} [:target-path "shadow-cljs.edn" "package.json" "package-lock.json" "resources/public/js"] :shadow-cljs {:nrepl {:port 8777} :builds {:client {:target :browser :output-dir "resources/public/js" :modules {:client {:init-fn todomvc.core/main}} :devtools {:http-root "resources/public" :http-port 8280}}}} :aliases {"dev-auto" ["shadow" "watch" "client"]})
Add an explanation to the day 4 solution approach.
(ns advent2017.day4 (:require [advent2017.core :refer [->words]])) (defn solve [xform lines] (reduce (fn [counter words] (if (= (count words) (count (set words))) (inc counter) counter)) 0 (map (comp xform ->words) lines))) (def solve-1 (partial solve identity)) (def solve-2 (partial solve frequencies)) (comment (assert (= (solve-1 ["aa bb cc dd ee"]) 1)) (assert (= (solve-1 ["aa bb cc dd aa"]) 0)) (assert (= (solve-1 ["aa bb cc dd aaa"]) 1)) (solve-1 (line-seq (clojure.java.io/reader "../2017/day4.data"))) (assert (= (solve-2 ["abcde fghij"]) 1)) (assert (= (solve-2 ["abcde xyz ecdab"]) 0)) (assert (= (solve-2 ["a ab abc abd abf abj"]) 1)) (assert (= (solve-2 ["iiii oiii ooii oooi oooo"]) 1)) (assert (= (solve-2 ["oiii ioii iioi iiio"]) 0)) (solve-2 (line-seq (clojure.java.io/reader "../2017/day4.data"))))
(ns advent2017.day4 "Part 1 is simply finding duplicate words, we can compare the length of the original list of words with the length of a set of the original list, if there are any duplicates the lengths will be unequal. Part 2 requires checking anagrams. For two words to be anagrams all we need to do is compare letter frequencies." (:require [advent2017.core :refer [->words]])) (defn solve [xform lines] (reduce (fn [counter words] (if (= (count words) (count (set words))) (inc counter) counter)) 0 (map (comp xform ->words) lines))) (def solve-1 (partial solve identity)) (def solve-2 (partial solve frequencies)) (comment (assert (= (solve-1 ["aa bb cc dd ee"]) 1)) (assert (= (solve-1 ["aa bb cc dd aa"]) 0)) (assert (= (solve-1 ["aa bb cc dd aaa"]) 1)) (solve-1 (line-seq (clojure.java.io/reader "../2017/day4.data"))) (assert (= (solve-2 ["abcde fghij"]) 1)) (assert (= (solve-2 ["abcde xyz ecdab"]) 0)) (assert (= (solve-2 ["a ab abc abd abf abj"]) 1)) (assert (= (solve-2 ["iiii oiii ooii oooi oooo"]) 1)) (assert (= (solve-2 ["oiii ioii iioi iiio"]) 0)) (solve-2 (line-seq (clojure.java.io/reader "../2017/day4.data"))))
Reduce the verbage leading up to performance.
(ns klangmeister.ui.jam (:require [klangmeister.ui.graph :as graph] [klangmeister.actions :as action] [klangmeister.ui.editor :as editor])) (defn controls [handle! state] (let [{:keys [looping?]} (:main state) play (if-not looping? [:button {:on-click #(handle! (action/->Play :main))} "Loop"] [:button {:on-click #(handle! (action/->Stop :main))} "Stop"])] [:div {:class "controls"} play])) (defn render [handle! state-atom] [:div [:p "Now we know how to make both instruments and melodies, we can create whole songs. To make the experience more interactive, lets graph the notes we're playing, and loop them over and over again as we edit the synth and music."] [graph/render handle! state-atom] [editor/render :main (-> @state-atom :main :text) handle! @state-atom] [controls handle! @state-atom] [:div [:p "If you find anything confusing, refer back to the " [:a {:href "/klangmeister/synthesis"} "synthesis tutorial"] " or the " [:a {:href "/klangmeister/music"} " music tutorial"] "."]]])
(ns klangmeister.ui.jam (:require [klangmeister.ui.graph :as graph] [klangmeister.actions :as action] [klangmeister.ui.editor :as editor])) (defn controls [handle! state] (let [{:keys [looping?]} (:main state) play (if-not looping? [:button {:on-click #(handle! (action/->Play :main))} "Loop"] [:button {:on-click #(handle! (action/->Stop :main))} "Stop"])] [:div {:class "controls"} play])) (defn render [handle! state-atom] [:div [graph/render handle! state-atom] [editor/render :main (-> @state-atom :main :text) handle! @state-atom] [controls handle! @state-atom] [:div [:p "Now we know how to make both instruments and melodies, we can create whole songs. To make the experience more interactive, lets graph the notes we're playing, and loop them over and over again as we edit the synth and music."] [:p "If you find anything confusing, refer back to the " [:a {:href "/klangmeister/synthesis"} "synthesis tutorial"] " or the " [:a {:href "/klangmeister/music"} " music tutorial"] "."]]])
Make sure doc is available in the REPL
{:user {:signing {:gpg-key "8ED1CE42"} :dependencies [[alembic "0.2.1"] [clj-stacktrace "0.2.7"] [criterium "0.4.2"] [org.clojure/tools.namespace "0.2.5"] [slamhound "1.5.3"] [spyscope "0.1.4"]] :plugins [[cider/cider-nrepl "0.8.0-SNAPSHOT"] [codox "0.6.6"] [jonase/eastwood "0.1.4"] [lein-ancient "0.5.5" :exclusions [commons-codec]] [lein-cljsbuild "1.0.3"] [lein-clojars "0.9.1"] [lein-cloverage "1.0.2"] [lein-difftest "2.0.0"] [lein-kibit "0.0.8"] [lein-marginalia "0.7.1"] [lein-pprint "1.1.1"] [lein-swank "1.4.4"]] :injections [(require '[alembic.still :refer [distill]] '[clojure.repl :refer [source]] '[clojure.tools.namespace.repl :as repl] '[criterium.core :refer [bench quick-bench]] 'spyscope.core)] :aliases {"slamhound" ["run" "-m" "slam.hound"]} :search-page-size 50}}
{:user {:signing {:gpg-key "8ED1CE42"} :dependencies [[alembic "0.2.1"] [clj-stacktrace "0.2.7"] [criterium "0.4.2"] [org.clojure/tools.namespace "0.2.5"] [slamhound "1.5.3"] [spyscope "0.1.4"]] :plugins [[cider/cider-nrepl "0.8.0-SNAPSHOT"] [codox "0.6.6"] [jonase/eastwood "0.1.4"] [lein-ancient "0.5.5" :exclusions [commons-codec]] [lein-cljsbuild "1.0.3"] [lein-clojars "0.9.1"] [lein-cloverage "1.0.2"] [lein-difftest "2.0.0"] [lein-kibit "0.0.8"] [lein-marginalia "0.7.1"] [lein-pprint "1.1.1"] [lein-swank "1.4.4"]] :injections [(require '[alembic.still :refer [distill]] '[clojure.repl :refer [doc source]] '[clojure.tools.namespace.repl :as repl] '[criterium.core :refer [bench quick-bench]] 'spyscope.core)] :aliases {"slamhound" ["run" "-m" "slam.hound"]} :search-page-size 50}}
Add test for empty stack
(ns cortex.wiring-test (:use [clojure.test]) (:use [cortex.core])) (deftest test-function-module (let [m (function-module inc)] (is (= 2 (output (calc m 1)))))) (deftest test-stack-module (let [m (function-module inc) st (stack-module [m m])] (is (= 3 (output (calc st 1))))))
(ns cortex.wiring-test (:use [clojure.test]) (:use [cortex.core])) (deftest test-function-module (let [m (function-module inc)] (is (= 2 (output (calc m 1)))))) (deftest test-stack-module ;; simple 2-layer stack (let [m (function-module inc) st (stack-module [m m])] (is (= 3 (output (calc st 1))))) ;; empty stack (let [st (stack-module [])] (is (= 1 (output (calc st 1))))))
Read AWS credentials from environment variables.
(ns uswitch.bifrost.main (:require [uswitch.bifrost.system :refer (make-system)] [uswitch.bifrost.version :refer (current-version current-build-number)] [com.stuartsierra.component :refer (start)] [clojure.tools.logging :refer (info)] [clojure.tools.cli :refer (parse-opts)] [metrics.gauges :refer (gauge)]) (:gen-class)) (defn wait! [] (let [s (java.util.concurrent.Semaphore. 0)] (.acquire s))) (def cli-options [["-c" "--config CONFIG" "Path to EDN configuration file" :default "./etc/config.edn" :validate [string?]] ["-h" "--help"]]) (defn -main [& args] (let [{:keys [options summary]} (parse-opts args cli-options)] (when (:help options) (println summary) (System/exit 0)) (let [{:keys [config]} options] (info "Bifrost" (current-version)) (when (current-build-number) (gauge "build-number" (current-build-number))) (info "Starting Bifrost with config" config) (start (make-system (read-string (slurp config)))) (wait!))))
(ns uswitch.bifrost.main (:require [uswitch.bifrost.system :refer (make-system)] [uswitch.bifrost.version :refer (current-version current-build-number)] [com.stuartsierra.component :refer (start)] [clojure.tools.logging :refer (info)] [clojure.tools.cli :refer (parse-opts)] [metrics.gauges :refer (gauge)]) (:gen-class)) (defn wait! [] (let [s (java.util.concurrent.Semaphore. 0)] (.acquire s))) (def cli-options [["-c" "--config CONFIG" "Path to EDN configuration file" :default "./etc/config.edn" :validate [string?]] ["-h" "--help"]]) (defn credentials [config] (let [{{:keys [access-key secret-key] :or {access-key (System/getenv "AWS_ACCESS_KEY_ID") secret-key (System/getenv "AWS_SECRET_ACCESS_KEY")}} :credentials} config] (update-in config [:credentials] assoc :access-key access-key :secret-key secret-key))) (defn -main [& args] (let [{:keys [options summary]} (parse-opts args cli-options)] (when (:help options) (println summary) (System/exit 0)) (let [{:keys [config]} options config (-> config slurp read-string credentials)] (info "Bifrost" (current-version)) (when (current-build-number) (gauge "build-number" (current-build-number))) (info "Starting Bifrost with config" config) (start (make-system config)) (wait!))))
Drop core.async/component dependency These will force older versions than Onyx use internally, which is probably a bad idea
(defproject {{app-name}} "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.7.0"] [org.clojure/core.async "0.1.346.0-17112a-alpha"] [org.onyxplatform/onyx "0.8.0-alpha1"] [com.stuartsierra/component "0.2.3"]] :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]] :source-paths ["env/dev" "src"]}})
(defproject {{app-name}} "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.7.0"] [org.onyxplatform/onyx "0.8.0-alpha1"]] :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]] :source-paths ["env/dev" "src"]}})
Comment in element convenience funcs
(ns blue-salamander.r3elements (:require-macros [blue-salamander.r3elements :as abbrev]) (:require [goog.events :as events] [clojure.string :as string])) (defn element-args [opts children] (cond (nil? opts) [nil children] (map? opts) [(clj->js opts) children] (object? opts) [opts children])) (abbrev/defn-r3-element Renderer) (abbrev/defn-r3-element Scene) (abbrev/defn-r3-element Mesh) (abbrev/defn-r3-element Object3D) (abbrev/defn-r3-element PerspectiveCamera)
(ns blue-salamander.r3elements (:require-macros [blue-salamander.r3elements :as abbrev]) (:require [goog.events :as events] [clojure.string :as string])) ;; ;; provides convenient definitions for threejs nodes. Instead of going: ;; ;; (js/React.createElement (js/ReactTHREE.Scene #js {} ....)) ;; ;; you go: ;; ;; < require this ns as 'r3' > ;; ;; (r3/scene {} ...) ;; (defn element-args [opts children] (cond (nil? opts) [nil children] (map? opts) [(clj->js opts) children] (object? opts) [opts children])) (abbrev/defn-r3-element Renderer) (abbrev/defn-r3-element Scene) (abbrev/defn-r3-element Mesh) (abbrev/defn-r3-element Object3D) (abbrev/defn-r3-element PerspectiveCamera)
Update cljs compiler and tools.reader versions.
(defproject funcool/postal "0.1.0-SNAPSHOT" :description "A parser, renderer and validation layer for POSTAL protocol for Clojure and ClojureScript." :url "http://github.com/funcool/postal" :license {:name "BSD (2-Clause)" :url "http://opensource.org/licenses/BSD-2-Clause"} :source-paths ["src"] :jar-exclusions [#"\.swp|\.swo|user.clj"] :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"] :dependencies [[org.clojure/clojure "1.7.0" :scope "provided"] [org.clojure/clojurescript "0.0-3308" :scope "provided"] [org.clojure/tools.reader "0.10.0-alpha1"] [funcool/cuerdas "0.5.0"]])
(defproject funcool/postal "0.1.0-SNAPSHOT" :description "A parser, renderer and validation layer for POSTAL protocol for Clojure and ClojureScript." :url "http://github.com/funcool/postal" :license {:name "BSD (2-Clause)" :url "http://opensource.org/licenses/BSD-2-Clause"} :source-paths ["src"] :jar-exclusions [#"\.swp|\.swo|user.clj"] :javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"] :dependencies [[org.clojure/clojure "1.7.0" :scope "provided"] [org.clojure/clojurescript "1.7.28" :scope "provided"] [org.clojure/tools.reader "0.10.0-alpha3"] [funcool/cuerdas "0.5.0"]])
Prepare for next release cycle.
(defproject org.onyxplatform/onyx-peer-http-query "0.10.0.0-alpha4" :description "An Onyx health and query HTTP server" :url "https://github.com/onyx-platform/onyx-peer-http-query" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] [ring/ring-core "1.5.1"] [org.clojure/java.jmx "0.3.3"] [ring-jetty-component "0.3.1"] [cheshire "5.7.0"]] :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :profiles {:dev {:dependencies [[clj-http "3.4.1"] [org.onyxplatform/onyx-metrics "0.10.0.0-alpha1"] [org.onyxplatform/onyx "0.10.0-alpha4"]] :plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}})
(defproject org.onyxplatform/onyx-peer-http-query "0.10.0.0-SNAPSHOT" :description "An Onyx health and query HTTP server" :url "https://github.com/onyx-platform/onyx-peer-http-query" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] [ring/ring-core "1.5.1"] [org.clojure/java.jmx "0.3.3"] [ring-jetty-component "0.3.1"] [cheshire "5.7.0"]] :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :profiles {:dev {:dependencies [[clj-http "3.4.1"] [org.onyxplatform/onyx-metrics "0.10.0.0-alpha1"] [org.onyxplatform/onyx "0.10.0-alpha4"]] :plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}})
Advance version number to 0.1.9
(defproject io.aviso/twixt "0.1.8" :description "An extensible asset pipeline for Clojure web applications" :url "https://github.com/AvisoNovate/twixt" :license {:name "Apache Sofware Licencse 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0.html"} :dependencies [[org.clojure/clojure "1.5.1"] [io.aviso/tracker "0.1.0"] [ring/ring-core "1.2.1"] [org.mozilla/rhino "1.7R4"] [com.github.sommeri/less4j "1.2.4"] [de.neuland-bfi/jade4j "0.4.0"] [hiccup "1.0.4"]] :codox {:src-dir-uri "https://github.com/AvisoNovate/twixt/blob/master/" :src-linenum-anchor-prefix "L"} :profiles {:dev {:dependencies [[log4j "1.2.17"] [ring/ring-jetty-adapter "1.2.0"]]}})
(defproject io.aviso/twixt "0.1.9" :description "An extensible asset pipeline for Clojure web applications" :url "https://github.com/AvisoNovate/twixt" :license {:name "Apache Sofware Licencse 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0.html"} :dependencies [[org.clojure/clojure "1.5.1"] [io.aviso/tracker "0.1.0"] [ring/ring-core "1.2.1"] [org.mozilla/rhino "1.7R4"] [com.github.sommeri/less4j "1.2.4"] [de.neuland-bfi/jade4j "0.4.0"] [hiccup "1.0.4"]] :codox {:src-dir-uri "https://github.com/AvisoNovate/twixt/blob/master/" :src-linenum-anchor-prefix "L"} :profiles {:dev {:dependencies [[log4j "1.2.17"] [ring/ring-jetty-adapter "1.2.0"]]}})
Prepare for next release cycle.
(defproject org.onyxplatform/onyx-datomic "0.7.10" :description "Onyx plugin for Datomic" :url "https://github.com/MichaelDrogalis/onyx-datomic" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :dependencies [[org.clojure/clojure "1.7.0"] ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}} [org.onyxplatform/onyx "0.7.10"]] :profiles {:dev {:dependencies [[midje "1.7.0"] [com.datomic/datomic-free "0.9.5153"]] :plugins [[lein-midje "3.1.3"] [lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]} :circle-ci {:jvm-opts ["-Xmx4g"]}})
(defproject org.onyxplatform/onyx-datomic "0.7.11-SNAPSHOT" :description "Onyx plugin for Datomic" :url "https://github.com/MichaelDrogalis/onyx-datomic" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :dependencies [[org.clojure/clojure "1.7.0"] ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}} [org.onyxplatform/onyx "0.7.10"]] :profiles {:dev {:dependencies [[midje "1.7.0"] [com.datomic/datomic-free "0.9.5153"]] :plugins [[lein-midje "3.1.3"] [lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]} :circle-ci {:jvm-opts ["-Xmx4g"]}})
Increase version number for release
(defproject foreclojure "0.1.3.1" :description "4clojure - a website for lisp beginners" :dependencies [[org.clojure/clojure "1.2.1"] [org.clojure/clojure-contrib "1.2.0"] [compojure "0.6.2"] [hiccup "0.2.4"] [clojail "0.4.0-SNAPSHOT"] [sandbar "0.4.0-SNAPSHOT"] [org.clojars.christophermaier/congomongo "0.1.4-SNAPSHOT"] [org.jasypt/jasypt "1.7"] [amalloy/utils "[0.3.7,)"] [clj-github "1.0.1"] [ring "0.3.7"] [clj-config "0.1.0"] [org.apache.commons/commons-email "1.2"]] :dev-dependencies [[lein-ring "0.4.0"] [swank-clojure "1.2.1"]] :main foreclojure.core :ring {:handler foreclojure.core/app})
(defproject foreclojure "0.1.3.2" :description "4clojure - a website for lisp beginners" :dependencies [[org.clojure/clojure "1.2.1"] [org.clojure/clojure-contrib "1.2.0"] [compojure "0.6.2"] [hiccup "0.2.4"] [clojail "0.4.0-SNAPSHOT"] [sandbar "0.4.0-SNAPSHOT"] [org.clojars.christophermaier/congomongo "0.1.4-SNAPSHOT"] [org.jasypt/jasypt "1.7"] [amalloy/utils "[0.3.7,)"] [clj-github "1.0.1"] [ring "0.3.7"] [clj-config "0.1.0"] [org.apache.commons/commons-email "1.2"]] :dev-dependencies [[lein-ring "0.4.0"] [swank-clojure "1.2.1"]] :main foreclojure.core :ring {:handler foreclojure.core/app})
Prepare for next release cycle.
(defproject onyx-app/lein-template "0.10.0.0-alpha5" :description "Onyx Leiningen application template" :url "https://github.com/onyx-platform/onyx-template" :license {:name "MIT License" :url "http://choosealicense.com/licenses/mit/#"} :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :plugins [[lein-set-version "0.4.1"]] :profiles {:dev {:plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}} :eval-in-leiningen true)
(defproject onyx-app/lein-template "0.10.0.0-SNAPSHOT" :description "Onyx Leiningen application template" :url "https://github.com/onyx-platform/onyx-template" :license {:name "MIT License" :url "http://choosealicense.com/licenses/mit/#"} :repositories {"snapshots" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false} "releases" {:url "https://clojars.org/repo" :username :env :password :env :sign-releases false}} :plugins [[lein-set-version "0.4.1"]] :profiles {:dev {:plugins [[lein-set-version "0.4.1"] [lein-update-dependency "0.1.2"] [lein-pprint "1.1.1"]]}} :eval-in-leiningen true)
Update 1.7 version of Clojure to use beta2.
(defproject manners "0.7.0" :description "A validation library built on using predicates properly." :url "https://github.com/RyanMcG/manners" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.6.0"]] :profiles {:dev {:aliases {"incise" ^:pass-through-help ["run" "-m" "incise.core"]} :resource-paths ["dev-resources"] :plugins [[lein-repack "0.2.10"]] :dependencies [[com.ryanmcg/incise-vm-layout "0.5.0"] [incise "0.5.0"] [com.ryanmcg/incise-codox "0.2.0"]]} :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]} :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} :1.7 {:dependencies [[org.clojure/clojure "1.7.0-alpha5"]]}})
(defproject manners "0.7.0" :description "A validation library built on using predicates properly." :url "https://github.com/RyanMcG/manners" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.6.0"]] :profiles {:dev {:aliases {"incise" ^:pass-through-help ["run" "-m" "incise.core"]} :resource-paths ["dev-resources"] :plugins [[lein-repack "0.2.10"]] :dependencies [[com.ryanmcg/incise-vm-layout "0.5.0"] [incise "0.5.0"] [com.ryanmcg/incise-codox "0.2.0"]]} :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]} :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} :1.7 {:dependencies [[org.clojure/clojure "1.7.0-beta2"]]}})
Update ring-core dependency to 1.3.1
(defproject compojure "1.1.8" :description "A concise routing library for Ring" :url "https://github.com/weavejester/compojure" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.3.0"] [org.clojure/tools.macro "0.1.0"] [clout "1.2.0"] [ring/ring-core "1.3.0"]] :plugins [[codox "0.8.0"]] :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.1.8/" :src-linenum-anchor-prefix "L"} :profiles {:dev {:dependencies [[ring-mock "0.1.3"] [javax.servlet/servlet-api "2.5"]]} :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]} :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}})
(defproject compojure "1.1.8" :description "A concise routing library for Ring" :url "https://github.com/weavejester/compojure" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.3.0"] [org.clojure/tools.macro "0.1.0"] [clout "1.2.0"] [ring/ring-core "1.3.1"]] :plugins [[codox "0.8.0"]] :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.1.8/" :src-linenum-anchor-prefix "L"} :profiles {:dev {:dependencies [[ring-mock "0.1.3"] [javax.servlet/servlet-api "2.5"]]} :1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]} :1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}})
Clarify by renaming content into popup
(ns tabswitcher.background (:require [khroma.log :as console] [khroma.runtime :as runtime] [cljs.core.async :refer [>! <!] :as async]) (:require-macros [cljs.core.async.macros :refer [go go-loop]])) (defn init [] (go-loop [conns (runtime/connections) content (<! conns)] (let [[message & args] (<! content)] (console/log "Content script said: " message) ; keywords ends as a string there, need to read khroma (condp = message "tabs" (.query js/chrome.tabs #js {:currentWindow true} (fn [result] (async/put! content result))) "jump" (let [tab-id (first args)] (.update js/chrome.tabs tab-id #js {:highlighted true})) nil (recur conns (<! conns))) (recur conns content))))
(ns tabswitcher.background (:require [khroma.log :as console] [khroma.runtime :as runtime] [cljs.core.async :refer [>! <!] :as async]) (:require-macros [cljs.core.async.macros :refer [go go-loop]])) (defn init [] (go-loop [conns (runtime/connections) popup (<! conns)] (let [[message & args] (<! popup)] (console/log "popup script said: " message) ; keywords ends as a string there, need to read khroma (condp = message "tabs" (.query js/chrome.tabs #js {:currentWindow true} (fn [result] (async/put! popup result))) "jump" (let [tab-id (first args)] (.update js/chrome.tabs tab-id #js {:highlighted true})) nil (recur conns (<! conns))) (recur conns popup))))
Add cider-nrepl 0.7.0-SNAPSHOT to lein plugins
{:user {:signing {:gpg-key "8ED1CE42"} :dependencies [[alembic "0.2.1"] [clj-stacktrace "0.2.7"] [criterium "0.4.2"] [org.clojure/tools.namespace "0.2.4"] [slamhound "1.5.3"] [spyscope "0.1.4"]] :plugins [[codox "0.6.6"] [jonase/eastwood "0.1.1"] [lein-ancient "0.5.4"] [lein-cljsbuild "1.0.0"] [lein-clojars "0.9.1"] [lein-cloverage "1.0.2"] [lein-difftest "2.0.0"] [lein-kibit "0.0.8"] [lein-marginalia "0.7.1"] [lein-pprint "1.1.1"] [lein-swank "1.4.4"]] :injections [(require '[alembic.still :refer [distill]] '[clojure.repl :refer [source]] '[clojure.tools.namespace.repl :as repl] '[criterium.core :refer [bench quick-bench]] 'spyscope.core)] :aliases {"slamhound" ["run" "-m" "slam.hound"]} :search-page-size 50}}
{:user {:signing {:gpg-key "8ED1CE42"} :dependencies [[alembic "0.2.1"] [clj-stacktrace "0.2.7"] [criterium "0.4.2"] [org.clojure/tools.namespace "0.2.4"] [slamhound "1.5.3"] [spyscope "0.1.4"]] :plugins [[cider/cider-nrepl "0.7.0-SNAPSHOT"] [codox "0.6.6"] [jonase/eastwood "0.1.1"] [lein-ancient "0.5.4"] [lein-cljsbuild "1.0.0"] [lein-clojars "0.9.1"] [lein-cloverage "1.0.2"] [lein-difftest "2.0.0"] [lein-kibit "0.0.8"] [lein-marginalia "0.7.1"] [lein-pprint "1.1.1"] [lein-swank "1.4.4"]] :injections [(require '[alembic.still :refer [distill]] '[clojure.repl :refer [source]] '[clojure.tools.namespace.repl :as repl] '[criterium.core :refer [bench quick-bench]] 'spyscope.core)] :aliases {"slamhound" ["run" "-m" "slam.hound"]} :search-page-size 50}}
Add note about inlined bits from lein-npm
(ns leiningen.packagejson (:require [leiningen.npm :as npm] [cheshire.core :as json] [clojure.java.io :as io] [leiningen.npm.deps :refer [resolve-node-deps]])) (defn- root [project] (if-let [root (project :npm-root)] (if (keyword? root) (project root) ;; e.g. support using :target-path root) (project :root))) (defn packagejson [project & args] (println "Generating package.json") (->> (json/generate-string (merge {:private true} ;; prevent npm warnings about repository and README {:name (project :name) :description (project :description) :version (project :version) :dependencies (npm/transform-deps (resolve-node-deps project))} (when-let [main (project :main)] {:scripts {:start (str "node " main)}}) (project :nodejs)) {:pretty true}) (spit (io/file (root project) "package.json"))))
(ns leiningen.packagejson (:require [leiningen.npm :as npm] [cheshire.core :as json] [clojure.java.io :as io] [leiningen.npm.deps :refer [resolve-node-deps]])) ;; inlined these bits from lein-npm as it keeps deleting the package.json after each action ;; this makes it difficult to deploy to heroku as a nodejs project. (defn- root [project] (if-let [root (project :npm-root)] (if (keyword? root) (project root) ;; e.g. support using :target-path root) (project :root))) (defn packagejson [project & args] (println "Generating package.json") (->> (json/generate-string (merge {:private true} ;; prevent npm warnings about repository and README {:name (project :name) :description (project :description) :version (project :version) :dependencies (npm/transform-deps (resolve-node-deps project))} (when-let [main (project :main)] {:scripts {:start (str "node " main)}}) (project :nodejs)) {:pretty true}) (spit (io/file (root project) "package.json"))))
Fix ordering of actual/expected in CLJS
(ns flare.cljs-test (:require [flare.report :as report] [flare.diff :as diff] [cljs.test :as ct])) (defn render-diff [m] (let [[pred & values] (second (:actual m))] (try (when (and (= pred '=) (= 2 (count values))) (when-let [diff (apply diff/diff* values)] (println "\n" (clojure.string/join "\n" (report/report* diff))))) (catch js/Error e (println "*** Oh noes! Flare threw an exception diffing the following values:") (println values) (println "*** Exception thrown is:" e))))) (defmethod cljs.test/report [:cljs.test/default :fail] [m] (ct/inc-report-counter! :fail) (println "\nFAIL in" (ct/testing-vars-str m)) (when (seq (:testing-contexts (ct/get-current-env))) (println (ct/testing-contexts-str))) (when-let [message (:message m)] (println message)) (ct/print-comparison m) (render-diff m))
(ns flare.cljs-test (:require [flare.report :as report] [flare.diff :as diff] [cljs.test :as ct])) (defn render-diff [m] (let [[pred & values] (second (:actual m))] (try (when (and (= pred '=) (= 2 (count values))) (when-let [diff (apply diff/diff* (reverse values))] (println "\n" (clojure.string/join "\n" (report/report* diff))))) (catch js/Error e (println "*** Oh noes! Flare threw an exception diffing the following values:") (println values) (println "*** Exception thrown is:" e))))) (defmethod cljs.test/report [:cljs.test/default :fail] [m] (ct/inc-report-counter! :fail) (println "\nFAIL in" (ct/testing-vars-str m)) (when (seq (:testing-contexts (ct/get-current-env))) (println (ct/testing-contexts-str))) (when-let [message (:message m)] (println message)) (ct/print-comparison m) (render-diff m))
Add edn-response fn from url-shortener
(ns comic-reader.core (:gen-class) (:require [ring.util.response :as response] [ring.middleware.params :refer [wrap-params]] [compojure.core :as c] [compojure.route :as route])) (c/defroutes routes (c/GET "/" [] "Hello World!") (c/context "/api/v1" [] (c/GET "/comics" [] "All the comics.") (c/GET "/comic/:name" [name] (str "Hello comic" name))) (route/resources "/")) (def app (wrap-params routes))
(ns comic-reader.core (:gen-class) (:require [ring.util.response :as response] [ring.middleware.params :refer [wrap-params]] [compojure.core :as c] [compojure.route :as route])) (defn edn-response [data & [status]] {:status (or status 200) :headers {"Content-Type" "application/edn"} :body (pr-str data)}) (c/defroutes routes (c/GET "/" [] "Hello World!") (c/context "/api/v1" [] (c/GET "/comics" [] "All the comics.") (c/GET "/comic/:name" [name] (str "Hello comic" name))) (route/resources "/")) (def app (wrap-params routes))
Add empty string :else clause to geo-to-svg, rename to more concise geo->svg.
(ns c2.geo.core (:use [clojure.core.match :only [match]] [clojure.string :only [join]])) (defn geo-to-svg "Convert geoJSON to svg path data. Takes optional projection, defaulting to identity" [geo & {:keys [projection] :or {projection identity}}] (defn project [coordinate] (join "," (projection coordinate))) (defn coords->path [coordinates] (str "M" (join "L" (map project coordinates)) "Z")) ;;See http://geojson.org/geojson-spec.html ;;This SVG rendering doesn't implement the full spec. (match [geo] [{:type "FeatureCollection" :features xs}] (join (map geo-to-svg xs)) [{:type "Feature" :geometry g}] (geo-to-svg g) [{:type "Polygon" :coordinates xs}] (join (map coords->path xs)) [{:type "MultiPolygon" :coordinates xs}] ;;It'd be nice to recurse to the actual branch that handles Polygon, instead of repeating... (join (map (fn [subpoly] (join (map coords->path subpoly))) xs))))
(ns c2.geo.core (:use [clojure.core.match :only [match]] [clojure.string :only [join]])) (defn geo->svg "Convert geoJSON to svg path data. Takes optional projection, defaulting to identity" [geo & {:keys [projection] :or {projection identity}}] (defn project [coordinate] (join "," (projection coordinate))) (defn coords->path [coordinates] (str "M" (join "L" (map project coordinates)) "Z")) ;;See http://geojson.org/geojson-spec.html ;;This SVG rendering doesn't implement the full spec. (match [geo] [{:type "FeatureCollection" :features xs}] (join (map geo-to-svg xs)) [{:type "Feature" :geometry g}] (geo-to-svg g) [{:type "Polygon" :coordinates xs}] (join (map coords->path xs)) [{:type "MultiPolygon" :coordinates xs}] ;;It'd be nice to recurse to the actual branch that handles Polygon, instead of repeating... (join (map (fn [subpoly] (join (map coords->path subpoly))) xs)) :else ""))
Call Driver/run instead of main.
(ns lein-xjc.internal.xjc (:import [com.sun.tools.xjc Driver])) (defn mk-xjc-argvs [project-root target-dir xjc-calls] (map (fn [c] ["-d" (str target-dir) (format "%s/%s" project-root (:xsd-file c)) ]) xjc-calls)) (defn xjc-main [argv] ;; TODO: fork process to avoid driver killing currently executing jvm (Driver/main (into-array String argv))) (defn call-xjc [project-root target-dir xjc-calls] (doseq [argv (mk-xjc-argvs project-root target-dir xjc-calls)] (xjc-main argv)))
(ns lein-xjc.internal.xjc (:import [com.sun.tools.xjc Driver])) (defn mk-xjc-argvs [project-root target-dir xjc-calls] (map (fn [c] ["-d" (str target-dir) (format "%s/%s" project-root (:xsd-file c)) ]) xjc-calls)) (defn xjc-main [argv] (Driver/run (into-array String argv) (System/out) (System/err))) (defn call-xjc [project-root target-dir xjc-calls] (doseq [argv (mk-xjc-argvs project-root target-dir xjc-calls)] (xjc-main argv)))
Make title reflect whether doing code or story.
(ns tryclojure.views.home (:require [noir.core :refer [defpartial defpage]] [noir.response :refer [redirect]] [hiccup.element :refer [javascript-tag link-to unordered-list]] [hiccup.page :refer [include-css include-js html5]])) (defn root-html [mode title] (html5 [:head (include-css "/resources/public/css/tryclojure.css") (include-js "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" "/resources/public/javascript/jquery-console/jquery.console.js" "/resources/public/javascript/tryclojure.js") [:title "Try Isla"]] [:body [:div#wrapper [:div#content [:div#header [:h1 "Try Isla"]] [:div#container [:div#console.console]] (javascript-tag (str "mode = '" mode "';"))]]])) (defpage "/" [] (redirect "/story")) (defpage "/story" [] (root-html "story" "Story time with Isla")) (defpage "/code" [] (root-html "isla" "Try Isla"))
(ns tryclojure.views.home (:require [noir.core :refer [defpartial defpage]] [noir.response :refer [redirect]] [hiccup.element :refer [javascript-tag link-to unordered-list]] [hiccup.page :refer [include-css include-js html5]])) (defn root-html [mode title] (html5 [:head (include-css "/resources/public/css/tryclojure.css") (include-js "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" "/resources/public/javascript/jquery-console/jquery.console.js" "/resources/public/javascript/tryclojure.js") [:title title]] [:body [:div#wrapper [:div#content [:div#header [:h1 title]] [:div#container [:div#console.console]] (javascript-tag (str "mode = '" mode "';"))]]])) (defpage "/" [] (redirect "/story")) (defpage "/story" [] (root-html "story" "Story time with Isla")) (defpage "/code" [] (root-html "isla" "Try Isla"))
Add an API endpoint for getting all comics
(ns comic-reader.core (:gen-class) (:require [ring.util.response :as response] [ring.middleware.params :refer [wrap-params]] [compojure.core :as c] [compojure.route :as route])) (c/defroutes routes (c/GET "/" [] "Hello World!") (c/context "/api/v1" [] (c/GET "/comic/:name" [name] (str "Hello comic" name))) (route/resources "/")) (def app (wrap-params routes))
(ns comic-reader.core (:gen-class) (:require [ring.util.response :as response] [ring.middleware.params :refer [wrap-params]] [compojure.core :as c] [compojure.route :as route])) (c/defroutes routes (c/GET "/" [] "Hello World!") (c/context "/api/v1" [] (c/GET "/comics" [] "All the comics.") (c/GET "/comic/:name" [name] (str "Hello comic" name))) (route/resources "/")) (def app (wrap-params routes))
Add anti forgery token route
(ns new-website.server (:require [clojure.java.io :as io] [compojure.core :refer [ANY GET PUT POST DELETE defroutes]] [compojure.route :refer [resources]] [ring.middleware.defaults :refer [wrap-defaults site-defaults]] [ring.middleware.gzip :refer [wrap-gzip]] [ring.middleware.logger :refer [wrap-with-logger]] [environ.core :refer [env]] [ring.adapter.jetty :refer [run-jetty]]) (:gen-class)) (defroutes routes (GET "/" _ {:status 200 :headers {"Content-Type" "text/html; charset=utf-8"} :body (io/input-stream (io/resource "public/index.html"))}) (resources "/")) (def http-handler (-> routes (wrap-defaults site-defaults) wrap-with-logger wrap-gzip)) (defn -main [& [port]] (let [port (Integer. (or port (env :port) 10555))] (run-jetty http-handler {:port port :join? false})))
(ns new-website.server (:require [clojure.java.io :as io] [compojure.core :refer [ANY GET PUT POST DELETE defroutes]] [compojure.route :refer [resources]] [ring.middleware.defaults :refer [wrap-defaults site-defaults]] [ring.middleware.gzip :refer [wrap-gzip]] [ring.middleware.logger :refer [wrap-with-logger]] [environ.core :refer [env]] [ring.adapter.jetty :refer [run-jetty]]) (:gen-class)) (defroutes routes (GET "/anti_forgery.js" [req] {:status 200 :headers {"Content-Type" "application/javascript"} :body (str "var csrf = '" *anti-forgery-token* "';")}) (GET "/" _ {:status 200 :headers {"Content-Type" "text/html; charset=utf-8"} :body (io/input-stream (io/resource "public/index.html"))}) (resources "/")) (def http-handler (-> routes (wrap-defaults site-defaults) wrap-with-logger wrap-gzip)) (defn -main [& [port]] (let [port (Integer. (or port (env :port) 10555))] (run-jetty http-handler {:port port :join? false})))
Use genereated-assets-root stefon option to implement uri-root.
(ns incise.once (:require (incise [load :refer [load-parsers-and-layouts]] [config :as conf] [utils :refer [delete-recursively directory?]]) [clojure.java.io :refer [file]] [incise.parsers.core :refer [parse-all-input-files]] [taoensso.timbre :refer [info]] (stefon [settings :refer [with-options]] [core :refer [precompile]]))) (defn once "Incise just once. This requires that config is already loaded." [& {:as config}] (conf/merge config) (conf/avow!) (let [{:keys [out-dir uri-root precompiles]} (conf/get) stefon-pre-opts {:mode :production :serving-root out-dir :uri-root uri-root :precompiles precompiles}] (info "Clearing out" (str \" out-dir \")) (delete-recursively (file out-dir)) (with-options stefon-pre-opts (info "Precompiling assets...") (precompile) (info "Done.") (load-parsers-and-layouts) (doall (parse-all-input-files)))))
(ns incise.once (:require (incise [load :refer [load-parsers-and-layouts]] [config :as conf] [utils :refer [delete-recursively directory?]]) [clojure.java.io :refer [file]] [incise.parsers.core :refer [parse-all-input-files]] [taoensso.timbre :refer [info]] (stefon [settings :refer [with-options]] [core :refer [precompile]]))) (defn once "Incise just once. This requires that config is already loaded." [& {:as config}] (conf/merge config) (conf/avow!) (let [{:keys [out-dir uri-root precompiles]} (conf/get)] (info "Clearing out" (str \" out-dir \")) (delete-recursively (file out-dir)) (with-options {:mode :production :serving-root out-dir :precompiles precompiles} (info "Precompiling assets...") (precompile) (info "Done.") (with-options (when uri-root {:generated-assets-root (str \/ uri-root "/assets/")}) (load-parsers-and-layouts) (doall (parse-all-input-files))))))
Modify parse to only attempt parsing when a parser exists.
(ns incise.parsers.core (:require [incise.config :as conf] [incise.parsers.helpers :refer [extension]] [clj-time.core :as tm] [clojure.java.io :refer [file]] [clojure.string :as s]) (:import [java.io File])) (defrecord Parse [^String title ^String extension ^String content ^String date ^String layout ^String path ^clojure.lang.Seqable tags ^String category]) (def parsers "An atom containing a mapping of extensions (strings) to parse functions. A parse function takes a java.io.File and returns a Parse." (atom {})) (defn register "Register a parser for the given file extensions." [extensions parser] (swap! parsers merge (zipmap (map name extensions) (repeat parser)))) (defn parse "Do all the work, parse the file and output it to the proper location." [^File handle] {:pre [(contains? @parsers (extension handle))]} ((@parsers (extension handle)) handle))
(ns incise.parsers.core (:require [incise.config :as conf] [incise.parsers.helpers :refer [extension]] [clj-time.core :as tm] [clojure.java.io :refer [file]] [taoensso.timbre :refer [with-default-outs spy trace debug info warn error fatal]] [clojure.string :as s]) (:import [java.io File]) (:refer-clojure :exclude [contains?])) (defrecord Parse [^String title ^String extension ^String content ^String date ^String layout ^String path ^clojure.lang.Seqable tags ^String category]) (def parsers "An atom containing a mapping of extensions (strings) to parse functions. A parse function takes a java.io.File and returns a Parse." (atom {})) (defn contains? [& args] (apply clojure.core/contains? @parsers args)) (defn register "Register a parser for the given file extensions." [extensions parser] (swap! parsers merge (zipmap (map name extensions) (repeat parser)))) (defn parse "Do all the work, parse the file and output it to the proper location." [^File handle] {:pre [(instance? File handle)]} (let [ext (extension handle)] (when (contains? ext) (info "Parsing" (.getPath handle)) ((@parsers ext) handle))))
Add colour scheme to clojure repl
{:user {:plugins [[venantius/ultra "0.4.0"]]}}
{:user {:plugins [[venantius/ultra "0.4.0"]] :ultra {:color-scheme :solarized_dark}}}