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
1=2-1 | |
1=2-(2-1) | |
1=2-(2-(2-1)) | |
1=2-(2-(2-(2-1))) | |
1=2-(2-(2-(2-(2-1)))) | |
1=2-(2-(2-(2-(2-(2-1))))) |
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
(defmethod perform :start | |
[_ config components roles] | |
(println "Starting persistent service" components) | |
(let [system (volatile! (system/create-system config components roles)) | |
runtime (Runtime/getRuntime) | |
shutdown? (promise)] | |
(.addShutdownHook runtime | |
(Thread. (fn [] | |
(println "Shutting down persistent service") | |
(system/stop @system) |
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
### Keybase proof | |
I hereby claim: | |
* I am dball on github. | |
* I am dball (https://keybase.io/dball) on keybase. | |
* I have a public key ASD3cNyASKB_AH3rqwzAKMQBK6ILjglZ9evrD9g90d17kwo | |
To claim this, I am signing this object: |
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
(set-env! | |
:wagons (fn [wagons] | |
(conj wagons '[sparkfund/aws-maven "5.1.0" | |
:schemes {"s3" #(org.springframework.build.aws.maven.SimpleStorageServiceWagon.)}])) | |
:repositories (fn [repos] | |
(conj repos | |
'["sparkfund-snapshots" {:url "s3://sparkfund-maven/snapshots"}])) | |
:dependencies '[[sparkfund/private-secret-library "0.0.1"]]) |
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 charseq-in | |
[& options] | |
(let [{:keys [count min-count max-count chars]} options] | |
(s/coll-of (or chars char?) | |
:count count | |
:min-count min-count | |
:max-count max-count))) | |
(defn string-like | |
[spec-or-k] |
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 charseq-in | |
[& options] | |
(let [{:keys [count min-count max-count chars]} options] | |
(s/coll-of (or chars char?) | |
:count count | |
:min-count min-count | |
:max-count max-count))) | |
(defn string-in | |
[& options] |
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
(defprotocol UserStore | |
(load [_ id]) | |
(save! [_ id user]) | |
(delete! [_ id])) | |
(defrecord Database [db] | |
UserStore | |
(load [_ id] | |
(first (jdbc/query db ["select * from users where id = ?" id]))) | |
...) |
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
(deftxnfn increase-book-quality | |
[db eid attr quality] | |
(do | |
(assert (= :book/quality attr)) | |
(if (q '[:find ?eid . | |
:in $ ?ords ?eid ?quality' | |
:where | |
[?eid :book/quality ?quality-eid] | |
[?quality-eid :db/ident ?quality] | |
[(get ?ords ?quality' -1) ?ord'] |
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
TypeResolver | |
(resolve-types [_])) | |
(extend-protocol TypeResolver | |
clojure.lang.Keyword | |
(resolve-types [type] | |
(when-let [spec (spark.spec-tacular/get-spec type)] | |
(resolve-types spec))) | |
clojure.lang.Var | |
(resolve-types [var] |
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
type Point a = (a, a) | |
type PointFn a = ((a -> a), (a -> a)) | |
data Board a = Board { boardMin :: Point a, | |
boardMax :: Point a } | |
deriving (Show) | |
makeBoard :: (Enum a, Ord a) => Point Int -> Board a | |
makeBoard (x, y) = Board (z, z) (toEnum x, toEnum y) | |
where z = toEnum 0 |
NewerOlder