Skip to content

Instantly share code, notes, and snippets.

@Jaretbinford
Jaretbinford / Jetty Dep test
Created December 7, 2017 01:20
[com.datomic/clj-client "0.8.606"] [org.clojure/core.async "0.3.465"] & [ring 1.6.0] or [ring 1.6.3] result in error
;project.clj
;(defproject depstest "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.9.0-alpha19"]
; [ring "1.6.3"]
; [com.datomic/clj-client "0.8.606"]
@Jaretbinford
Jaretbinford / limit.clj
Created November 10, 2017 14:12
testing limit nil
(ns releasetest.limit)
(require '[datomic.api :as d])
(d/get-database-names "datomic:dev://localhost:4334/*")
(def uri "datomic:dev://localhost:4334/mbrainz-1968-1973")
(def conn (d/connect uri))
(def db (d/db conn))
grep -oE ":GarbageSegments .*?}" datomicmetrics48hrsorted.json
@Jaretbinford
Jaretbinford / diff.txt
Created August 1, 2017 14:46
Two directories
$ diff -rq ~/Downloads/datomic-console-0.1.216 ~/Downloads/datomic-console-0.1.214
Files /Users/jbin/Downloads/datomic-console-0.1.216/README-CONSOLE.md and /Users/jbin/Downloads/datomic-console-0.1.214/README-CONSOLE.md differ
Only in /Users/jbin/Downloads/datomic-console-0.1.214/lib/console: datomic-console-0.1.214.jar
Only in /Users/jbin/Downloads/datomic-console-0.1.216/lib/console: datomic-console-0.1.216.jar
Only in /Users/jbin/Downloads/datomic-console-0.1.214/lib/console: jetty-util-8.1.11.v20130520.jar
Only in /Users/jbin/Downloads/datomic-console-0.1.214/lib/console: jetty-webapp-8.1.11.v20130520.jar
Only in /Users/jbin/Downloads/datomic-console-0.1.216/lib/console: jetty-webapp-9.3.7.v20160115.jar
Only in /Users/jbin/Downloads/datomic-console-0.1.214/lib/console: jetty-xml-8.1.11.v20130520.jar
Only in /Users/jbin/Downloads/datomic-console-0.1.216/lib/console: jetty-xml-9.3.7.v20160115.jar
@Jaretbinford
Jaretbinford / entityQuery
Created June 2, 2017 14:50
Re-create for case
(ns entitytest
(:require [clojure.core.async :refer (<!!)]
[datomic.client :as client]
[datomic.api :as d]))
(def db-uri "datomic:dev://localhost:4334/entity")
(d/create-database db-uri)
(def conn (d/connect db-uri))
@Jaretbinford
Jaretbinford / benchmarkresults.clj
Created March 10, 2017 19:07
Using 5561 transactor local dev
Starting nREPL server...
/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -Dpython.cachedir.skip=true -XX:MaxPermSize=500M -verbose:gc -XX:+PrintGCDetails -Xloggc:gclog -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=20 -XX:GCLogFileSize=128M -XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError -Xms2G -XX:-OmitStackTraceInFastThrow -Xmx2G -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dclojure.compile.path=/Users/jbin/Desktop/Jaret/Projects/workproof/pullperf/Cook/scheduler/target/classes -Dcook.version=1.0.1-SNAPSHOT -Dclojure.debug=false -Didea.launcher.port=7537 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA CE.app/Contents/bin" -classpath "/Users/jbin/Desktop/Jaret/Projects/workproof/pullperf/Cook/scheduler/test:/Users/jbin/Desktop/Jaret/Projects/workproof/pullperf/Cook/scheduler/src:/Users/jbin/Desktop/Jaret/Projects/workproof/pullperf/Cook/scheduler/test-resources:/Users/jbin/Desktop/Jaret/Projects/work
@Jaretbinford
Jaretbinford / core.clj
Created January 30, 2017 18:54
merge attributes and add :db/fulltext to an already created attribute
;****How to Merge two attributes in Datomic.****
;
;Our database has recorded two attributes for a user. The user's e-mail and the users username.
;The username is required to be the e-mail for the user. Due to a design decision, e-mails will no longer
;be recorded. As such we need to depricate the e-mail attribute and merge it to our username attribute to ensure
;all e-mails represent usernames.
;
;The steps to this process are as follows:
;
;1. Rename the old attribute (i.e. :user/email to :user/email-deprecated)
@Jaretbinford
Jaretbinford / merge_.gitignore
Created January 30, 2017 18:53
Merge attributes/add FULLTEXT to an attribute
/target
/classes
/checkouts
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
.hgignore
@Jaretbinford
Jaretbinford / peermetrics.txt
Created January 18, 2017 13:59
metrics reported from the peer
The Datomic Pro peer can create the following CloudWatch metrics:
-----------------------------------PEER METRICS
|-------------------------------+------------+---------------+-----------------------------------------------------------------------------+
| Metric | Units | Statistic | Description |
|-------------------------------+------------+---------------+-----------------------------------------------------------------------------+
| AvailableMB | MB | minimum | unused RAM on peer * |
@Jaretbinford
Jaretbinford / peermetrics.txt
Created January 18, 2017 13:58
metrics reported from the peer
The Datomic Pro peer can create the following CloudWatch metrics:
-----------------------------------PEER METRICS
|-------------------------------+------------+---------------+-----------------------------------------------------------------------------+
| Metric | Units | Statistic | Description |
|-------------------------------+------------+---------------+-----------------------------------------------------------------------------+
| AvailableMB | MB | minimum | unused RAM on peer * |