Skip to content

Instantly share code, notes, and snippets.

@langsdlc
langsdlc / cypher
Created July 13, 2016 16:51
cypher for neo4j csv load
LOAD CSV WITH HEADERS FROM "https://gist.githubusercontent.com/langsdlc/a0f802f26a8f05c4823823f0a981c49b/raw/f56b8837cc5ba149dc9f80d47b9c0ca0383486f8/Test_PointsDEC.csv" AS csvLine
CREATE (:Waypoint {x: toFloat(csvLine.XDEC), y: toFloat(csvLine.YDEC), id: toINT(csvLine.WaypointID), building:(csvLine.Building), entrance: toINT(csvLine.Entrance)})
@langsdlc
langsdlc / Test_Network.csv
Last active July 14, 2016 19:50
Test Network
FromPoint ToPoint DistanceFt PATH_Seg_Join Building Entrance Surface Path_Type Stairs Description
0 51.59934948 253 0 2 3 0 ped xing
0 266 16.75001259 492 0 0 2 0
0 267 11.10470689 499 0 0 2 0
1 2 64.01181817 100 0 2 4 0 no ped xing
1 266 161.352998 181 0 0 2 0
1 269 11.73651396 493 0 0 2 0
2 1 64.01181817 100 0 2 4 0 no ped xing
2 6 328.1380506 194 0 0 2 0
2 273 32.66344619 410 0 0 1 1
@langsdlc
langsdlc / Test_PointsDEC.csv
Last active July 18, 2016 21:10
Tes_Points
Id Building Entrance XDEC YDEC
0 NULL 0 -86.79970875 36.14399483
1 NULL 0 -86.79911227 36.14395718
2 NULL 0 -86.79889689 36.14393708
3 NULL 0 -86.79918431 36.14385614
4 NULL 0 -86.79776009 36.14382383
5 NULL 0 -86.79758679 36.1438067
6 NULL 0 -86.79779384 36.14382717
7 NULL 0 -86.79733572 36.14237734
8 NULL 0 -86.79748117 36.14225601
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@langsdlc
langsdlc / ids
Created March 17, 2016 17:49
search function
function(doc){
index("default", doc.properties.title);
if (doc._rev){
index("rev", doc._rev, {"store": "yes"});
}
if(doc.properties.title){
index("title", doc.properties.title, {"store": "yes"});
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@langsdlc
langsdlc / file-to-http.bash
Created December 22, 2015 15:31 — forked from CliffordAnderson/directions.md
Bash / JQ for Cloudant Bulk Upload & Download
http post #####:#####@vulibrarygis.cloudant.com/campustour/_bulk_docs < tour.json
xquery version "3.1";
let $csv :=
element csv {
for $play in fn:collection("cfregisters")//play
where $play/date
let $date := fn:tokenize($play/date/text(), "-")
let $year := $date[1]
let $month := $date[2]
let $day := $date[3]