Skip to content

desmondrawls/clojure-interop-demo

Repository files navigation

Run configurations

$ cd hypeman
$ mvn clean spring-boot:run -Dposers //currently no config file for this
$ mvn clean spring-boot:run -Dpersistent

Environment variables

AWS credentials can be exported by sourcing aws-credentials in the untracked datomic folder.

GPG for datomic

http://semperos.com/post/gpg-and-leiningen/
https://github.com/jamesmartin/datomic-tutorial

lein help gpg

To turn off the password check make sure that you have "use-agent" option explicitly enabled in ~/.gnupg/gpg.conf. See gpg option list.

You can test the config and unlock the gpg key with

gpg --quiet --batch --decrypt ~/.lein/credentials.clj.gpg

Datomic

Getting Started
Account Portal
Exceptions
Pipelines and Channels
Videos (Clients in Control!)

To start the transactor from the datomic home directory:

bin/transactor ensured-recording-studio.properties

Migrations

$ lein migrate

Pull example

(def entity-query '[:find [?e ...]
                    :where
                    [?e :question/text ?text]
                    [?e :question/time ?time]
                    [?e :question/source-identifier ?source-identifier]])

(defn pull-questions
  []
  (let [db (connection/db)]
    (->> (d/q entity-query db)
      seq
      (map #(d/pull db '[*] %)))))

Leiningen + Maven

Currently to make this work I am maintaining a pom.xml and a project.clj for the recording studio package. Sometimes Leiningen overwrites the pom.xml in which case packaging the jar with maven stops working. The indications that this happened are that the recording studio beans module cant resolve the recording_studio namespace.

Clojure Links

https://clojure.org/guides/destructuring

Kotlin Links

Mike Gehard on Success/Failure: http://engineering.pivotal.io/post/algebraic-data-types-in-kotlin/
Discussion of Algebraic Data Types: https://discuss.kotlinlang.org/t/sealed-class-and-algebraic-data-type/2594/2

Reflection

cd reflection
rlwrap lein run -m clojure.main script/figwheel.clj

Reflection

cd reflection
lein repl
>> (dev)
>> (go)

To load changes:

>> (reset)

Tools to install

brew install rlwrap

Om Next Links

Om Next for React devs
Om Cljs wiki
Remoting example
David Nolen's innovation philosophy

Bowling

curl localhost:8080/games/new
curl "localhost:8080/games/e725fca7-3111-4178-b9d8-cff45a791fe4/rolls/new?rolls=1&rolls=9&pins=2"
curl -H "Content-Type: application/json" -X POST -d '{"identifier":"e725fca7-3111-4178-b9d8-cff45a791fe4", "rolls":["1", "9", "5", "5", "1", "99", "2"]}' localhost:8080/games
curl localhost:8080/games/e725fca7-3111-4178-b9d8-cff45a791fe4
curl "localhost:8080/games/e725fca7-3111-4178-b9d8-cff45a791fe4/score?rolls=1&rolls=9&rolls=5&rolls=5&rolls=99&rolls=2"

curl https://bowling-kata.cfapps.io/games/new
curl "https://bowling-kata.cfapps.io/games/e725fca7-3111-4178-b9d8-cff45a791fe4/rolls/new?rolls=1&rolls=9&pins=2"
curl -H "Content-Type: application/json" -X POST -d '{"identifier":"e725fca7-3111-4178-b9d8-cff45a791fe4", "rolls":["1", "9", "5", "5", "1", "99", "2"]}' https://bowling-kata.cfapps.io/games
curl https://bowling-kata.cfapps.io/games/e725fca7-3111-4178-b9d8-cff45a791fe4
curl "https://bowling-kata.cfapps.io/games/e725fca7-3111-4178-b9d8-cff45a791fe4/score?rolls=1&rolls=9&rolls=5&rolls=5&rolls=99&rolls=2"

curl https://bowling-transform.cfapps.io/games/new
curl "https://bowling-transform.cfapps.io/games/30e2d1fe-2681-44df-a967-4478e10a651b/rolls/new?rolls=1&rolls=9&pins=2"
curl -H "Content-Type: application/json" -X POST -d '{"identifier":"30e2d1fe-2681-44df-a967-4478e10a651b", "rolls":["1", "9", "5", "5", "1", "99", "2"]}' https://bowling-sink.cfapps.io/games
curl https://bowling-source.cfapps.io/games/30e2d1fe-2681-44df-a967-4478e10a651b
curl "https://bowling-transform.cfapps.io/games/30e2d1fe-2681-44df-a967-4478e10a651b/score?rolls=1&rolls=9&rolls=5&rolls=5&rolls=99&rolls=2"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors