Skip to content

Instantly share code, notes, and snippets.

@cleishm
cleishm / sodium-jnr.py
Last active May 28, 2019
JNR bindings generator for sodium
View sodium-jnr.py
#!/usr/bin/env python
import sys
# This is not required if you've installed pycparser into
# your site-packages/ with setup.py
sys.path.extend(['.', '..'])
from pycparser import c_parser, c_ast, parse_file
class JNRRender(c_ast.NodeVisitor):
View Eq4.java
public class Person {
String firstName;
String lastName;
public final boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null) {
return false;
View gist:fde5d22b7ddfd18c7acd
### Keybase proof
I hereby claim:
* I am cleishm on github.
* I am cleishm (https://keybase.io/cleishm) on keybase.
* I have a public key whose fingerprint is 80F6 D6B0 D90C 6747 7533 44CA B5A9 E81B 565E 89E0
To claim this, I am signing this object:
@cleishm
cleishm / neoites_wanting_atom.cyp
Last active Aug 29, 2015
Neoites who'd like Atom Editor invites
View neoites_wanting_atom.cyp
= Neoites who'd like Atom Editor invites
:neo4j-version: 2.0.0
:author: Chris Leishman
:twitter: @cleishm
//setup
//hide
[source,cypher]
----
@cleishm
cleishm / income_vs_expenditure.cyp
Last active Aug 29, 2015
Import Data from City of Oakland Financial Disclosures
View income_vs_expenditure.cyp
MATCH (f:Candidate)
MATCH (f)<-[n:CONTRIBUTED_TO]-()
WITH f, sum(n.amount) AS received WHERE received > 0
MATCH (f)-[n:PAYED]->()
WITH f, received, sum(n.amount) AS spent
RETURN f.name AS candidate, spent, received
View airplane.adoc
View graph-royalty.adoc

Royalty in Europe

The Royal families generaly have long histories and are often closely related. This citation from wikipedia can give you better idea:

Maternally, Nicholas was the nephew of several monarchs, including King Frederick VIII of Denmark, Queen Alexandra of the United Kingdom (queen consort of King Edward VII), and King George I of Greece. Nicholas, his wife, Alexandra, and Kaiser Wilhelm II of Germany were all first cousins of King George V of the United Kingdom. Nicholas was also a first cousin of both King Haakon VII and Queen Maud of Norway, as well as King Constantine I of Greece. While not first cousins, Nicholas and Kaiser Wilhelm II were second cousins, once removed, as each descended from King Frederick William III of Prussia, as well as third cousins, as they were both great-great-grandsons of Emperor Paul I of Russia.

The rulers of Great Britain, Germany and Russia at the beginning of World War I were actually cousins

View working_examples_for_the_graph_databases_book
= Working examples for the 'Graph Databases' book
image::http://assets.neo4j.org/img/books/graphdatabases_thumb.gif["frontpage thumbnail",align="left"]
The examples in the 'Graph Databases' book don't work out of the box. I've modified them, so that they do work (for chapter 3, that is).
This is a graphgist version of my https://baach.de/Members/jhb/working-examples-for-the-graph-databases-book/[blog post].
If you click one of the green play buttons in the examples below, they will show in this console. Usually the code formatting is messed up, so it might be a bit ugly.
View SameSchoolInfluence
= graphGist generated from spock test Neo4jCypherSameSchoolInfluence.groovy
graphGist asciiDoc file for use at http://gist.neo4j.org/ [GitHub Gist]
Generated on Sun Jul 28 08:03:44 PDT 2013
//console
Initialize Graph
You can’t perform that action at this time.