This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns scratch | |
(:require [datomic.api :as d])) | |
(def u "datomic:mem://component-test") | |
(d/delete-database u) | |
(d/create-database u) | |
(def c (d/connect u)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:environment :production | |
:global {:logging-config "./logback.xml"} | |
:onyx {:job-scheduler :onyx.job-scheduler/balanced | |
:task-scheduler :onyx.task-scheduler/balanced | |
:peer-config {:onyx.messaging/impl :netty | |
:onyx.messaging/peer-port-range [40200 40220] | |
:onyx.messaging/peer-ports [40199] | |
:onyx.messaging/bind-addr "localhost" | |
:onyx.messaging/backpressure-strategy :high-restart-latency} | |
:peer-count 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [dt #(-> (clj-time.core/date-time 2015 % %2) | |
clj-time.coerce/to-date) | |
now (d/db (d/connect (db/database-uri :main)))] | |
[(db/conn (db/database-uri :main)) | |
(vec | |
(for [db [now ;; 29th July 2015 | |
(-> now | |
(d/since (dt 2 1))) ;; 1st Feb 2015 | |
(-> now | |
(d/as-of (dt 2 1))) ;; 1st Feb 2015 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns onyx-tx-report-queue | |
(:require [clojure.core.async :refer [>!! alts!! chan close! put! thread]] | |
[clojure.tools.logging :as log] | |
;; :all so clj-refactor doesn't remove it: | |
[onyx.plugin.core-async :refer :all] | |
[datomic.api :as d]) | |
(:import [java.util.concurrent TimeUnit])) | |
(defn prepare-datom [db [e a v tx added]] | |
[e (d/ident db a) v tx added]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15-Aug-19 22:29:18 MacBook-Pro.local WARN [onyx.peer.task-lifecycle] - | |
java.lang.Thread.run Thread.java: 745 | |
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617 | |
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142 | |
... | |
clojure.core.async/thread-call/fn async.clj: 405 | |
onyx.peer.task-lifecycle.TaskLifeCycle/fn task_lifecycle.clj: 706 | |
onyx.peer.task-lifecycle/run-task-lifecycle task_lifecycle.clj: 431 | |
onyx.peer.task-lifecycle/write-batch task_lifecycle.clj: 304 | |
onyx.plugin.datomic.DatomicLogInput/write-batch datomic.clj: 255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; using Clojure 1.9-alpha7 | |
(ns keys-with-and-question | |
(:require [clojure.spec :as s] | |
[clojure.spec.gen :as gen])) | |
(s/def ::id string?) | |
(s/def ::active? boolean?) | |
(s/def ::extra int?) | |
(s/def ::base (s/keys :req-un [::id] :opt-un [::active?])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns magic-the-gathering-card-spec | |
(:require [clojure.spec :as s] | |
[clojure.spec.gen :as gen])) | |
(s/def ::pos-int (s/and int? (complement neg?))) | |
(s/def ::set string?) | |
(s/def ::set-number ::pos-int) | |
(s/def ::artist string?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(when (window-system) | |
(set-default-font "Fira Code")) | |
(let ((alist '((33 . ".\\(?:\\(?:==\\|!!\\)\\|[!=]\\)") | |
(35 . ".\\(?:###\\|##\\|_(\\|[#(?[_{]\\)") | |
(36 . ".\\(?:>\\)") | |
(37 . ".\\(?:\\(?:%%\\)\\|%\\)") | |
(38 . ".\\(?:\\(?:&&\\)\\|&\\)") | |
(42 . ".\\(?:\\(?:\\*\\*/\\)\\|\\(?:\\*[*/]\\)\\|[*/>]\\)") | |
(43 . ".\\(?:\\(?:\\+\\+\\)\\|[+>]\\)") | |
(45 . ".\\(?:\\(?:-[>-]\\|<<\\|>>\\)\\|[<>}~-]\\)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns cognician.db.translate | |
(:require [datomic.api :as d]) | |
(:import [clojure.lang MapEntry] | |
[datomic.query EntityMap])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Language | |
(def default-language :en-GB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS_ACCESS_KEY_ID: ABCDEFGHIJKLMNOPQRSTUVWXYZ | |
AWS_SECRET_ACCESS_KEY: supercalifragilisticexpialidocious | |
# more: values | |
# go: here |