Skip to content

Instantly share code, notes, and snippets.

{"status":"ok","tags":[{"x":"0.57","y":"0.28","product":{"name":"Sherpa Vest","image":"https://d1bntizjlw65va.cloudfront.net/857d35687a2833a7bf174030d27d69c21b04f042.jpg","currency":"$","price":"225","brand":"Alala","brand_url":"http://www.pradux.com/brands/alala","url":"http://www.pradux.com/products/alala-sherpa-vest?rt=user\u0026r=8881","buy_url":"//www.pradux.com/go/0/u8881/0/50631/http%3A%2F%2Fwww.carbon38.com%2Fproduct%2Fsherpa-vest-black.html%3Fint_source%3Dalala%26int_block%3Dgrid-2%26int_version%3D0"},"photo":{"url":"http://www.pradux.com/photos/16218","image_url":"https://d1i5hut471lhig.cloudfront.net/f9fa0c4995b46680ecb8d0824ca9bc7358d9c8cb.jpg","title":"BFA’s Photo","description":"Check out products in this photo, including MICHI Melano Sweatshirt, Koral Activewear Forge Legging, and Alala Sherpa Vest."}},{"x":"0.46","y":"0.38","product":{"name":"Melano Sweatshirt","image":"https://d1bntizjlw65va.cloudfront.net/eb31c974b3942ff8edee006e3702ea135cfea8fb.jpg","currency":"$","price":"195","brand":"MIC
(def struct [{:img "foo3" :id 3}
{:img "foo2" :id 2}
{:img "foo" :id 1}])
(defn change-struct [input]
{:a1 (map :img input)
:a2 (map :id input)})
(=
(def struct [{:img "foo3" :id 3}
{:img "foo2" :id 2}
{:img "foo" :id 1}])
(defn change-struct [input]
(println input)
(reduce (fn [memo {:keys [img id]}]
(conj memo [[img] [id]] )
) [] input))
(def struct [{:img "foo3" :id 3}
{:img "foo2" :id 2}
{:img "foo" :id 1}])
(defn change-struct [input]
(println input)
(reduce (fn [memo {:keys [img id]}]
(conj memo [img] [id])
) [] input))
(defproject rtest "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[ring-server "0.4.0"]
[reagent "0.5.1"
:exclusions [org.clojure/tools.reader]]
; clojurescript
(def str-to-route
{"HOME" #'home/page
"PHOTO" #'photo_details/page
"EVENT" #'eventp/page}
)
(defn ^:export render-me-to-s [p]
(let [initial-state (js->clj p :keywordize-keys true)]
(reset! config/app-state (:app-state initial-state))
{
"date": "Thu, 16 Jul 2015 03:51:19 GMT",
"access-control-request-method": "*",
"x-content-type-options": "nosniff",
"transfer-encoding": "chunked",
"status": "200 OK",
"access-control-max-age": "1728000",
"connection": "keep-alive",
"x-xss-protection": "1; mode=block",
"x-request-id": "860d848d-ab4b-433f-9c60-a97af3121f52",
---
total_records: 28
keywords: []
people:
-
id: 173
position: 20
person_name: "Scott Studenberg"
person_id: 19
total: 28
{
"page": 0,
"search": {
"_all": "",
"sort": {},
"event_id": "",
"people_names": ["John", "Scott Studenberg"],
"tag_names": [],
"tag_ids": [],
{
"page": 0,
"search": {
"_all": "",
"sort": {},
"event_id": "",
"people_names": ["John"],
"tag_names": [],
"tag_ids": [],