Skip to content

Instantly share code, notes, and snippets.

James Thornton espeed

Block or report user

Report or block espeed

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1020196
From ce55883e1009c70108bd7503e89c896bb8838fe1 Mon Sep 17 00:00:00 2001
From: James Thornton <james@jamesthornton.com>
Date: Fri, 10 Jun 2011 21:44:19 -0500
Subject: [PATCH] Setting self.body to None breaks oauth2/init.py line 493.
Changed the body default from None to empty string.
---
flaskext/oauth.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
@espeed
espeed / redis.groovy
Created Aug 23, 2011
Talk to Redis while you walk Gremlin
View redis.groovy
// Talk to Redis while you walk Gremlin
// by James Thornton, http://jamesthornton.com
import redis.clients.jedis.*;
Jedis jedis = new Jedis("localhost");
g = TinkerGraphFactory.createTinkerGraph();
talk2redis = {
@espeed
espeed / neo4j_jython.py
Created Aug 23, 2011
Neo4j Jython Example
View neo4j_jython.py
# Neo4j Jython Example
# by James Thornton, http://jamesthornton.com
from org.neo4j.kernel import EmbeddedGraphDatabase
from org.neo4j.kernel import Config
from org.neo4j.graphdb import DynamicRelationshipType
class Database(object):
def __init__(self,path,config=None):
View gist:1170000
I have a recursive Python function that builds a tree, and I'm trying to translate it into Groovy.
Here's the Python version...
def get_tree(vertices):
results = []
if type(vertices) != list:
vertices = [vertices]
@espeed
espeed / gist:1170115
Created Aug 25, 2011
Rebuild a graph's vertices index form Gremlin
View gist:1170115
// Rebuild a graph's vertices index from Gremlin
gremlin> g = TinkerGraphFactory.createTinkerGraph()
gremlin> index = g.getIndex('vertices',Vertex)
gremlin> AutomaticIndexHelper.reIndexElements(g, index, g.getVertices())
@espeed
espeed / gist:1178694
Created Aug 29, 2011
Bulbs/Redis Caching Get Example
View gist:1178694
import pickle
from redis import Redis
from bulbs.graph import Graph
# https://github.com/espeed/bulbs
# https://github.com/andymccurdy/redis-py
g = Graph()
redis = Redis()
@espeed
espeed / Manifest.ttl
Created Aug 30, 2011
Wordnet 3.0 Manifest
View Manifest.ttl
@prefix lib: <http://www.swi-prolog.org/rdf/library/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix wn30: <http://purl.org/vocabularies/princeton/wn30/> .
@prefix wnschema: <http://purl.org/vocabularies/princeton/wordnet/schema#> .
@prefix basic: <basic/> .
@prefix full: <full/> .
@prefix standoff: <standoff/> .
@prefix wn20map: <wn20mappings/> .
@espeed
espeed / load.py
Created Aug 30, 2011
Wordnet 3.0 Loader
View load.py
# Wordnet 3.0 Jython Loader Example
from org.openrdf.rio import RDFHandler
from org.openrdf.rio import RDFHandlerException
from org.openrdf.rio import RDFParseException
from org.openrdf.rio import ParseErrorListener
from org.openrdf.rio.turtle import TurtleParser
from org.openrdf.sail import Sail
from org.openrdf.sail import SailConnection
from org.openrdf.sail import SailException
@espeed
espeed / gist:1183325
Created Aug 31, 2011
OpenRDF Sail w/ Commit Manager Error
View gist:1183325
$ jython load2.py
.
.
.
.
.
Current number of operations counted 53
Number of commits that have occured 5
Closing commit manager...
@espeed
espeed / gist:1183331
Created Aug 31, 2011
Jython Wordnet 3.0 Loader 2
View gist:1183331
# Jython Wordnet 3.0 Loader Example 2
# by James Thornton, http://jamesthornton.com
from org.openrdf.rio import RDFHandler
from org.openrdf.rio import RDFHandlerException
from org.openrdf.rio import RDFParseException
from org.openrdf.rio import ParseErrorListener
from org.openrdf.rio.turtle import TurtleParser
from org.openrdf.sail import Sail
from org.openrdf.sail import SailConnection
You can’t perform that action at this time.