I hereby claim:
- I am terjesb on github.
- I am terjesb (https://keybase.io/terjesb) on keybase.
- I have a public key ASCs6Fb0IkKiaWnHlzmw-wss8s4NI5EUOs8k-wynxTREwgo
To claim this, I am signing this object:
(ns datomic-helpers | |
(:require [clojure.java.io :as io] | |
[clojure.walk :as walk] | |
[datomic.api :as d :refer (db)])) | |
;;; Expose Datomic vars here, for convenience | |
(def tempid d/tempid) | |
(def connect d/connect) | |
(def create-database d/create-database) |
{:paths ["."] | |
:deps | |
{com.datomic/datomic-free {:mvn/version "0.9.5656"}}} |
(ns lucenalog.core | |
"Lucenalog = Datalog interface to Lucene in 10 lines. | |
Simple but powerful. | |
Use | |
(db/add (index) {:a \"foo\" :b \"bar\"}) | |
to index a map with Lucene. Then you can use the relation |
;; Adds support to Transit for emitting Joda DateTimes in the same format as standard java.util.Date. | |
;; Dependencies: [clj-time "0.9.0"] and [com.cognitect/transit-clj "0.8.259"] (newer version will likely still work) | |
(require '[cognitect.transit :as transit]) | |
(require '[clj-time.coerce :as coerce]) | |
(import '[java.io ByteArrayOutputStream]) | |
(def ^:private joda-time-verbose-handler | |
(transit/write-handler |
(ns cognician.db.translate | |
(:require [datomic.api :as d]) | |
(:import [clojure.lang MapEntry] | |
[datomic.query EntityMap])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Language | |
(def default-language :en-GB) |
(require '[datomic.api :as d]) | |
(defn maybe-assoc [m k v] | |
(if v (assoc m k v) m)) | |
(defmacro defn-db [name & args] | |
(let [[doc-string & args] (if (string? (first args)) args (cons nil args)) | |
[attr-map & args] (if (map? (first args)) args (cons {} args)) | |
[[& params] & body] args |
(def payment-codes-per-block 4096) | |
(defn create-payment-code-feed | |
[db] | |
(let [payment-code-feed (chan 10)] | |
(go-loop [] | |
(let [block-id (allocate-block db) | |
block-start (* block-id payment-codes-per-block)] | |
(-> (onto-chan payment-code-feed | |
(->> |
I hereby claim:
To claim this, I am signing this object:
(ns bpsmannschott | |
(:import java.io.File) | |
(:import java.io.FileNotFoundException)) | |
(defn as-file [s] | |
"Return whatever we have as a java.io.File object" | |
(cond (instance? File s) s ; already a file, return unchanged | |
(string? s) (File. s) ; return java.io.File for path s | |
:else (throw (FileNotFoundException. (str s))))) |
(defn optify | |
"Helper that examines paths with the supplied prefix and either subs | |
in their cache-busting URLs or returns them unchanged." | |
[req prefix] | |
(fn [^String src] | |
(or (and (.startsWith src prefix) | |
(not-empty (link/file-path req src))) | |
src))) | |