This file contains hidden or 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
| (defn parse-reader [^Reader reader] | |
| (-> reader | |
| (BufferedReader. 0xFFFF) | |
| (.lines) | |
| (.skip 1) | |
| (.map (reify Function | |
| (apply [_ line] | |
| (-> line | |
| (data.csv/read-csv) | |
| (ffirst) |
This file contains hidden or 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
| BOOLEAN (java.lang.Boolean) | |
| INT2 (java.lang.Short) | |
| INT4 (java.lang.Integer) | |
| INT8 (java.lang.Long) | |
| FLOAT4 (java.lang.Float) | |
| FLOAT8 (java.lang.Double) | |
| CHAR (java.lang.String) | |
| VARCHAR (java.lang.String) | |
| TEXT (java.lang.String) | |
| ENUM (java.lang.String) |
This file contains hidden or 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 pg.client-test | |
| (:import | |
| com.github.igrishaev.Connection) | |
| (:import | |
| java.io.ByteArrayInputStream | |
| java.io.ByteArrayOutputStream | |
| java.time.Instant | |
| java.time.LocalDate | |
| java.time.LocalDateTime | |
| java.time.LocalTime |
This file contains hidden or 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
| package com.github.igrishaev; | |
| import clojure.lang.PersistentVector; | |
| import clojure.lang.PersistentVector$TransientVector; | |
| public class VectorReducer implements IReducer<PersistentVector$TransientVector, PersistentVector> { | |
| PersistentVector$TransientVector initiate() { | |
| return PersistentVector.EMPTY().asTransient(); | |
| } |
This file contains hidden or 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
| var Circle = { | |
| PI: 3.1415, | |
| init: | |
| function (x) { | |
| var obj = Object.create(Circle); | |
| obj.x = x; | |
| return obj; |
This file contains hidden or 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
| (as-manager ... | |
| ) | |
| (with-context [foo1 {} | |
| bar2 {}] | |
| ) | |
| (do |
This file contains hidden or 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
| (letfn [(->iter [coll] | |
| (clojure.lang.RT/iter coll)) | |
| (has-next? [iter] | |
| (.hasNext ^java.util.Iterator iter)) | |
| (next! [iter] | |
| (.next ^java.util.Iterator iter))] | |
| (defn map! | |
| ([f coll] | |
| (mapv f coll)) | |
| ([f coll & colls] |
This file contains hidden or 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 repl | |
| (:require | |
| [pg.client :as pg])) | |
| (def config | |
| {:host "127.0.0.1" | |
| :port 10150 | |
| :user "test" | |
| :password "test" | |
| :database "test"}) |
This file contains hidden or 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
| (defn gipz-encode ^bytes [^bytes input] | |
| (let [in | |
| (new ByteArrayInputStream input) | |
| out-bytes | |
| (new ByteArrayOutputStream) | |
| out-gzip | |
| (new GZIPOutputStream out-bytes true) |
This file contains hidden or 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 any-refs | |
| (some-fn :venue | |
| :tour | |
| :media | |
| :ticket-classes | |
| :orders | |
| :tickets | |
| :purchaser | |
| :attendee)) |