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 qq [& body] | |
`(->> | |
(map (fn [s#] | |
(if (string? s#) | |
(format "\"%s\"" s#) (str s#))) | |
(quote ~body)) | |
(interpose " ") | |
(apply str))) | |
(defn myfn "docstring \"the normal way\" sort of a pain" [] ) |
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
(apply | |
format | |
"%d-%02d-%02d %02d:%02d:%02d" | |
(-< (doto (Calendar/getInstance) | |
(.setTime (Date. 112 4 17 14 15 0)) | |
(.add Calendar/MINUTE (* 15 offset))) | |
(.get Calendar/YEAR) | |
(.get Calendar/MONTH) | |
(.get Calendar/DAY_OF_MONTH) | |
(.get Calendar/HOUR) |
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
(require '[cemerick.pomegranate :refer [add-dependencies]]) | |
(add-dependencies | |
:coordinates '[[clj-http "0.6.3"] | |
[swiss-arrows "0.5.1"]] | |
:repositories {"clojars" "http://clojars.org/repo"}) | |
(require '[clj-http.client :as client] | |
'[swiss-arrows.core :refer [-<>]] | |
'[clojure.string :as str] | |
'[clojure.java.shell :refer [sh]]) |
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
Verifying that +rplevy is my blockchain ID. https://onename.com/rplevy |
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
(require '[clojure.spec :as s]) | |
(defn enforce [spec data-value] | |
(let [r (s/conform spec data-value)] | |
(if (= r :clojure.spec/invalid) | |
(throw (ex-info (str r) (s/explain-data spec data-value))) | |
data-value))) | |
(defn call-with-temporal-contract [f g contract-on-g] | |
(let [function-calls (atom [])] |
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
(defn keywordize [s] | |
(-> (str/lower-case s) | |
(str/replace "_" "-") | |
(str/replace "." "-") | |
(keyword))) | |
(defmethod aero/reader 'env | |
[opts tag value] | |
(get env (keywordize (str value)))) |
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
-----BEGIN PGP SIGNED MESSAGE----- | |
Hash: SHA512 | |
I verify that I am rplevy on mastodon.social | |
-----BEGIN PGP SIGNATURE----- | |
Version: Keybase OpenPGP v2.0.68 | |
Comment: https://keybase.io/crypto | |
wsFcBAABCgAGBQJY4xcwAAoJEHPFfFFJo8mQ7LoQANVwr+sfT8tzZWCuyNsdLpsc | |
hPK3SmUTCLRYa/8Olvq2MO/ZWTyuHfhDiRWqmksSIdAoR5oyiz0RC4fCpuZY4QeZ |
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
# in my .bashrc | |
xmlclj() { planck -D funcool/tubax:0.2.0 -e "(require '[tubax.core :as tubax]) (require '[planck.core :refer [slurp]]) (require '[cljs.pprint :refer [pprint]])"'(pprint (tubax/xml->clj (slurp "'$1'")))'; } | |
# example: xmlclj /tmp/foo.xml |
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
(defun xml->clj-region (beg end) | |
(interactive "r") | |
(shell-command-on-region beg end | |
"xmlclj" | |
(current-buffer) | |
t)) |
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
(defun htm2clj-region (beg end) | |
(interactive "r") | |
(shell-command-on-region beg end | |
"html2clj" | |
(current-buffer) | |
t)) |