Skip to content

Instantly share code, notes, and snippets.

View lmeyerov's full-sized avatar

lmeyerov

View GitHub Profile
@lmeyerov
lmeyerov / test.py
Created March 2, 2023 23:31
morpheus test
import logging
import os
import profile
import sys
import typing
from time import time
import pandas as pd
import srf
from line_profiler import LineProfiler
@lmeyerov
lmeyerov / graphistry browser upload: vanilla js
Created October 29, 2021 07:33
Direct use of graphistry api from the browser via fetch(). Requires Graphistry 2.38.2+.
async function postData(url = '', data = {}, headers = {}) {
const response = await fetch(url, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
...headers
},
body: JSON.stringify(data)
});
def validate(g):
# Ensure no NA IDs
if g._edges[g._source].isna().sum() > 0:
print('edge src has na()')
return g._edges[g._edges[g._source].isna()]
if g._edges[g._destination].isna().sum() > 0:
print('edge dst has na()')
return g._edges[g._edges[g._destination].isna()]
if g._nodes[g._node].isna().sum() > 0:
@lmeyerov
lmeyerov / neptune_gremlin_versioning.md
Created July 9, 2021 20:11
Handling gremlin_python, Neptune async version issues

Handle gremlinpython, Neptune, jupyter, tornado version issues

Different Neptune versions support different gremlin_python versions, and different gremlin_python versions may require workarounds for Python asyncio / Jupyter's builtin Tornado client.

As needed, use the below workarounds. If installing packages, remember to restart your Python kernel (kernel -> restart) before continuing

Graphistry maintains versions that should work for latest known in both its main distributions, GPU base Docker containers, and graph-app-kit Streamlit dashboarding containers

Pick a gremlin_python version that is Neptune-compatible

//Written with intent for moving to JS client
import axios from 'axios';
/*
var gFile = new GraphistryFileUploader(null, {'jwtToken': 'xyz123'})
gFile.createFile({
'file_type': 'csv',
'name': 'adsf',
#!/bin/bash
set -e # exit on fail
# Curl REST API Tutorial
# * Script goes along with the version in the docs
# * assumes `jq` is installed
### SET ACCOUNT + SERVER
@lmeyerov
lmeyerov / gist:ad6947f83f7912c49164f32272e60097
Created October 9, 2020 17:35
github actions to free space
- name: Free disk space - apt-get-remove
run: |
df -h
echo "Remove apt packages"
sudo apt-get remove aria2 ansible shellcheck rpm xorriso zsync \
clang-6.0 lldb-6.0 lld-6.0 clang-format-6.0 clang-8 lldb-8 lld-8 clang-format-8 \
clang-9 lldb-9 lld-9 clangd-9 clang-format-9 \
esl-erlang g++-8 g++-9 gfortran-8 gfortran-9 \
cabal-install-2.0 cabal-install-2.2 \
cabal-install-2.4 cabal-install-3.0 cabal-install-3.2 heroku imagemagick \
@lmeyerov
lmeyerov / uploader.ipynb
Last active May 29, 2020 01:18
Graphistry 2.0 REST API Tutorial: Login, create dataset, and upload nodes/edges as json, csv, parquet, arrow, and more
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<title>Flapjax stopwatch demo</title>
<link rel="stylesheet" href="styles.css"/>
<script type="text/javascript" src="https://www.flapjax-lang.org/download/flapjax-2.1.js"></script>
<script type="text/javascript">
//Written in the React style with Flapjax as the only dependency
class Stopwatch {
@lmeyerov
lmeyerov / README.md
Created July 6, 2016 04:40
force demo