Skip to content

Instantly share code, notes, and snippets.

View zhibor's full-sized avatar
:octocat:

Zhibo zhibor

:octocat:
View GitHub Profile
@zhibor
zhibor / redshift_custom.py
Created April 14, 2025 01:40
sqlalchemy redshift_custom
from sqlalchemy.dialects import registry
from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2
class RedshiftPostgresDialect(PGDialect_psycopg2):
def _set_backslash_escapes(self, connection):
self._backslash_escapes = "off"
registry.register("redshift_custom", __name__, "RedshiftPostgresDialect")
from sqlalchemy import create_engine
db = create_engine("redshift_custom://user:password@redshifthost:5439/dev")
@zhibor
zhibor / duckdb.md
Created April 7, 2025 01:40
duckdb

duckdb -cmd "CREATE VIEW view_name AS FROM 'filename.csv';" -ui

@zhibor
zhibor / proofreader
Created April 7, 2025 01:32
llm proofreader
proofreader:
As a proofreading assistant, your task is to review user-provided text and make only spelling corrections. Follow these guidelines:
1. Correct misspelled words to their proper spelling.
2. Do not alter grammar, punctuation, capitalization, or sentence structure.
3. Preserve the original formatting, including line breaks and paragraphs.
4. The input text may range from a single word to multiple paragraphs. Apply the same rules regardless of length.
5. Return only the corrected text, without any additional comments or explanations.
IMPORTANT: Return only the corrected text. IMPORTANT:Return only the corrected text. ONLY THAT! Nothing else.
#!/opt/miniconda3/bin/python
import duckdb
import glob
import sys
import logging
from pathlib import Path
from typing import Optional, Union
import re
# Configure logging
import json
import networkx as nx
from collections import defaultdict
from typing import Dict, Set, List
def export_schema_to_arrows(G: nx.DiGraph) -> str:
"""
Export the schema of a NetworkX DiGraph to Arrows.app JSON format.
Schema includes unique node labels and relationship types with their connections.
@zhibor
zhibor / system.md
Created February 4, 2025 00:08
LLM Prompts

You are ChatGPT, a large language model trained by OpenAI. You are chatting with the user via the ChatGPT iOS app. This means most of the time your lines should be a sentence or two, unless the user's request requires reasoning or long-form outputs. Never use emojis, unless explicitly asked to. Current date: 2025-02-03

Image input capabilities: Enabled Personality: v2 Over the course of the conversation, you adapt to the user’s tone and preference. You want the conversation to feel natural. You engage in authentic conversation by responding to the information provided, asking relevant questions, and showing genuine curiosity. If natural, continue the conversation with casual conversation.

Your primary purpose is to help users with tasks that require extensive online research using the research_kickoff_tool's clarify_with_text, and start_research_task methods. If you require additional information from the user before starting the task, ask them for more detail before starting research using `clarify_

10 Management Behaviors That Always Backfire

By Dave Kline

1. Micromanaging

  • INTENTION: Maintain team harmony
  • REALITY: Small problems become big problems and resentment builds
  • BETTER WAY: Raise questions within 24 hours using:
    • "I noticed..."
  • "I'm concerned because..."
@zhibor
zhibor / 7 Traits That Make a Great Manager.md
Last active January 12, 2025 13:02
7 Traits That Make a Great Manager
  1. Transparency & Open Communication Clear, honest communication reduces uncertainty and prevents speculation. Tips:
  • Hold regular team updates
  • Tell the truth even when it's tough

2 . Investment in Employee Growth Top managers prioritise professional development and create learning opportunities.

@zhibor
zhibor / README.md
Created December 14, 2024 14:59
neo4j in docker
docker run -d \
    -p 7474:7474 -p 7687:7687 \
    --env NEO4J_PLUGINS='["apoc", "apoc-extended", "graph-data-science", "n10s"]' \
    --name=neo4j \
    --restart=unless-stopped \
    neo4j:5.20