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
; Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/ | |
; in project.clj dependencies | |
; [com.impossibl.pgjdbc-ng/pgjdbc-ng "0.5"] | |
(ns pglisten.core | |
(:import [com.impossibl.postgres.jdbc PGDataSource] | |
[com.impossibl.postgres.api.jdbc PGNotificationListener])) |
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
(def json-raw | |
[{"type" "t1" | |
"weather" { "lat" 1 | |
"lon" 2}} | |
{"type" "t2" | |
"weather" { "lat" 3 | |
"lon" 4 | |
"abc" {"xyz" 5}}}]) |
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
(defmacro short-> | |
"Short circuit pipeline/threading operator that shorts on given condition." | |
[init & steps-and-conditions] | |
(let [check (-> (take-last 2 steps-and-conditions) | |
((fn [conditions] (if-not (and (= (count conditions) 2) | |
(= (first conditions) :on)) | |
(throw (Exception. "Invalid conditions function syntax.")) | |
(second conditions))))) |
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
open System | |
open Npgsql | |
type Category = { | |
id: int; | |
name: string | |
} | |
let categoriesSQL = " |
This guide is intended to help you get started with CLJS.
An important note: CLJS is best experienced when developing and testing interactively against a live running instance of your application. In this way it's different than most other languages which use an edit/compile/restart method of working. While it is technically possible to use an edit/compile/restart workflow, if you use it with CLJS, you're gonna have a bad time.
{Embedded Video of Tools Installation}
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
{ | |
:builds | |
{:tool | |
{:src ["src"] | |
:compiler {:main "tool.core" | |
:target :nodejs | |
:optimizations :simple | |
:output-to "target/tool.js"}} |
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
cat /root/.npm/_logs/2017-09-10T04_24_41_517Z-debug.log | |
0 info it worked if it ends with ok | |
1 verbose cli [ '/usr/bin/node', | |
1 verbose cli '/usr/bin/npm', | |
1 verbose cli 'install', | |
1 verbose cli '-g', | |
1 verbose cli 'https://github.com/reasonml/reason-cli/archive/beta-v-1.13.6-bin-linux.tar.gz' ] | |
2 info using [email protected] | |
3 info using [email protected] | |
4 verbose npm-session 0543e7aa71cf9ceb |
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
cat /home/mike/.npm/_logs/2017-09-10T06_57_33_782Z-debug.log | |
0 info it worked if it ends with ok | |
1 verbose cli [ '/usr/bin/nodejs', | |
1 verbose cli '/usr/bin/npm', | |
1 verbose cli 'install', | |
1 verbose cli '-g', | |
1 verbose cli 'https://github.com/reasonml/reason-cli/archive/beta-v-1.13.7-bin-linux.tar.gz' ] | |
2 info using [email protected] | |
3 info using [email protected] | |
4 verbose npm-session f664dd009f0ec190 |
~/.clojure/deps.edn
file
{:1.8 {:override-deps {org.clojure/clojure {:mvn/version "1.8.0"}}}
:1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0"}}}
:master {:override-deps {org.clojure/clojure {:mvn/version "1.10.0-master-SNAPSHOT"}}}
:test {:extra-paths ["test"]}
:bench {:extra-deps {criterium {:mvn/version "0.4.4"}}}
:proto {:extra-deps {proto-repl {:mvn/version "RELEASE"}}}