Skip to content

Instantly share code, notes, and snippets.

@robertdale
robertdale / gist:8b5fa41432d29b3e99bf5ff2515dff3d
Created March 22, 2018 14:19
TINKERPOP-1682 by-modulator optimization strategy
CODE:
@Test
public void shouldApplyStrategiesCorrectly() {
Traversal.Admin<?, ?> traversal = __.out().count().asAdmin();
traversal.setStrategies(TraversalStrategies.GlobalCache.getStrategies(Graph.class));
int found = 0;
for (final String line : traversal.explain().toString().split("\n")) {
if (line.contains("AdjacentToIncidentStrategy") && line.contains("[VertexStep(OUT,edge)"))
@robertdale
robertdale / describe.groovy
Last active September 27, 2019 07:10
JanusGraph Schema Describe Command
// This can be imported via ./bin/gremlin.sh -i describe.groovy
// A variable 'graph' must be defined with a JanusGraph graph
// Run it as a plugin command ':schema'
// :schema describe
//
import org.janusgraph.graphdb.database.management.MgmtLogType
import org.codehaus.groovy.tools.shell.Groovysh
import org.codehaus.groovy.tools.shell.CommandSupport
// cut and paste or run with ./bin/gremlin.sh -i mustafa.groovy
graph = TinkerGraph.open()
System.out.println("graph open");
g = graph.traversal();
System.out.println("vertex creation started");
n = 10000;
@robertdale
robertdale / COLEMAK-SHOLES-WORKMAN.kbd.json
Last active May 8, 2022 06:12
COLEMAK-SHOLES-WORKMAN
[
{
"name": "COLEMAK-SHOLES-WORKMAN"
},
[
{
"a": 7
},
"Tab",
{
// set this to your server gremlin pool
cores = 8
cluster = Cluster.open('conf/remote.yaml');
client = cluster.connect();
client.submit("graph.createIndex('name',Vertex.class)").all().get()
// NEO4J
//client.submit("graph.cypher('CREATE INDEX ON :production_part(name)')").all().get()
@robertdale
robertdale / spok2-full.kbd.json
Last active March 17, 2022 09:59
spok2 full
[
{
"name": "spok2 full"
},
[
{
"x": 2
},
"@\n2",
"#\n3",
@robertdale
robertdale / spok2-half.kbd.json
Last active August 7, 2016 15:33
spok2 half
[
{
"name": "spok2 half"
},
[
{
"x": 2
},
"@\n2",
"#\n3",
@robertdale
robertdale / column-staggered-rotated-thumb-half.kbd.json
Created August 6, 2016 13:21
column staggered rotated thumb half
[
{
"name": "column staggered rotated thumb half"
},
[
{
"x": 3
},
"#\n3"
],
@robertdale
robertdale / column-staggered-rotated-thumb-full.kbd.json
Created August 6, 2016 13:19
column staggered rotated thumb full
[
{
"name": "column staggered rotated thumb full"
},
[
{
"x": 3
},
"#\n3",
{
@robertdale
robertdale / pinky-staggered-rotated-thumb-half.kbd.json
Last active August 6, 2016 20:51
pinky staggered rotated thumb half
[
{
"name": "pinky staggered rotated thumb half"
},
[
{
"x": 2
},
"@\n2",
"#\n3",