Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ah45 on github.
  • I am ah45 (https://keybase.io/ah45) on keybase.
  • I have a public key whose fingerprint is B072 177B 3D8C 46B3 7E95 2785 38BB DA97 7152 B5F2

To claim this, I am signing this object:

@ah45
ah45 / profiles.clj
Last active April 18, 2019 12:31
profiles.clj
{:test-refresh {:plugins [[com.jakemccrary/lein-test-refresh "0.23.0"]]
:test-refresh {:notify-command ["terminal-notifier" "-title" "Tests" "-message"]
:quiet true
:changes-only true}}
:dev {:dependencies [[criterium "0.4.4"]]}
:cider-nrepl {:plugins [[cider/cider-nrepl "0.21.1"]
[refactor-nrepl "2.4.0"]]}
:eftest {:plugins [[lein-eftest "0.5.7"]]
:eftest {:multithread? :vars
:thread-count 4}}
@ah45
ah45 / profiles.clj
Last active July 18, 2019 15:40 — forked from the-frey/profiles.clj
lein REPL alias
;; in ~/.lein/profiles.clj
{;; a distinct cider-nrepl profile
:cider-nrepl {:plugins [[cider/cider-nrepl "0.22.0-beta1"]
[refactor-nrepl "2.4.0"]]}
;; with an alias to always use it when running `lein repl`
:user {:aliases {"repl" ["with-profile" "+cider-nrepl" "repl"]}}
(ns deferred-fn-output-schema-validation
(:require
[manifold.deferred :as d]
[schema.core :as s]
[schema.spec.core :as s.spec]
[schema.spec.leaf :as s.leaf]
[schema.macros :as s.macros]
[schema.utils :as s.utils]))
(defrecord Deferred [schema]
@ah45
ah45 / juxt_validate.clj
Created September 4, 2023 12:11
Using `juxt` to compose and apply multiple validation functions against the same value
(ns juxt-validate
(:require [clojure.string :as string]))
(defn validate-format
[v]
(if (every? #(contains? v %) #{:name :email :id})
[:ok v]
[:error {:invalid-format "expected id, name, and email"}]))
(defn validate-email