Skip to content

Instantly share code, notes, and snippets.

(def detectives {:columbo "frank"
:morse "endeavour"
:holmes "sherlock"})
@adamneilson
adamneilson / gist:1e3f73231ddf8daf0937c0bd81d6a222
Last active March 30, 2018 12:03
Vertically align values in a hashmap
" Vertically align values in a hashmap
map <C-a> vi{ga-<Space><CR>

Clojure Developer

Do you have the talent to join multi-award winning startup WeFarm?

We are a unique social enterprise providing a vital service for the world's 500 million smallholder farmers who live and work without internet access. This pioneering, peer-to-peer platform enables farmers to access crowdsourced information by SMS, creating social impact on a groundbreaking scale and generating a game-changing data feed through the use of cutting edge AI techniques.

In just one year WeFarm has scaled to more than 72,000 farmers across Kenya, Uganda and Peru, has facilitated over 11.5 million interactions and featured in the FT, Forbes, Wired.co.uk, as well as winning awards from [Google's Impact Challenge](https://impactchallenge.withgoogle.

λ: (time (+ 2 2))
"Elapsed time: 0.02675 msecs"
4
@adamneilson
adamneilson / non-componentized-schema-alter.clj
Created May 16, 2015 16:32
De-componentizes the attributes that are not refs but are components.
;; assume conn to be your database connection
(let [dbval (d/db conn)
;; dump the whole schema
schema (->> (d/q '[:find ?ident
:in $ ?p
:where
[:db.part/db :db.install/attribute ?attr]
[?attr :db/ident ?ident]]
@adamneilson
adamneilson / schema-dump.clj
Last active November 4, 2015 18:00
This dumps the Datomic schema from the user partition
;; This dumps the Datomic schema from the user partition
(let [dbval (d/db conn)]
(->> (d/q '[:find ?ident
:in $ ?p
:where
[:db.part/db :db.install/attribute ?attr]
[?attr :db/ident ?ident]]
dbval :db.part/user)
(map (fn [attr] [(d/entity dbval (first attr))]))
(map (fn [attr]

Keybase proof

I hereby claim:

  • I am adamneilson on github.
  • I am aan (https://keybase.io/aan) on keybase.
  • I have a public key whose fingerprint is CB72 5E77 83B4 D681 6B27 C536 04F9 51C5 E8B4 CF95

To claim this, I am signing this object:

Verifying myself: My Bitcoin username is +aan. https://onename.io/aan
[
;; ----- User type -----
{:db/id #db/id[:db.part/db]
:db/ident :user/name
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/doc "A users name"
:db/unique :db.unique/identity