Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/local/",e(e.s=350)}([function(t,e,n){"use strict";e.default=function(t){return t&&t.__esModule?t:{default:t}},e.__esModule=!0},function(t,e,n){"use strict";function r(t){return t>1?0:t<-1?c:Math.acos(t)}function i(t){return t>1?d:t<-1?-d:Math.asin(t)}function a(t){return(t=_(t/2))*t}n.d(e,"i",function(){return o}),n.d(e,"j",function(){return s}),n.d(e,"o",function(){return c}),n.d(e,"l",function(){return d}),n.d(e,"q",function(){return u}),n.d(e,"w",function(){return l}),n.d(e,"h",function(){return f}),n.d(e,"r",function(){return p}),n.d(e,"a",function(){return m}),n.d
# Get all letters of the alphabet
import string
all_letters = string.ascii_letters + " .,;'"
# List all files in a directory matching a pattern
import glob
def findFiles(path): return glob.glob(path)
findFiles("/somedir/*.txt")
!function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var e={};n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="/local/",n(n.s=172)}([function(t,n,e){"use strict";function r(t){return t>1?0:t<-1?o:Math.acos(t)}function i(t){return t>1?s:t<-1?-s:Math.asin(t)}function u(t){return(t=O(t/2))*t}e.d(n,"i",function(){return c}),e.d(n,"j",function(){return a}),e.d(n,"o",function(){return o}),e.d(n,"l",function(){return s}),e.d(n,"q",function(){return f}),e.d(n,"w",function(){return h}),e.d(n,"h",function(){return l}),e.d(n,"r",function(){return d}),e.d(n,"a",function(){return b}),e.d(n,"d",function(){return _}),e.d(n,"e",function(){return p}),e.d(n,"g",function(){return v}),e.d(n,"f",fun
@benoitguigal
benoitguigal / .block
Last active April 27, 2023 14:07
Force Directed Graph with smooth transitions
license: gpl-3.0
height: 600
host: 0.0.0.0
port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/gremlin-server/janusgraph-cassandra-es-server.properties
}
plugins:
- janusgraph.imports
scriptEngines: {
@benoitguigal
benoitguigal / graph.py
Last active July 20, 2018 08:25
Gremlin Python Language Variant
>>> from gremlin_python import statics
>>> from gremlin_python.structure.graph import Graph
>>> from gremlin_python.process.graph_traversal import __
>>> from gremlin_python.process.strategies import *
>>> from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
>>> graph = Graph()
>>> g = graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
>>> g.V().has('name', 'saturn').next()
v[4240]
@benoitguigal
benoitguigal / gremlin.py
Created July 20, 2018 08:36
Gremlin Python Language Driver
>>> from gremlin_python.driver import client
>>> gremlin_client = client.Client('ws://localhost:8182/gremlin', 'g')
>>> gremlin_client.submit("[1,2,3,4]").next()
[1, 2, 3, 4]
>>> query = "g.V().has('name', 'saturn')"
>>> gremlin_client.submit(query).next()
[v[4240]]
PUT users/_doc/1
{
"name": "Bobby Kennedy",
"date_of_birth": 553941680000,
"description": "I am passionate about Elasticsearch"
}
{
"_index": "users",
"_type": "_doc",
GET users/_search
{
"query": {
"match_all": {}
}
}
{
"took": 14,
"timed_out": false,
"_shards": {
GET users/_mapping/
{
"users": {
"mappings": {
"_doc": {
"properties": {
"date_of_birth": {
"type": "long"
},
"description": {