Skip to content

Instantly share code, notes, and snippets.

View ZihaoZhou's full-sized avatar

Zihao Zhou ZihaoZhou

View GitHub Profile
@ZihaoZhou
ZihaoZhou / anom_check.py
Created September 30, 2024 03:42
Check git repo anonymity
import os
import subprocess
import glob
import zipfile
from litellm import completion
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
@ZihaoZhou
ZihaoZhou / server.py
Created March 22, 2024 05:52
Turning Poe API into OpenAI API
import os
import secrets
import fastapi_poe as fp
from sanic import Sanic
from sanic.response import json
from json import dumps
from sanic_cors import CORS
from base64 import urlsafe_b64encode
@ZihaoZhou
ZihaoZhou / apichat.py
Last active December 2, 2023 01:05
A Chat-GPT based Slackbot for Wiki Information Retrieval
import openai
from openai import OpenAI
import os
def load_environment_variables(filepath='.env'):
script_dir = os.path.dirname(os.path.abspath(__file__))
filepath = os.path.join(script_dir, filepath)
with open(filepath, 'r') as file:
for line in file:
@ZihaoZhou
ZihaoZhou / monitor.py
Created December 2, 2023 00:49
Monitor UCSD Nautilus Node Usage Status
############################
# Usage: python monitor.py #
############################
import subprocess
import json
import re
import multiprocessing
from multiprocessing import Process, Manager
from prettytable import PrettyTable