Skip to content

Instantly share code, notes, and snippets.

View versae's full-sized avatar

Javier de la Rosa versae

View GitHub Profile
@versae
versae / xvfb
Last active November 7, 2015 19:21 — forked from dloman/xvfb
xvfb for use with travis
### BEGIN INIT INFO
# Provides: Xvfb
# Required-Start: $local_fs $remote_fs
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Loads X Virtual Frame Buffer
### END INIT INFO
@versae
versae / neighbors.py
Created October 21, 2012 00:18
Neighbors function : problematic
def find_neighbors(n, v, visited=set()):
"""
Finds a node's neighbors to n degrees of seperation.
Param n: degrees of seperation. n > 1
v: node id
Return: a list of neighbors to the nth degree with no duplicates or 'NoneType'
"""
neighbors = set(v.neighbors)
@versae
versae / traversals.py
Created February 26, 2012 16:32 — forked from theladyjaye/traversals.py
Neo4j REST Traversals Approximating embedded syntax for https://github.com/versae/neo4j-rest-client/
# http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html#rest-api-traversal-returning-nodes-below-a-certain-depth
try:
import simplejson as json
except ImportError:
import json
from neo4jrestclient import client
from neo4jrestclient.request import Request
from neo4jrestclient.request import NotFoundError