Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix warnings which block the CI builds | (ns lt.util.ipc
"Util functions for the ipc renderer - https://github.com/atom/electron/blob/master/docs/api/ipc-renderer.md")
(def ipc "Provides access to the ipc renderer." (.-ipcRenderer (js/require "electron")))
;; `send` and `on` are declared here with their bodies defined later as otherwise Codox will use the... | (ns lt.util.ipc
"Util functions for the ipc renderer - https://github.com/atom/electron/blob/master/docs/api/ipc-renderer.md")
(def ipc "Provides access to the ipc renderer." (.-ipcRenderer (js/require "electron")))
;; `send` and `on` are declared here with their bodies defined later as otherwise Codox will use the... |
Change how the mock data state is held for cucumber tests. | (ns fcms.lib.http-mock)
(def req) ; mock HTTP request
(def bod) ; body of the mock HTTP request or response
(def resp) ; mock HTTP response
(defn request
([] req)
([new-req] (def req new-req)))
(defn body
([] bod)
([new-body] (def bod new-body)))
(defn response
([] resp)
([new-resp] (def resp new-resp))... | (ns fcms.lib.http-mock)
(def mock-data (atom {:request {} :body "" :response {}}))
(defn request
([] (:request @mock-data))
([new-request] (swap! mock-data assoc :request new-request)))
(defn body
([] (:body @mock-data))
([new-body] (swap! mock-data assoc :body new-body)))
(defn response
([] (:response @m... |
Change how path creating is done slightly, allowing path override. | (ns incise.parsers.helpers
(:require (clj-time [core :as tm]
[coerce :as tc])
[clojure.string :as s])
(:import [java.io File]))
(defn dashify
"Dashify a title, replacing all non word characters with a dash."
[^String title]
(str \/ (-> title
(s/lower-case)
... | (ns incise.parsers.helpers
(:require (clj-time [core :as tm]
[coerce :as tc])
[clojure.string :as s])
(:import [java.io File]))
(defn dashify
"Dashify a title, replacing all non word characters with a dash."
[^String title]
(-> title
(s/lower-case)
(s/replace #"[... |
Fix test to reflect run task bugfix. | (ns test-run
(:use [clojure.test]
[clojure.java.io :only [delete-file]]
[leiningen.core :only [read-project]]
[leiningen.run]
[leiningen.util.file :only [tmp-dir]]))
(def out-file (format "%s/lein-test" tmp-dir))
(def project (binding [*ns* (find-ns 'leiningen.core)]
(... | (ns test-run
(:use [clojure.test]
[clojure.java.io :only [delete-file]]
[leiningen.core :only [read-project]]
[leiningen.run]
[leiningen.util.file :only [tmp-dir]]))
(def out-file (format "%s/lein-test" tmp-dir))
(def project (binding [*ns* (find-ns 'leiningen.core)]
(... |
Fix bug with linkifying headers | (ns langnostic.files
(:require [markdown.core :as md]
[clojure.java.io :as io]))
(def resources (.getCanonicalFile (io/file "resources")))
(defn file-in? [file path]
(.startsWith (.getPath (.getCanonicalFile file))
(.getPath (.getCanonicalFile path))))
(defn file-in-resources? [file]
... | (ns langnostic.files
(:require [markdown.core :as md]
[clojure.java.io :as io]))
(def resources (.getCanonicalFile (io/file "resources")))
(defn file-in? [file path]
(.startsWith (.getPath (.getCanonicalFile file))
(.getPath (.getCanonicalFile path))))
(defn file-in-resources? [file]
... |
Fix reconnect-overlay being under sidebar | (ns braid.core.client.ui.styles.reconnect-overlay
(:require
[braid.core.client.ui.styles.mixins :as mixins]
[braid.core.client.ui.styles.vars :as vars]
[garden.arithmetic :as m]))
(def reconnect-overlay
[:>.reconnect-overlay
{:position "absolute"
:bottom 0
:left 0
:right 0
:top 0
:b... | (ns braid.core.client.ui.styles.reconnect-overlay
(:require
[braid.core.client.ui.styles.mixins :as mixins]
[braid.core.client.ui.styles.vars :as vars]
[garden.arithmetic :as m]))
(def reconnect-overlay
[:>.reconnect-overlay
{:position "absolute"
:bottom 0
:left 0
:right 0
:top 0
:b... |
Improve the function scan-number (tests and refactoring will be necessary yet). | (ns berry.lexical-analysis.scan-number
(:require [berry.lexical-analysis.context-handler :refer [++ --]]
[berry.lexical-analysis.character :refer :all]
[berry.lexical-analysis.error-handler :refer :all]
[berry.lexical-analysis.token :as token]))
(defn scan-number
[source conte... | (ns berry.lexical-analysis.scan-number
(:require [berry.lexical-analysis.context-handler :refer [++ --]]
[berry.lexical-analysis.character :refer :all]
[berry.lexical-analysis.error-handler :refer :all]
[berry.lexical-analysis.token :as token]))
(declare scan-digits handle-end-of-... |
Update CSS to point at new Kibana. | (ns kiries.layout
(:use hiccup.core)
(:use hiccup.page))
(defn full-layout [title & content]
(html5
[:head
(include-css "/kibana/common/css/bootstrap.light.min.css")
(include-css "/kibana/common/css/bootstrap-responsive.min.css")
(include-css "/kibana/common/css/font-awesome.min.css")
[:title ... | (ns kiries.layout
(:use hiccup.core)
(:use hiccup.page))
(defn full-layout [title & content]
(html5
[:head
(include-css "/kibana/css/bootstrap.light.min.css")
(include-css "/kibana/css/bootstrap-responsive.min.css")
(include-css "/kibana/css/font-awesome.min.css")
[:title title]]
[:body
... |
Clean up test-util ns form | (ns mikron.runtime.test-util
(:require [mikron.runtime.processor.validate :as runtime.processor.validate]
[clojure.walk :as walk])
#?(:clj (:import [java.util Arrays])))
(defn nan?
"Returns `true` if value is NaN, `false otherwise`."
[value]
#?(:clj (Double/isNaN value)
:cljs (js/isNaN valu... | (ns mikron.runtime.test-util
(:require [clojure.walk :as walk]
[mikron.runtime.processor.validate :as runtime.processor.validate]))
(defn nan?
"Returns `true` if value is NaN, `false otherwise`."
[value]
#?(:clj (Double/isNaN value)
:cljs (js/isNaN value)))
#?(:cljs
(defn arra... |
Replace deprecated lambdad.execution/run function with the current alternative | (ns lambdaui.trigger
(:require [clojure.core.async :as async]
[lambdacd.execution :as execution]
[clojure.walk :refer [keywordize-keys]]))
;{:post [(v/is-not-nil-or-empty? (:branch (:global %)))
; (v/is-not-nil-or-empty? (:revision (:global %)))
; (v/is-valid-revision? (:revisi... | (ns lambdaui.trigger
(:require [clojure.core.async :as async]
[clojure.walk :refer [keywordize-keys]]
[lambdacd.execution.core :as execution-core]))
;{:post [(v/is-not-nil-or-empty? (:branch (:global %)))
; (v/is-not-nil-or-empty? (:revision (:global %)))
; (v/is-valid-revision... |
Terminate stack listings when the speclj functions are reached | (ns user
(:use
clojure.repl
io.aviso.repl
io.aviso.logging
speclj.config))
(install-pretty-exceptions)
(install-pretty-logging)
(install-uncaught-exception-handler)
(alter-var-root #'default-config assoc :color true :reporters ["documentation"])
| (ns user
(:use
clojure.repl
io.aviso.repl
io.aviso.exception
io.aviso.logging
speclj.config))
(install-pretty-exceptions)
(install-pretty-logging)
(install-uncaught-exception-handler)
(alter-var-root #'default-config assoc :color true :reporters ["documentation"])
(alter-var-root #'*default-fra... |
Add CORS header. Add buildNumber attribute to BuildSummaries | (ns lambdaui.dummy-data
(:require [ring.util.response :refer [response]]))
(def summaries {:summaries [{:buildId 1
:state :running
:startTime "11pm" ; TODO decide on format (ISO timestamp?)
:duration "30 second... | (ns lambdaui.dummy-data
(:require [ring.util.response :refer [response header]]))
(def summaries {:summaries [{:buildId 1
:buildNumber 1 ; TODO differentiate between build Number (alias) and id?
:state :running
... |
Add support for sentiment analysis from file. | (ns lexemic.core
(:require [lexemic.sentiment.simple :as sentiment]))
(def ^:private usage-banner "Usage: lexemic [command] [target]")
(def ^:private supported-commands #{"help" "sentiment"})
(defn- show-help []
(do
(println usage-banner)))
(defn- run [cmd text]
(condp = cmd
"sentiment" (println (senti... | (ns lexemic.core
(:require [cljs.nodejs :as node]
[lexemic.sentiment.simple :as sentiment]))
(def ^:private fs
(node/require "fs"))
(def ^:private usage-banner "Usage: lexemic [command] [target]")
(def ^:private supported-commands #{"help" "sentiment"})
(defn- help []
(str usage-banner))
(defn- ru... |
Increase indexing deep to 50 | (ns subman.const)
(def db-host "http://127.0.0.1:9200")
(def index-name "subman7")
(def type-all -1)
(def type-addicted 0)
(def type-podnapisi 1)
(def type-opensubtitles 2)
(def type-subscene 3)
(def type-none -2)
(def type-names {type-addicted "Addicted"
type-podnapisi "Podnapisi"
... | (ns subman.const)
(def db-host "http://127.0.0.1:9200")
(def index-name "subman7")
(def type-all -1)
(def type-addicted 0)
(def type-podnapisi 1)
(def type-opensubtitles 2)
(def type-subscene 3)
(def type-none -2)
(def type-names {type-addicted "Addicted"
type-podnapisi "Podnapisi"
... |
Update dependencies to latest version | (defproject wort "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.8.0"]
[org.clojure/data.json "0.2.6"]
... | (defproject wort "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.8.0"]
[org.clojure/data.json "0.2.6"]
... |
Add amp param to sampled-piano synth | (ns overtone.synth.sampled-piano
(:use [overtone.core]
[overtone.samples.piano :only [index-buffer]]))
(defsynth sampled-piano
[note 60 level 1 rate 1 loop? 0
attack 0 decay 1 sustain 1 release 0.1 curve -4 gate 1 out-bus 0]
(let [buf (index:kr (:id index-buffer) note)
env (env-gen (adsr attac... | (ns overtone.synth.sampled-piano
(:use [overtone.core]
[overtone.samples.piano :only [index-buffer]]))
(defsynth sampled-piano
[note 60 level 1 rate 1 loop? 0
attack 0 decay 1 sustain 1 release 0.1 curve -4 gate 1 out-bus 0 amp 1]
(let [buf (index:kr (:id index-buffer) note)
env (env-gen (adsr... |
Put public function at the top for readability. | (ns made-merits.service.winner-calculator
(:require [clojure.set :as set]
[clojure.walk :as walk]))
(defn- with-status
[scored-users]
(let [max-score (apply max (map :score scored-users))]
(vec (map (fn [scored-user]
(assoc scored-user
:status
... | (ns made-merits.service.winner-calculator
(:require [clojure.set :as set]
[clojure.walk :as walk]))
(defn with-winner
[scored-users]
(let [users-with-status (with-status scored-users)]
(if (more-than-one-winner? users-with-status)
(mark-everyone-as-a-loser users-with-status)
users-wit... |
Move doall to the end of get-specs | (ns hu.ssh.github-changelog.dependencies.bundler
(:require
[clojure.string :refer [split-lines]]
[clojure.java.io :as io]))
(defn- get-specs [reader]
(->> (doall (line-seq reader))
(drop-while #(not= % " specs:"))
(drop 1)
(take-while seq)))
(defn- parse-spec [spec]
{:name (second ... | (ns hu.ssh.github-changelog.dependencies.bundler
(:require
[clojure.string :refer [split-lines]]
[clojure.java.io :as io]))
(defn- get-specs [reader]
(->> (line-seq reader)
(drop-while #(not= % " specs:"))
(drop 1)
(take-while seq)
doall))
(defn- parse-spec [spec]
{:name (se... |
Check that we got the right constant back | (ns tensorflow-clj.core-test
(:require [clojure.test :refer :all]
[tensorflow-clj.core :refer :all]))
(deftest scalar-tensor
(testing "Scalar tensor"
(let [t (org.tensorflow.Tensor/create 123.0)]
(is (= org.tensorflow.DataType/DOUBLE (.dataType t)))
(is (= 0 (.numDimensions t)))
(... | (ns tensorflow-clj.core-test
(:require [clojure.test :refer :all]
[tensorflow-clj.core :refer :all]))
(deftest scalar-tensor
(testing "Scalar tensor"
(let [t (org.tensorflow.Tensor/create 123.0)]
(is (= org.tensorflow.DataType/DOUBLE (.dataType t)))
(is (= 0 (.numDimensions t)))
(... |
Set content-type and charset correctly | (ns rpi-challenger.core
(:require [net.cgrand.enlive-html :as html]
[ring.util.response :as response])
(:use [net.cgrand.moustache :only [app]]
[ring.adapter.jetty :only [run-jetty]]
[ring.middleware.file :only [wrap-file]]
[ring.middleware.reload :only [wrap-reload]]
[ri... | (ns rpi-challenger.core
(:require [net.cgrand.enlive-html :as html])
(:use ring.util.response
[net.cgrand.moustache :only [app]]))
(def layout (html/html-resource "resources/layout.html"))
(def routes
(app
[""] (fn [req] (->
(response "the index page")
(cont... |
Add IQR, re-do fivenum a bit | (ns clojurewerkz.statistiker.descriptive
(:require [clojurewerkz.statistiker.fast-math :refer :all]))
(defn get-rank
[amount percentile]
(assert (<= percentile 100))
(-> (* (/ percentile 100) (dec amount))
Math/ceil
int))
(def percentiles
{:min 0
:max 100
:median 50
:25 25
:75 75})
... | (ns clojurewerkz.statistiker.descriptive
(:import [org.apache.commons.math3.stat.descriptive.rank Percentile])
(:require [clojurewerkz.statistiker.fast-math :refer :all]))
(def percentiles
{:min 1
:max 100
:median 50
:25 25
:75 75})
(defn fivenum
[values]
(let [p (Percentile.)]
(.setData p (... |
Add database url to loading schemas logs | (ns yetibot.core.db
(:require
[yetibot.core.config :refer [get-config config-for-ns conf-valid?]]
[yetibot.core.loader :refer [find-namespaces]]
[datomico.db :as db]
[datomico.core :as dc]
[datomic.api :as api]
[taoensso.timbre :refer [info warn error]]))
(def db-ns-pattern #"(yetibot|plugins... | (ns yetibot.core.db
(:require
[yetibot.core.config :refer [get-config config-for-ns conf-valid?]]
[yetibot.core.loader :refer [find-namespaces]]
[datomico.db :as db]
[datomico.core :as dc]
[datomic.api :as api]
[taoensso.timbre :refer [info warn error]]))
(def db-ns-pattern #"(yetibot|plugins... |
Make test work with proper namespaces | (ns rill.event-store.atom-store.event-test
(:require [rill.event-store.atom-store.event :as event]
[rill.message :as message :refer [defevent]]
[rill.uuid :refer [new-id]]
[schema.core :as s]
[clojure.test :refer [deftest is]]))
(defevent MySerializableEvent
:foo s/U... | (ns rill.event-store.atom-store.event-test
(:require [rill.event-store.atom-store.event :as event]
[rill.temp-store :refer [message=]]
[rill.message :as message :refer [defevent]]
[rill.uuid :refer [new-id]]
[schema.core :as s]
[clojure.test :refer [deftest ... |
Cut everything except some assertion macros from core ns | (ns com.stuartsierra.lazytest
(:use [com.stuartsierra.lazytest.contexts
:only (context?)]
[com.stuartsierra.lazytest.arguments
:only (or-nil)]))
;;; Examples and ExampleGroups
(defrecord ExampleGroup [contexts examples])
(defn new-example-group
"Creates an ExampleGroup."
([contexts e... | (ns com.stuartsierra.lazytest)
(defmacro thrown?
"Returns true if body throws an instance of class c."
[c & body]
`(try ~@body false
(catch ~c e# true)))
(defmacro thrown-with-msg?
"Returns true if body throws an instance of class c whose message
matches re (with re-find)."
[c re & body]
`(try ~... |
Test greedy construction for 3 selected items | (ns rdf-path-examples.diversification-test
(:require [rdf-path-examples.diversification :as divers]
[clojure.set :refer [union]]
[clojure.test :refer :all]))
(deftest greedy-construction
(let [distances {#{1 2} 0.5
#{1 3} 1
#{2 3} 0.5}
distance-... | (ns rdf-path-examples.diversification-test
(:require [rdf-path-examples.diversification :as divers]
[clojure.set :refer [union]]
[clojure.test :refer :all]))
(deftest greedy-construction
(let [distances {#{1 2} 0.5
#{1 3} 1
#{1 4} 1
#... |
Increase timeout for end-to-end test | (ns yorck-ratings.core-test
(:use org.httpkit.fake
midje.sweet)
(:require [yorck-ratings.core :refer :all]
[yorck-ratings.fixtures :as fixtures]))
(fact "return rated movie infos sorted by rating"
(with-fake-http [fixtures/yorck-list-url fixtures/yorck-list-page
fix... | (ns yorck-ratings.core-test
(:use org.httpkit.fake
midje.sweet)
(:require [yorck-ratings.core :refer :all]
[yorck-ratings.fixtures :as fixtures]))
(fact "return rated movie infos sorted by rating"
(with-fake-http [fixtures/yorck-list-url fixtures/yorck-list-page
fix... |
Fix update import with korma and clojure 1.8 | (ns schedule.web.db
(:use [korma.db]
[korma.core]))
;(defdb db (sqlite3 {:db "resources/db/korma.db"}))
(defentity conventions)
| (ns schedule.web.db
(:require [korma.db :as db]
[korma.core :as core]))
;(defdb db (sqlite3 {:db "resources/db/korma.db"}))
(core/defentity conventions)
|
Clarify that you need a str | (ns icecap.handlers.http
(:require [schema.core :as s]
[aleph.http :refer [request]]
[clojure.core.async :refer [to-chan]]
[icecap.handlers.core :refer [defstep]]
[manifold.stream :refer [connect]]
[schema-contrib.core :as sc]
[taoensso.timbre :r... | (ns icecap.handlers.http
(:require [schema.core :as s]
[aleph.http :refer [request]]
[clojure.core.async :refer [to-chan]]
[icecap.handlers.core :refer [defstep]]
[manifold.stream :refer [connect]]
[schema-contrib.core :as sc]
[taoensso.timbre :r... |
Introduce notion of message handler | (ns real-dashboard.core
(:use [compojure.core :only (defroutes GET)]
ring.util.response
ring.middleware.cors
org.httpkit.server)
(:require [compojure.route :as route]
[compojure.handler :as handler]
[ring.middleware.reload :as reload]
[cheshire.core :refer :all]))
(def cl... | (ns real-dashboard.core
(:use [compojure.core :only (defroutes GET)]
ring.util.response
ring.middleware.cors
org.httpkit.server)
(:require [compojure.route :as route]
[compojure.handler :as handler]
[ring.middleware.reload :as reload]
[cheshire.core :refer :all]))
(def cl... |
Add a note about using `cluster show`. | (ns repmgr-to-zk.repmgr
(:require [clojure.java.jdbc :as j]
[clojure.string :as s]
[repmgr-to-zk.config :as config])
(:import [java.sql SQLException]))
(def default-db-config
{:dbtype "postgresql"
:dbname "repmgr"
:host "localhost"
:user "repmgr"
:password "repmgr"
:port "5... | (ns repmgr-to-zk.repmgr
(:require [clojure.java.jdbc :as j]
[clojure.string :as s]
[repmgr-to-zk.config :as config])
(:import [java.sql SQLException]))
(def default-db-config
{:dbtype "postgresql"
:dbname "repmgr"
:host "localhost"
:user "repmgr"
:password "repmgr"
:port "5... |
Remove debug code from edge.kick | (ns edge.kick.builder
(:require
[integrant.core :as ig]
[juxt.kick.alpha.core :as kick]))
(defn load-provider-namespaces
[kick-config]
(doseq [provider (keys kick-config)
:when (= (namespace provider) "kick")]
(when (= (namespace provider) "kick")
(let [sym (symbol (str "juxt.kick.alp... | (ns edge.kick.builder
(:require
[integrant.core :as ig]
[juxt.kick.alpha.core :as kick]))
(defn load-provider-namespaces
[kick-config]
(doseq [provider (keys kick-config)
:when (= (namespace provider) "kick")]
(when (= (namespace provider) "kick")
(let [sym (symbol (str "juxt.kick.alp... |
Test both RCU-sched and RCU-bh for Tiny RCU | rcupdate.rcu_self_test=1
rcupdate.rcu_self_test_bh=1
| rcupdate.rcu_self_test=1
rcupdate.rcu_self_test_bh=1
rcutorture.torture_type=rcu_bh
|
Fix bug found when every article has the same refs | (ns clojournal.models.tag
(:require [monger.collection :as mc]
[monger.query :as mq]
[monger.operators :as mo]
[clojournal.db :refer [db]]))
(defn upsert-tags! [tags]
(doseq [tag tags]
(mc/update db "tags" {:_id tag} {mo/$inc {:refs 1}} {:upsert true})))
(defn all-tags
([... | (ns clojournal.models.tag
(:require [monger.collection :as mc]
[monger.query :as mq]
[monger.operators :as mo]
[clojournal.db :refer [db]]))
(defn upsert-tags! [tags]
(doseq [tag tags]
(mc/update db "tags" {:_id tag} {mo/$inc {:refs 1}} {:upsert true})))
(defn all-tags
([... |
Make lein environ plugin as test dependency | (defproject lacinia-tut "0.1.0"
:description "A simple Lacinia tutorial"
:license {:name "MIT License"}
:dependencies [[org.clojure/clojure "1.8.0"]
[honeysql "0.9.1"]
[org.clojure/java.jdbc "0.3.5"]
[org.xerial/sqlite-jdbc "3.7.2"]
[com.walmartl... | (defproject lacinia-tut "0.1.0"
:description "A simple Lacinia tutorial"
:license {:name "MIT License"}
:dependencies [[org.clojure/clojure "1.8.0"]
[honeysql "0.9.1"]
[org.clojure/java.jdbc "0.3.5"]
[org.xerial/sqlite-jdbc "3.7.2"]
[com.walmartl... |
Add missing str->path util function. | (ns catacumba.utils
(:import ratpack.func.Action
ratpack.func.Function))
(def ^{:doc "Transducer for lowercase headers keys."}
lowercase-keys-t (map (fn [[^String key value]]
[(.toLowerCase key) value])))
(defn action
"Coerce a plain clojure function into
ratpacks's Action... | (ns catacumba.utils
(:import ratpack.func.Action
ratpack.func.Function
java.nio.file.Paths))
(def ^{:doc "Transducer for lowercase headers keys."}
lowercase-keys-t (map (fn [[^String key value]]
[(.toLowerCase key) value])))
(defn action
"Coerce a plain clojure fu... |
Drop tables first option added | (ns wishlistd.models.init
(:require [clojure.java.jdbc :as sql]))
(def db {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5432/cwl"
:user "cwl"
:password "wish"})
(defn create-wishlist []
(sql/with-connection db
(sql/create-table :wishlis... | (ns wishlistd.models.init
(:require [clojure.java.jdbc :as sql]))
(def db {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5432/cwl"
:user "cwl"
:password "wish"})
(defn create-wishlist []
(sql/with-connection db
(sql/create-table :wishlis... |
Fix typo in github repo stats widget | (ns dashboard-clj.widgets.github-repo-stats
(:require [reagent.core :as r :refer [atom]]
[dashboard-clj.widgets.core :as widget-common]
[dashboard-clj.widgets.line-chart :as charts]))
(defmethod widget-common/widget :github-repo-stats [{:keys [text data options] :as w}]
[:div {:class "gith... | (ns dashboard-clj.widgets.github-repo-stats
(:require [reagent.core :as r :refer [atom]]
[dashboard-clj.widgets.core :as widget-common]
[dashboard-clj.widgets.line-chart :as charts]))
(defmethod widget-common/widget :github-repo-stats [{:keys [text data options] :as w}]
[:div {:class "gith... |
Fix url matcher for hackerparadise | (ns faceboard.whitelabel
(:require [faceboard.env :as env]
[faceboard.helpers.utils :as utils]
[faceboard.logging :refer [log log-err log-warn log-info]]))
(def domain-mappings
[[#"fb\.local.*" "test-localhost-whitelabel"] ; just a test local host
[#"hackerparadise\.org" "hp"... | (ns faceboard.whitelabel
(:require [faceboard.env :as env]
[faceboard.helpers.utils :as utils]
[faceboard.logging :refer [log log-err log-warn log-info]]))
(def domain-mappings
[[#"fb\.local.*" "test-localhost-whitelabel"] ; just a test local host
[#".*hackerparadise\.org" "h... |
Fix js promises example in the book | (ns com.wsscode.pathom.book.async.js-promises
(:require [com.wsscode.common.async-cljs :refer [go-catch <!p]]
[goog.object :as gobj]
[com.wsscode.pathom.core :as p]
[com.wsscode.pathom.profile :as pp]))
(def reader
{:dog.ceo/random-dog-url
(fn [_]
(go-catch
(-> (j... | (ns com.wsscode.pathom.book.async.js-promises
(:require [com.wsscode.common.async-cljs :refer [go-catch <!p]]
[com.wsscode.pathom.core :as p]
[goog.object :as gobj]))
(def reader
{:dog.ceo/random-dog-url
(fn [_]
(go-catch
(-> (js/fetch "https://dog.ceo/api/breeds/image/random... |
Fix bookkeeper log command name | (ns onyx.log.commands.assign-bookkeeper-log-id
(:require [clojure.core.async :refer [>!!]]
[clojure.data :refer [diff]]
[onyx.log.commands.common :as common]
[onyx.log.entry :refer [create-log-entry]]
[schema.core :as s]
[onyx.schema :refer [Replica LogEntry... | (ns onyx.log.commands.assign-bookkeeper-log-id
(:require [clojure.core.async :refer [>!!]]
[clojure.data :refer [diff]]
[onyx.log.commands.common :as common]
[onyx.log.entry :refer [create-log-entry]]
[schema.core :as s]
[onyx.schema :refer [Replica LogEntry... |
Add a ping point for ELB. | (ns kixi.eventlog.web-server
(:require [compojure.core :refer [defroutes POST GET]]
[compojure.route :refer [not-found]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[kixi.eventlog.api :refer [index-resource]]
[org.httpkit.server :as http-kit]
... | (ns kixi.eventlog.web-server
(:require [compojure.core :refer [defroutes POST GET]]
[compojure.route :refer [not-found]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[kixi.eventlog.api :refer [index-resource]]
[org.httpkit.server :as http-kit]
... |
Configure things for running the ring server | (ns comic-reader.main
(:require [figwheel.client :as fw]))
(enable-console-print!)
(fw/start {
;; configure a websocket url if you are using your own server
;; :websocket-url "ws://localhost:3449/figwheel-ws"
;; optional callback
:on-jsload (fn [] (print "reloaded"))
... | (ns comic-reader.main
(:require [figwheel.client :as fw]))
(enable-console-print!)
(fw/start {
;; configure a websocket url if you are using your own server
:websocket-url "ws://localhost:3449/figwheel-ws"
;; optional callback
:on-jsload (fn [] (print "reloaded"))
... |
Add some sample data structures. | (ns domain.core
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.middleware.json :refer [wrap-json-body wrap-json-response]]
[ring.util.response :refer [response]])
(:gen-class))
(... | (ns domain.core
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.middleware.json :refer [wrap-json-body wrap-json-response]]
[ring.util.response :refer [response]])
(:gen-class))
(... |
Add missing csv library require | (ns clj-gatling.core
(:import (org.joda.time LocalDateTime))
(:require [clj-gatling.chart :as chart]
[clj-gatling.report :as report]
[clj-gatling.simulation :as simulation]))
(def results-dir "target/results")
(defn create-dir [dir]
(.mkdirs (java.io.File. dir)))
(defn run-simulation [s... | (ns clj-gatling.core
(:import (org.joda.time LocalDateTime))
(:require [clojure-csv.core :as csv]
[clj-gatling.chart :as chart]
[clj-gatling.report :as report]
[clj-gatling.simulation :as simulation]))
(def results-dir "target/results")
(defn create-dir [dir]
(.mkdirs (java.i... |
Switch back to node repl for now. | (require 'cljs.repl)
(require 'cljs.repl.rhino)
(cljs.repl/repl
(cljs.repl.rhino/repl-env)
:watch "src"
:output-dir "target")
| (require 'cljs.repl)
(require 'cljs.repl.node)
(cljs.repl/repl
(cljs.repl.node/repl-env)
:watch "src"
:output-dir "target")
|
Expand test coverage of web site. | (ns circle.web.test-web
(:require circle.init)
(:require [clj-http.client :as http])
(:use midje.sweet))
(circle.init/init)
(def site "http://localhost:8080")
(fact "/ returns 200"
(http/get site) => (contains {:status 200})) | (ns circle.web.test-web
(:require circle.init)
(:require [clj-http.client :as http])
(:require [clj-http.core :as core])
(:use midje.sweet))
(circle.init/init)
(def site "http://localhost:8080")
(fact "/ returns 200"
(let [response (http/get site)]
response => (contains {:status 200 :body #"Sign up"}... |
Use ClojureScript's min and max | (ns asciinema-player.util)
(defn adjust-to-range [value min-value max-value]
(.min js/Math max-value (.max js/Math value min-value)))
; Optimized js->clj implementation by Darrick Wiebe (http://dev.clojure.org/jira/browse/CLJS-844)
(defn faster-js->clj
"Recursively transforms JavaScript arrays into ClojureScript
... | (ns asciinema-player.util)
(defn adjust-to-range [value min-value max-value]
(min max-value (max value min-value)))
; Optimized js->clj implementation by Darrick Wiebe (http://dev.clojure.org/jira/browse/CLJS-844)
(defn faster-js->clj
"Recursively transforms JavaScript arrays into ClojureScript
vectors, and Jav... |
Revert "Update for CLJS-1313 testing" | (require 'cljs.repl)
(require 'cljs.repl.node)
(cljs.repl/repl (cljs.repl.node/repl-env)
:output-dir "out"
:foreign-libs [{:file "libs/greeting.js"
:provides ["greeting"]
:module-type :commonjs}
{:file "libs/german.js"
:provides ["german"]
... | (require 'cljs.repl)
(require 'cljs.build.api)
(require 'cljs.repl.node)
(def foreign-libs [{:file "libs/greeting.js"
:provides ["greeting"]
:module-type :commonjs}
{:file "libs/german.js"
:provides ["german"]
:module-type :commonjs}])
(cljs.build.api/build "src"
{:main 'foo.bar
... |
Prepare for next release cycle. | (defproject onyx-app/lein-template "0.8.11.8"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories {"snapshots" {:url "https://clojars.org/repo... | (defproject onyx-app/lein-template "0.8.11.9-SNAPSHOT"
:description "Onyx Leiningen application template"
:url "https://github.com/onyx-platform/onyx-template"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories {"snapshots" {:url "https://clojars... |
Add lein-andient plugin and jvm-opts | (defproject sqls "0.1.0-SNAPSHOT"
:description "SQLS"
:url "https://bitbucket.org/mpietrzak/sqls"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [
[org.clojure/clojure "1.6.0-beta2"]
[org.clojure/data.json "0... | (defproject sqls "0.1.0-SNAPSHOT"
:description "SQLS"
:url "https://bitbucket.org/mpietrzak/sqls"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [
[org.clojure/clojure "1.6.0-beta2"]
[org.clojure/data.json "0... |
Update Clojure dependency to 1.9.0. | ;(defproject cli4clj "1.3.2"
(defproject cli4clj "1.3.3-SNAPSHOT"
:description "Create simple interactive CLIs for Clojure applications."
:url "https://github.com/ruedigergad/cli4clj"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.cloju... | ;(defproject cli4clj "1.3.2"
(defproject cli4clj "1.3.3-SNAPSHOT"
:description "Create simple interactive CLIs for Clojure applications."
:url "https://github.com/ruedigergad/cli4clj"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.cloju... |
Add support for skipping excluded dependencies | (ns refactor-nrepl.plugin
(:require
[refactor-nrepl.core :as core]
[leiningen.core.main :as lein]))
(def ^:private external-dependencies
;; For whatever reason it didn't work to look for cider-nrepl here.
{'org.clojure/clojure "1.7.0"})
(defn- version-ok?
[dependencies artifact version-string]
(or (->... | (ns refactor-nrepl.plugin
(:require
[refactor-nrepl.core :as core]
[leiningen.core.main :as lein]))
(def ^:private external-dependencies
;; For whatever reason it didn't work to look for cider-nrepl here.
{'org.clojure/clojure "1.7.0"})
(defn- version-ok?
[dependencies artifact version-string]
(or (->... |
Allow parameterizing the ClojureScript version | (defproject planck "0.1.0"
:profiles {:dev
{:dependencies [[org.clojure/clojurescript "1.9.660"]
[org.clojure/test.check "0.10.0-alpha1"]
[tubular "1.0.0"]]
:source-paths ["dev"]}
:build-release
{}
... | (defproject planck "0.1.0"
:profiles {:dev
{:dependencies [[org.clojure/clojurescript ~(or (System/getenv "CLOJURESCRIPT_VERSION") "1.9.660")]
[org.clojure/test.check "0.10.0-alpha1"]
[tubular "1.0.0"]]
:source-paths ["dev"]}
... |
Add test for to-primitives namespace. | (ns berry.converter.to-primitives-test
(:require [berry.converter.to-primitives :refer :all]
[clojure.test :refer :all]))
(deftest primitive-types-conversion
(let [options {}]
(testing "to-boolean"
(is (and
(= "true" (to-boolean true options)))
... | |
Add stuff about no more than 1024 operations. | (ns com.nomistech.clojure-the-language.core-async-1024-pending-ops
(:require
;; [com.nomistech.clojure-the-language.core-async-1024-pending-ops :refer :all]
[clojure.core.async :as a
:exclude [map into reduce merge partition partition-by take]]
[midje.sweet :refer :all]))
(fact "About pending operations... | |
Add stateless token auth backend. | (ns buddy.auth.backends.stateless-token
(:require [buddy.auth.protocols :as proto]
[buddy.crypto.core :refer [base64->str]]
[buddy.crypto.keys :refer [make-secret-key]]
[buddy.crypto.signing :refer [loads]]
[buddy.util :refer [m-maybe]]
[clojure.string :refe... | |
Add namespace for data checking | (ns gtfve.data-check
(:require [clojure.string :as string :refer [split join trim]]
[clojure.pprint :as pp :refer [pprint]]
[clj-time.format :as tf]
[clj-time.coerce :refer [to-date]]
[clojure.instant :as instant :refer [read-instant-date]]
[datomic.api :as ... | |
Add grid, in preparation of creating hex grid. | (ns videotest.hex.core
(:require
[quil.applet :as qa :refer [applet-close]]
[quil.core :as q]
[quil.middleware :as m]))
;; Optoma Projector
;; (def DISPLAY-WIDTH 1280.0)
;; (def DISPLAY-HEIGHT 800.0)
;; Lenovo
(def DISPLAY-WIDTH 1366.0)
(def DISPLAY-HEIGHT 768.0)
;; 32 works
(def NUM-COL-BINS 64.0)
(def D... | |
Solve Average 2 in clojure | (ns main)
(defn main []
(let [a (Double/parseDouble (read-line))
b (Double/parseDouble (read-line))
c (Double/parseDouble (read-line))]
(format "%.1f" (/ (+ (* a 2.0) (* b 3.0) (* c 5.0)) 10.0))))
(println "MEDIA =" (main))
| |
Solve Time Conversion in clojure | (ns main)
(def seconds-per-hour (* 60 60))
(def seconds-per-minutes 60)
(defn main []
(loop [line (read-line)]
(when line
(let [value (Integer/parseInt line)
hours (quot value seconds-per-hour)
value (mod value seconds-per-hour)
minutes (quot value seconds-per-minutes)
... | |
Add a test for sodium init | (ns caesium.sodium-test
(:require [caesium.sodium :as s]
[clojure.test :refer [deftest is]]))
(deftest init-test
(is (#{0 1} (s/init)))
(is (= 1 (s/init))))
| |
Add a worksheet to test JLink is operational. | ;; gorilla-repl.fileformat = 1
;; **
;;; # Testing JLink
;;;
;;; You can use this worksheet to test whether JLink is set up correctly on your computer.
;; **
;; @@
(ns warm-swamp
(:require [gorilla-plot.core :as plot])
(:import [com.wolfram.jlink]))
;; @@
;; =>
;;; {"type":"html","content":"<span class='clj-nil'... | |
Add unit tests for key functions. | (ns merkle-db.key-test
(:require
[clojure.test :refer :all]
[merkle-db.key :as key])
(:import
blocks.data.PersistentBytes))
(defn ->key
"Construct a new `PersistentBytes` value containing the given byte data."
[& data]
(PersistentBytes/wrap (byte-array data)))
(deftest lexicographic-ordering
... | |
Add garden style generation with few background colors | (ns sidequarter-frontend.styles
(:require [garden.def :refer [defstylesheet defstyles defrule]]
[garden.units :refer [px]]))
(defrule horizontal-list :ul.h-list)
(defstyles screen
(horizontal-list
{:list-style-type "none"
:margin 0
:padding 0}
[:li
{:display "inline"
:margin-rig... | |
Solve 20 in Clojure (alterantive solution) | (defn solution
[]
(->> (range 1 100)
(reduce *')
(str)
(seq)
(pmap #(Character/getNumericValue %))
(reduce +)
(str)))
| |
Add namespace for performing API calls | (ns ^:figwheel-always sidequarter-frontend.api
(:require-macros [sidequarter-frontend.env :refer [cljs-env]]
[cljs.core.async.macros :refer [go]])
(:require [cljs-http.client :as http]
[cljs.core.async :refer [<! >! put! chan]]))
(def api-url (cljs-env :api-url))
(defn get-s... | |
Add data link type utility | (ns clojure-pf.data-link-type
"Supported data link type level codes."
(:require [clojure.set :refer [map-invert]]))
(def ^:private ^:const dlt-map
{:null 0 ; no link-layer encapsulation
:en10mb 1 ; ethernet (10Mb)
:ieee80211 105}) ; IEEE 802.11 wireless
(def ^:private ^:const code-map
(m... | |
Add rotating seq to onyx for experimentation. | (ns rotating-seq.core)
(defn create-r-seq [bucket-lifetime expire-interval]
(assert (zero? (mod bucket-lifetime expire-interval)) "Bucket lifetime must divide evenly over expiration interval")
(let [n-buckets (int (Math/ceil (/ bucket-lifetime expire-interval)))]
(vec (repeat n-buckets (list)))))
(defn add-to... | |
Add assertions for simple describe/is tests | (ns lazytest.describe-asserts
(:use lazytest.describe
[lazytest.expect :only (expect)]
[lazytest.testable :only (get-tests)]
[lazytest.runnable-test :only (run-tests)]
[lazytest.test-result :only (success?)]))
(remove-ns 'one)
(create-ns 'one)
(intern 'one 'a (describe "Addition"
(it "adds"
(expect (= ... | |
Add tests for the flags->rvmrc function | (ns circle.backend.test-pallet
(:use midje.sweet)
(:require [circle.backend.pallet]))
(fact "flags->rvmrc works"
(circle.backend.pallet/flags->rvmrc {:a 4 :b 6 :f "some string"})
=> "export a=4\nexport b=6\nexport f=\"some string\"\n") | |
Add unit test for Card dashboard_count :sweat: | (ns metabase.models.card-test
(:require [expectations :refer :all]
(metabase.api [card-test :refer [post-card]]
[dash-test :refer [create-dash]])
[metabase.db :refer [ins]]
(metabase.models [card :refer [Card]]
[dashboard-card ... | |
Add log command to assign bookkeeper log ids | (ns onyx.log.commands.assign-bookkeeper-log-id
(:require [clojure.core.async :refer [>!!]]
[clojure.data :refer [diff]]
[onyx.log.commands.common :as common]
[onyx.log.entry :refer [create-log-entry]]
[schema.core :as s]
[onyx.schema :refer [Replica LogEntry... | |
Solve Age in Days in clojure | (ns main)
(defn main []
(loop [line (read-line)]
(when line
(let [value (-> line
(Integer/parseInt))
years (quot value 365)
months (-> (mod value 365)
(quot 30))
days (-> (mod value 365)
(mod 30))]
... | |
Add utility for connection pools. | (ns
^{:author "Brian Craft"
:doc "c3p0 connection pool utilities."}
cavm.conn-pool
(:import (com.mchange.v2.c3p0 ComboPooledDataSource)))
(defn pool
"Create a connection pool."
[{:keys [classname subprotocol subname
user password
excess-timeout idle-timeout
minimum-pool-... | |
Add example from 3.4 - scope | (ns clojure-walkthrough.jocj.ch03-04
(use clojure.pprint)
(:gen-class))
(def MAX-CONNECTION 10)
(def RABBITMQ-CONNECTION)
(def ^:dynamic RABBITMQ-CONNECTION)
(binding [RABBITMQ-CONNECTION (new-connection)]
(
;; do something here with RABBITMQ-CONNECTION
))
;; Special variables
(def ^:dynamic *db-host... | |
Add specs for the results of parsing queries with clojure.spec/conform | (ns workflo.macros.specs.conforming-query
(:require #?(:cljs [cljs.spec :as s]
:clj [clojure.spec :as s])
#?(:cljs [cljs.spec.impl.gen :as gen]
:clj [clojure.spec.gen :as gen])
[workflo.macros.props.util :as util]
[workflo.macros.specs.query]))
;;;;... | |
Add example of SSE channel close notification | (ns yada.dev.examples
(:require
[yada.yada :as yada]
[manifold.stream :as ms]))
(defn routes []
["/examples"
[
["/sse-body" (yada/resource
{:methods
{:get {:produces "text/event-stream"
:response (fn [ctx] (ms/periodically 400 (fn [] "foo")))}}})]
["... | (ns yada.dev.examples
(:require
[yada.yada :as yada]
[manifold.stream :as ms]
[manifold.deferred :as d]))
(defn routes []
["/examples"
[
["/sse-resource" (yada/handler (ms/periodically 400 (fn [] "foo")))]
["/sse-body"
(yada/resource
{:methods
{:get {:produces "text/event-stre... |
Add utilities to deal with the pipeline2 web service api | (ns mdr2.pipeline2.utils
"Utilities for dealing with the [Pipeline2 Web Service
API](https://code.google.com/p/daisy-pipeline/wiki/WebServiceAPI)"
(:require [clojure.zip :refer [xml-zip]]
[clojure.data.zip.xml :refer [xml1-> attr]]
[mdr2.pipeline2.core :as dp2]))
(def ^:private poll-inter... | |
Solve Area of a Circle in clojure | (ns main)
(defn main []
(let [n (Double/parseDouble (read-line))]
(format "%.4f" (* (* n n) 3.14159))))
(printf "A=%s%n" (main))
| |
Add a migration library, call it on startup | (ns circle.db.migration-lib
"Library for performing DB migrations in mongo"
(:require [somnium.congomongo :as mongo])
(:use [clojure.tools.logging :only (infof)])
(:use [arohner.utils :only (inspect)]))
(defonce migrations (ref []))
(defn clear-migrations []
(dosync
(alter migrations (constantly []))))
... | |
Add beginnings of clojure.spec examples | (ns com.nomistech.clojure-the-language.c-200-clojure-basics.s-600-clojure-spec
(:require [clojure.spec.alpha :as s]
[midje.sweet :refer :all]))
;;;; ___________________________________________________________________________
;;;; Stuff from https://clojure.org/guides/spec
(fact
(s/conform even? 1000)
... | |
Add blob unpack hooks for h2. | (ns cavm.h2-unpack-rows)
; The following a mechanism to avoid a direct dependency on other cavm code
; that should not be aot compiled.
; This file has to be aot compiled so h2 can find it (or so I'm lead to believe).
; However a dependency on other files causes them to be affected by the aot. This
; messes up dynami... | |
Add transmit lib error test | (ns cmr.transmit.test.echo.rest
"Tests for cmr.transmit.echo.rest namespace"
(:require [clojure.test :refer :all]
[cmr.transmit.echo.rest :as rest]))
(deftest test-error-masked
(let [error-message "Unexpected error message: Token 123 does not exist."
status 500]
(is (= (format "Unexpected ... | |
Add tests for subs in clj | (ns re-frame.subs-test
(:require [clojure.test :refer :all]
[re-frame.subs :as subs]
[re-frame.db :as db]))
(defn fixture-re-frame
[f]
(let [restore-re-frame (re-frame.core/make-restore-fn)]
(f)
(restore-re-frame)))
(use-fixtures :each fixture-re-frame)
(deftest test-reg-sub-... | |
Add example of putting functions on channels | (ns com.nomistech.clojure-the-language.c-800-libraries.s-300-core-async.ss-010-core-async-functions-on-channels
(:require [clojure.core.async :as a]
[midje.sweet :refer :all]))
;;;; You can put functions on channels.
;;;; - That's cool.
;;;; - But should you?
;;;; - Maybe it makes debugging harder.
;;;... | |
Add specs for the data format resulting from parsing queries | (ns workflo.macros.specs.parsed-query
(:require #?(:cljs [cljs.spec :as s]
:clj [clojure.spec :as s])
#?(:cljs [cljs.spec.impl.gen :as gen]
:clj [clojure.spec.gen :as gen])
[workflo.macros.props.util :as util]
[workflo.macros.specs.query]))
(s/def :... | |
Add ip resolver to get lat/long. | (ns forecast.repository.ip-locator
(:require [clj-http.client :as client]
[cheshire.core :refer [parse-string]]
[clojure.string :refer [split]]
))
(defn ip->location
[ip]
(try
(let [url (str "http://ipinfo.io/" ip)
response (client/get url {:accept :json :socket-... | |
Add some basic hipchat tests | (ns riemann.hipchat-test
(:use riemann.hipchat
clojure.test)
(:require [riemann.logging :as logging]))
(def api-key (System/getenv "HIPCHAT_API_KEY"))
(def room (System/getenv "HIPCHAT_ALERT_ROOM"))
(def alert_user "Riemann_HC_Test")
(when-not api-key
(println "export HIPCHAT_API_KEY=\"...\" to run thes... | |
Add first round of self-tests | (ns com.stuartsierra.lazytest-spec
(:use [com.stuartsierra.lazytest
:only (describe spec spec?
is given defcontext
context? ok? success?
pending? error? container?)]))
(defcontext dummy-context-1 [] 1)
(defcontext is-without-givens ... | |
Test for the module db-interface + basic checks | ;
; (C) Copyright 2017 Pavel Tisnovsky
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
; http://www.eclipse.org/legal/epl-v10.html
;
; Contributors:
; Pavel... | |
Change CMR_GENERIC_DOCUMENTS DOCUMENT_NAME column size from 20 to 1020. | (ns cmr.metadata-db.migrations.087-update-generic-document-name-length
(:require
[config.mdb-migrate-helper :as h]))
(defn up
"Migrates the database up to version 87."
[]
(println "cmr.metadata-db.migrations.087-update-generic-document-name-length up...")
(h/sql "alter table METADATA_DB.CMR_GENERIC_DOCUME... | |
Add a test for new hiccup/prxml/sexp-based xml style | ; Copyright (c) Rich Hickey. All rights reserved.
; 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 ... | |
Add simple integration test for system startup/shutdown | (ns integration.braid.system-start-stop-test
(:require [braid.core :refer :all]
[clojure.test :refer :all]))
(deftest start-stop
(is (start! 0))
(is (stop!)))
| |
Add tests for server side views | (ns subman.t-views
(:require [midje.sweet :refer [fact truthy]]
[subman.views :as views]))
(fact "index page should be ok"
(views/index-page) => truthy)
| |
Add the complete example for simple object system! | (ns clojure.clojure-walkthrough.cjia.ch08-object)
;; The complete simple object system for Clojure
(declare ^:dynamic this)
(declare find-method)
(defn new-object [klass]
(let [state (ref {})]
(fn thiz [command & args]
(case command
:class klass
:class-name (klass name)
:set! (le... | |
Add docs of the whole-ast structure & helpers | ;; 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 th... | |
Add form to query argweb's ElasticSearch | (ns discuss.components.search.statements
(:require [clojure.walk :refer [keywordize-keys]]
[goog.crypt.base64 :as b64]
[om.next :as om :refer-macros [defui]]
[sablono.core :as html :refer-macros [html]]
[ajax.core :refer [GET POST]]
[discuss.specs :as specs]... | |
Test for missing documentation on defaults | (ns onyx.doc-test
(:require [taoensso.timbre :refer [info] :as timbre]
[clojure.test :refer [deftest is testing]]
[onyx.static.default-vals :refer [defaults]]
[onyx.information-model :refer [model]]))
(deftest missing-documentation-test
(is (empty? (remove (apply merge (map :mod... | |
Add a few more fields to pom-to-map. | (ns clojars.maven
(:require [clojure.java.io :as io])
(:import org.apache.maven.model.io.xpp3.MavenXpp3Reader))
(defn model-to-map [model]
{:name (.getArtifactId model)
:group (.getGroupId model)
:version (.getVersion model)
:description (.getDescription model)
:homepage (.getUrl model)
:authors (... | (ns clojars.maven
(:require [clojure.java.io :as io])
(:import org.apache.maven.model.io.xpp3.MavenXpp3Reader))
(defn model-to-map [model]
{:name (.getArtifactId model)
:group (.getGroupId model)
:version (.getVersion model)
:description (.getDescription model)
:homepage (.getUrl model)
:url (.get... |
Add a classpath-resource to serve files from classpath | (ns yada.resources.classpath-resource
(:require
[clojure.java.io :as io]
[clojure.string :as str]
[yada.resource :refer [resource]]
[yada.protocols :refer [as-resource]]))
(defn new-classpath-resource
"Create a new classpath resource that resolves requests with
path info in the active classpath, rel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.