Skip to content

Instantly share code, notes, and snippets.

@derms
derms / build.gradle
Created February 14, 2020 09:25
Skip ml-gradle mlUndeploy when production envirornment
def isProd(taskName) {
def isProdEnv = "prod".equalsIgnoreCase(findProperty("environmentName"))
if (isProdEnv) {
println "Skipping ${taskName} as is prod envrionment"
}
return isProdEnv
}
mlUndeploy.onlyIf { !isProd("mlUndeploy") }
mlUndeploy.dependsOn.each { taskList ->
taskList.each { taskName ->
@derms
derms / wait_for_http_200.sh
Created February 20, 2020 13:35 — forked from rgl/wait_for_http_200.sh
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76
@derms
derms / 1_convertModel.py
Last active February 29, 2020 12:49
Sample Sentiment model converted into ONNX and run in MarkLogic. Original Model : https://github.com/cocoa-ai/SentimentCoreMLDemo/blob/master/SentimentPolarity/Resources/SentimentPolarity.mlmodel
import coremltools
# Load a Core ML model
coreml_model = coremltools.utils.load_spec('SentimentPolarity.mlmodel')
# Convert the Core ML model into ONNX
onnx_model = onnxmltools.convert_coreml(coreml_model, 'Sentiment Polarity')
# Save as protobuf
onnxmltools.utils.save_model(onnx_model, 'SentimentPolarity.onnx')
BEGIN
CREATE LOADING JOB load_job_bi_data FOR GRAPH dataops {
DEFINE FILENAME MyDataSource = "/home/tigergraph/tigergraph/data/gui/loading_data/bi_data.csv";
LOAD MyDataSource
TO VERTEX object VALUES(gsql_concat($0, ":", $1, ":", $3), $0, $1, $3, _, _)
, TO VERTEX object VALUES(gsql_concat($0, ":", $4, ":", $5), $0, $4, $5, _, _) WHERE $4 != "Logical Table"
, TO EDGE relates_to VALUES(gsql_concat($0, ":", $1, ":", $3), gsql_concat($0, ":", $4, ":", $5)) WHERE $4 != "Logical Table"
USING SEPARATOR = ","
@derms
derms / fraud_detection_with_gnn_v4.ipynb
Last active May 20, 2022 09:12
Fraud_Detection_with_GNN_v4.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@derms
derms / support-collect.sh
Created August 26, 2022 13:15
TigerGraph support-collect
#!/bin/bash
# TigerGraph Support Collector v1.0
# Revised 3/17/2022
supportdir="support_collection_"$(date +%F_%H%M)
echo; read -p "Would you like to collect logs (this may take some time)? [y/n]"
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo; echo "Collecting logs..."
gcollect -o ./$supportdir -c gpe,gse,gsql,rest -t 86400 collect