Skip to content

Instantly share code, notes, and snippets.

@Kungi
Created July 18, 2015 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kungi/19ffc88c4f1acf40f1c5 to your computer and use it in GitHub Desktop.
Save Kungi/19ffc88c4f1acf40f1c5 to your computer and use it in GitHub Desktop.
Transform
[{:role "SITE-ADMIN" :infocenter_id 2}
{:role "SITE-ADMIN" :infocenter_id 3}]
into
{:2 :SITE-ADMIN
:3 SITE-ADMIN}
with
(apply hash-map
(flatten
(map
#(map (fn [x] (keyword (str x)))
((juxt :infocenter_id
:role) %))
res)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment