Skip to content

Instantly share code, notes, and snippets.

(def-sproc get-domain get-domain-sproc
[:domain-url]
(->> cursor
single
(into {})))
@aamedina
aamedina / gist:45ce0aabd27b62659bb0
Last active August 29, 2015 14:02
thread safe get unsigned big endian integer from little endian byte buffer
(defn get-uint
([buf] (get-uint buf (.position buf)))
([buf pos]
(-> (byte-array (map #(.get buf %) (range pos (+ pos 4))))
(ByteBuffer/wrap)
(.getInt)
(bit-and 0xffffffff))))
(defonce datomic-downloads-page
(let [url (java.net.URL. "https://my.datomic.com/downloads/free")]
(html/html-resource url)))
(defn scrape-latest-version
[]
(let [row (first (html/select datomic-downloads-page [:table#downloads-table :tbody :tr]))
version-td (nth (filter map? (:content row)) 2)]
(first (:content version-td))))
@aamedina
aamedina / datomic.clj
Last active August 29, 2015 14:02
leiningen datomic plugin
(ns leiningen.datomic
(:require [net.cgrand.enlive-html :as html]
[clojure.tools.namespace.repl :refer [refresh-all]]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.java.shell :refer [sh]])
(:import (java.io File RandomAccessFile)
(java.net URL)
(java.util.zip ZipEntry ZipInputStream)))
'(do (try (if listing-id
(.setInt G__17004 1 listing-id)
(.setNull G__17004 1 OracleTypes/INTEGER))
(catch java.lang.Exception e__16935__auto__
(throw (clojure.core/ex-info "Error while setting: listing-id"
{:value listing-id,
:type (quote OracleTypes/INTEGER),
:setter (quote .setInt),
:order 1} e__16935__auto__))))
(try (.setNull G__17004 2 OracleTypes/INTEGER)
(def
get-property-domain-info
(clojure.core/fn
([listing-id conn__19110__auto__]
(clojure.core/with-open
[G__19148
(.prepareCall
conn__19110__auto__
"{ call products.p_get_property_info (?,?,?) }")]
(do
{:size 649762, :type "SKMG", :children [{:size 649750, :type "0004", :children [{:size 44, :type "INFO", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=44 cap=44]>} {:size 30, :type "SKTM", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=30 cap=30]>} {:size 297, :type "XFNM", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=297 cap=297]>} {:size 49260, :type "POSN", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=49260 cap=49260]>} {:size 16420, :type "TWHD", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=16420 cap=16420]>} {:size 32840, :type "TWDT", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=32840 cap=32840]>} {:size 112980, :type "NORM", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=112980 cap=112980]>} {:size 149876, :type "DOT3", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=149876 cap=149876]>} {:size 2518, :type "PSDT", :children [{:size 22, :type "NAME", :data #<HeapByteBuffer java.nio.HeapByteBuffer[pos=0 lim=22 cap=22]
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>three.cljs</title>
<meta name="description" content="">
var jQuery = {
"fn": {
"init": function () {},
"selector": {},
"jquery": {},
"size": function () {},
"get": function () {},
"pushStack": function () {},
"setArray": function () {},
"each": function () {},
(ns rabbit.core
(:require [clojure.core.async :as a :refer [go go-loop <! >! put! chan]]
[clojure.core.async.impl.protocols :as impl]
[clojure.tools.namespace.repl :refer [refresh-all]]
[com.stuartsierra.component :as c]
[taoensso.nippy :refer [freeze thaw]])
(:import (com.rabbitmq.client Channel Connection ConnectionFactory)))
(extend-type Channel
impl/Channel