Skip to content

Instantly share code, notes, and snippets.

View boxxxie's full-sized avatar
👙
disrupting absurdism

Paul Iannazzo boxxxie

👙
disrupting absurdism
View GitHub Profile
@boxxxie
boxxxie / current mls mock.js
Last active December 14, 2015 13:38
mls listing
{
"mls_id":"C2483248",
"longitude": -79.4141560000,
"latitude": 43.6909390000,
"name": "MLS Listing",
"description": "Sophisticated & Elegant Lwr Forest Hill Custom Home Built In '04. Finest Finishes & Craftsmanship, Exquisite Stone Facade & Portico Provide Charm & Function, Leading To Grand Foyer W/12'Ceilings. Lrg Open Lr/Dr Combined W/Wonderful Flow Thru Kit & Fam Rm, W/O To Lrge Deck & Spectacular Garden. 10' Ceilings On Mn, 8'6 On 2nd. 4+1 Bdrms + 5 Bths + Wonderful Lwr Lvl Makes For A Great Fam Home. Walk To Village Restaurants, Shops, Best Schools, Parks & Ttc. **** EXTRAS **** Cac, Ghwt, Cvac&Equip, Wolf Cooktop, Miele Ss Dw, Kitaid Oven,Kitaid Ss Frdge/Frzer, Pot Filler, W&D, Elfs(Ex.Dr+Mbr), Wndw Cvrs, Brdlm W/L, Retractable Awning, Alarm Sys, Egdo+1R, 2 Flat Screen Tvs, All B/I, Gas Outlet For Bbq, R/I 4 Elev",
"href": "http://www.realtor.ca/propertyDetails.aspx?propertyId=12492639&PidKey=1838525947",
"address": {
"street": "6 Strathearn Boulevard",
@boxxxie
boxxxie / school input.json
Last active December 14, 2015 10:39
school input validated at http://jsonlint.com/
[
{
"name": "North Preparatory Junior School",
"description":"some longer description of the place in question",
"href": "www.tdsb.on.ca/schools/index.asp?schno=5336",
"address": {
"street": "some nice street name",
"city": "toronto",
"country": "canada",
"phone_number":"905 905 9055",
@boxxxie
boxxxie / install.sh
Last active December 14, 2015 02:59
installing leoFS ubuntu12.10
#!/bin/bash
#http://www.leofs.org/docs/getting_started.html
#http://www.erlang.org/download_release/16
#https://github.com/leo-project/leofs
sudo apt-get install libtool libncurses5-dev libssl-dev
wget http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-7.2d.tar.gz
tar xzvf libatomic_ops-7.2d.tar.gz
location /explorer/app/pivotviewer/test/ {
root /home/paul/eg/kraft/cxml/;
}
#"GET /explorer/app/pivotviewer/test/kraft.cxml"
#translates to
#"/home/paul/eg/kraft/cxml/explorer/app/pivotviewer/test/kraft.cxml"
#desired translation being
#"/home/paul/eg/kraft/cxml/kraft.cxml"
@boxxxie
boxxxie / company-context.clj
Created February 19, 2013 01:25
I want a route that matches on: /company/32423432 /companies/2342343242
(defn company-context [routes]
(context ["/company/:company-id" :company-id #"[0-9]+"] [] routes)
(context ["/companies/:company-id" :company-id #"[0-9]+"] [] routes))
@boxxxie
boxxxie / print.clj
Created February 17, 2013 22:50
How do i get (pprint) output looking like (prn) output? I want to preserve the reader macro #db/id[...]
;;(pprint (take 1 (mapcat identity schemas)))
({:db.install/_attribute :db.part/db,
:db/unique :db.unique/value,
:db/doc "user that this password will work for",
:db/id {:part :db.part/db, :idx -1000000},
:db/ident :auth/user,
:db/valueType :db.type/ref,
:db/cardinality :db.cardinality/one})
;;(prn (take 1 (mapcat identity schemas)))
(def thing-to-walk [{:uri (java.net.URI. "/sdf/sdfsd")}])
(defn convertURI [o] (if (= (type o) java.net.URI)(str o) o))
(clojure.walk/prewalk-demo thing-to-walk)
(clojure.walk/prewalk convertURI thing-to-walk)
@boxxxie
boxxxie / gist:4942206
Created February 13, 2013 04:12
cool little clojure code snippet
(defmacro as->
"Binds name to expr, evaluates the first form in the lexical context
of that binding, then binds name to that result, repeating for each
successive form, returning the result of the last form."
{:added "1.5"}
[expr name & forms]
`(let [~name ~expr
~@(interleave (repeat name) forms)]
~name))
@boxxxie
boxxxie / dest.clj
Created February 7, 2013 23:00
destructuring problem. I want to convert the `body` and `content-length` into keys form, and keep the existing keys form for params
;;original that works
[{{:keys [company-id file-name ext]} :params body :body content-length :content-length}]
;;both of the below throw errors
[{{:keys [company-id file-name ext]} :params {:keys [body content-length]}}]
[{:keys [body content-length params] {{:keys [company-id file-name ext]} :params}}]
@boxxxie
boxxxie / xml-zipping.clj
Created February 6, 2013 03:44
how would i eliminate the duplicate xml traversals by reusing common zipper locations? tried saving (xml-> parsed-page :Items :Item :Facets :Facet) and reusing that in the sub-categories traversal, but got errors
(let [parsed-page (cxml/parse-string (emit-cxml-from-pages
[page1-mock]
"IMGBASE-STRING"
"whatever name"))
header-cat-names (xml-> parsed-page :FacetCategories :FacetCategory (attr :Name))
categories (set (xml-> parsed-page :Items :Item :Facets :Facet (attr :Name)))
sub-categories (set (xml-> parsed-page :Items :Item :Facets :Facet :String (attr :Value)))
collection-attrs #spy/d(->> t first :attrs keys set)
])