Here’s an updated gist.
Here are some changes.
| license: gpl-3.0 | 
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console | 
Upgraded for 2.0:
MATCH (user:User)<-[:follows]-(follower)
OPTIONAL MATCH (follower)-[:follows]->(other)
WITH user, follower, 1.0 / (0.0 + COUNT(other)) AS weighted
WITH user, COUNT(follower) AS numFollowers, SUM(weighted) AS totalWeighted
RETURN user, numFollowers, ROUND(totalWeighted * 100) / 100.0 AS totalWeighted
ORDER BY ID(user)
| val allCountries = Cypher("match (n) where n.type = 'Country' return n.code as code, n.name as name") | |
| val countries = allCountries.apply().map(row => | |
| (row[String]("code"), row[String]("name")) | |
| ).toList | 
| package arrayslice | |
| import "testing" | |
| func BenchmarkArray8for(b *testing.B) { | |
| var a [8]int | |
| for i := 0; i < b.N; i++ { | |
| for j := 0; j < len(a); j++ { | |
| a[j] += j | |
| } | 
| = Bus line network and routing | |
| == The setup | |
| This is the bus network for one Bus line `21` with a number of bus stops. | |
| //setup | |
| //hide | |
| [source,cypher] | |
| ---- | 
| start a=node(3), b=node(1) | |
| match p=a-[r:KNOWS*..3]->b | |
| with p, head(relationships(p)) as h | |
| where all(x in tail(relationships(p)) | |
| where x.type = 'all') | |
| and h.type='own' | |
| return p | 
| (ns why-is-that.core) | |
| (def test-1 (list (fn [arg] | |
| arg) 1)) | |
| ;; (eval test-1) -> 1 | |
| (def test-2 (list ((fn [] | |
| (fn [arg] | |
| ['hello arg]))) 1)) | 
| START node1=node(1456) MATCH node1-[rel1]->node2 | |
| WHERE HAS(rel1.distance) | |
| WITH node1, rel1, node2 ORDER BY rel1.distance ASC LIMIT 10 | |
| MATCH node2-[rel2]->node3 | |
| WHERE node3 <> node1 | |
| WHERE HAS(rel2.distance) | |
| WITH node2,node3, rel2, rel1 ORDER BY rel2.distance ASC LIMIT 10 | |
| MATCH node3-[rel3]->node4 | |
| WHERE node4 <> node2 | |
| AND HAS(rel3.distance) |