Skip to content

Instantly share code, notes, and snippets.

View z-ai-lab's full-sized avatar
:octocat:

z z-ai-lab

:octocat:
View GitHub Profile
@z-ai-lab
z-ai-lab / postgres_queries_and_commands.sql
Created April 14, 2021 16:27 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
create index on :Node(name);
//load the data in raw form
Load csv with headers from "https://docs.google.com/spreadsheets/u/0/d/17WuC_B8RWzsSS8pw-NtY8qWeFFQGCGnCR5uXmENOFUI/export?format=csv&id=17WuC_B8RWzsSS8pw-NtY8qWeFFQGCGnCR5uXmENOFUI&gid=112267709" as csv
Merge (n:Node {name: csv.Name, type: csv.Type, tags: csv.Tags, link: csv.Link});
// move the 'type' property to a label and remove it as a property, USING APOC (not supported in Graphgist)
MATCH (n:Node)
with n, split(n.type, ",") AS futurelabels
unwind futurelabels as futurelabel
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
cigar
rebut
sissy
humph
awake
blush
focal
evade
naval
serve
@z-ai-lab
z-ai-lab / index.html
Created March 16, 2022 15:08
venn diagram test with d3
<head>
<meta charset="utf-8">
<title>Intersection Tooltip venn.js example</title>
</head>
<body>
<div id="venn"></div>
<div id="tooltell">&nbsp;</div>
</body>
@z-ai-lab
z-ai-lab / data-science-job-skills-venn-diagram.markdown
Created March 16, 2022 15:19
Data Science Job Skills Venn Diagram
SetTimer HeartBeat, 240000 ; run every 4 minutes
HeartBeat() {
wday := A_WDay
if (wday >= 2 && wday <= 6) {
hour := A_Hour
if ((hour >= 8 && hour < 18)
&& (A_TimeIdle > 180000)) { ; idle for 3+ mins during work hours
MouseMove 0, 0, 0, 'R' ; mouse pointer stays in place but sends a mouse event
}
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix neovoc: <neo4j://vocabulary#> .
@prefix neoind: <neo4j://individuals#> .
neovoc:ATTENDING a owl:ObjectProperty;
rdfs:label "ATTENDING";
rdfs:subPropertyOf neovoc:RESPONSIBLE_FOR .
@z-ai-lab
z-ai-lab / brew-upgrade-major.sh
Created July 5, 2023 18:03
brew upgrade major updates
brew outdated --json | jq '.formulae | to_entries[] | select(.value.current_version | test("_") | not) | .value.name' | parallel --tag "brew upgrade {}"
import neo4j
import datetime
import networkx as nx
from typing import Any, Dict, Optional, Tuple, Union
from neo4j import Driver, GraphDatabase
__version__ = "0.1"