Datomic pro with Postgresql Setup
Prep
- Get evaluation license key : http://my.datomic.com/eval/request
- Download pro version : http://downloads.datomic.com/pro.html
Setups
- Dev mode setup
(defn write-file [filename file] | |
(with-open [w (clojure.java.io/output-stream filename)] | |
(.write w (:body file)))) | |
(let [base-uri "http://google.com" | |
img-path (-> (get-page base-uri) | |
(first-by-xpath "//img[@alt='Google']") | |
(comp :src attrs)) | |
img-url (str base-uri img-path)] | |
(->> (clj-http.client/get img-uri {:as :byte-array |
I hereby claim:
To claim this, I am signing this object:
;; | |
;; paths | |
;; | |
(setq system-uses-terminfo nil) | |
(add-to-list 'exec-path (expand-file-name "~/bin")) | |
(add-to-list 'exec-path (expand-file-name "/usr/local/bin")) | |
(setenv "PATH" (concat (expand-file-name "~/bin") | |
":/usr/local/bin:" |
(defn devin [walters] | |
(println "yep, it works...")) |
(ns twitjure | |
(:use clojure.core) | |
(:use clojure.contrib.http.connection) | |
(:use clojure.contrib.base64) | |
(:use clojure.contrib.duck-streams)) | |
(defn get-stream [] | |
(let [conn #^java.net.HttpURLConnection | |
(http-connection "http://stream.twitter.com/1/statuses/sample.json")] | |
(.setDoInput conn true) |
(defn take-tweets [n] | |
(take n (map read-json | |
(line-seq (reader | |
(get-stream)))))) | |
(defn tweet-text [n] | |
(map #(get % "text") | |
(take-tweets n))) | |
(defn search-text [s coll] |
va.lang.NullPointerException | |
[Thrown class java.lang.RuntimeException] | |
Restarts: | |
0: [ABORT] Return to SLIME's top level. | |
1: [CAUSE] Throw cause of this exception | |
Backtrace: | |
0: clojure.lang.LazySeq.sval(LazySeq.java:47) | |
1: clojure.lang.LazySeq.seq(LazySeq.java:63) |
(ns doc-ns | |
(:gen-class) | |
[:use clojure.contrib.duck-streams | |
compojure]) | |
(defn sort-ns | |
"Sorts the keys from the map returned by ns-publics for a given nspace into alphabetical order." | |
[nspace] | |
(sort (keys (ns-publics nspace)))) |
(ns doc-ns.core | |
(:gen-class) | |
[:use clojure.contrib.duck-streams | |
compojure]) | |
(defn sort-ns | |
"Sorts the keys from the map returned by ns-publics for a given nspace into alphabetical order." | |
[nspace] | |
(sort (keys (ns-publics nspace)))) |