Skip to content

Instantly share code, notes, and snippets.

@jcamins
jcamins / gist:5841784
Created June 22, 2013 17:47
gremlin-node shutdown problem
=== CODE ===
var g = require('gremlin');
app.initializeDB = function () {
var T = g.Tokens,
Direction = g.Direction,
Type = g.ClassTypes;
//Get a reference to Titan specific Enum
var UniqCon = g.java.import("com.thinkaurelius.titan.core.TypeMaker$UniquenessConsistency");
@jcamins
jcamins / gist:6283892
Last active December 21, 2015 09:19
Query syntax
/* description: Parses Biblionarrator queries. */
/* lexical grammar */
%lex
%%
\s+ /* skip whitespace */
"(" return 'GS';
")" return 'GE'; // Group End
(keyword|author|title)\: return 'INDEX'
@jcamins
jcamins / machine.js
Last active June 15, 2020 20:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@jcamins
jcamins / machine.js
Created July 16, 2020 14:21
Generated by XState Viz: https://xstate.js.org/viz
const HEARING_AIDS_SERVICE_ID = 'hearingAids';
const HearingAidEventTypes = {
CheckReady: 'CHECK_HEARING_AIDS_READY',
Ready: 'HEARING_AIDS_READY',
SetProgram: 'SET_PROGRAM',
CurrentProgramChanged: 'PROGRAM_UPDATE',
ProgramListChanged: 'PROGRAM_LIST_UPDATE',
InstrumentUpdate: 'INSTRUMENT_UPDATE',
ConnectionUpdate: 'CONNECTION_UPDATE',