Skip to content

Instantly share code, notes, and snippets.

View freeeve's full-sized avatar

Eve Freeman freeeve

  • Fairfax, VA
View GitHub Profile
@freeeve
freeeve / restaurant_recommendation.adoc
Last active July 15, 2017 20:14 — forked from jexp/restaurant_recommendation.adoc
Restaurant Recommendation GraphGist

Restaurant Recommendations

Here’s an updated gist.

Here are some changes.

@freeeve
freeeve / .block
Last active February 27, 2017 13:19 — forked from mbostock/.block
Population Pyramid
license: gpl-3.0
@freeeve
freeeve / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// 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]
----
@freeeve
freeeve / gist:4709319
Last active December 12, 2015 03:48 — forked from anonymous/gist:4709253
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
@freeeve
freeeve / core.clj
Created October 15, 2012 15:56 — forked from szamuboy/core.clj
Evaling an anonymous function with closure
(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))
@freeeve
freeeve / gist:3873755
Created October 11, 2012 16:43 — forked from amergin/gist:3873399
cypher test
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)