Skip to content

Instantly share code, notes, and snippets.

View iann0036's full-sized avatar

Ian Mckay iann0036

View GitHub Profile
# start GremlinServer
# bin/gremlin-server.sh -i org.apache.tinkerpop gremlin-python 3.2.2-SNAPSHOT
# bin/gremlin-server.sh conf/gremlin-server-modern-py.yaml
from gremlin_python.process.graph_traversal import GraphTraversal
from gremlin_python.process.graph_traversal import GraphTraversalSource
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.traversal import Operator
from gremlin_python.structure.io.graphson import GraphSONReader
@kesor
kesor / cloudformation-yaml-to-json.py
Last active January 22, 2019 17:39
Convert CloudFormation YAML format to JSON format
#!/usr/bin/env python
import sys, yaml, json
def funcparse(loader, node):
node.value = {
yaml.constructor.ScalarNode: loader.construct_scalar,
yaml.constructor.SequenceNode: loader.construct_sequence,
yaml.constructor.MappingNode: loader.construct_mapping,
}[type(node)](node)
node.tag = node.tag.replace(u'!Ref', 'Ref').replace(u'!', u'Fn::')