Skip to content

Instantly share code, notes, and snippets.

View ssghost's full-sized avatar
🏠
Working from home

Stardust Song ssghost

🏠
Working from home
View GitHub Profile
@ssghost
ssghost / chatbot-arena-mle-elo-rating-bradley-terry-model-calculation-apr-9-2024.ipynb
Created April 19, 2024 21:03
Chatbot Arena: MLE Elo Rating (Bradley-Terry model) Calculation (Apr 9, 2024)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ssghost
ssghost / tvta.py
Last active April 14, 2024 00:10
from tradingview_ta import TA_Handler, Interval
import requests
import timeout_decorator
@timeout_decorator.timeout(300)
def tvta():
symbols = ["BTCUSDT", "ETHUSDT", "SOLUSDT", "BCHUSDT"]
for sym in symbols:
handler = TA_Handler(symbol=sym, screener='crypto', exchange='BINANCEUS', interval=Interval.INTERVAL_1_DAY)
import hashlib
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import PlainTextResponse
from starlette.routing import Route
async def online_sha256(stream) -> bytes:
hasher = hashlib.sha256()
use pyo3::prelude::*;
#[pyclass]
#[derive(Debug, Clone, PartialEq)]
enum AttachmentType {
Image,
Video,
Audio,
File,
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ssghost
ssghost / gui.c
Created February 10, 2024 11:07 — forked from nir9/gui.c
Simple X11 Window Creation in C - Not for production, only for fun (gcc gui.c -lX11)
#include <X11/Xlib.h>
int main() {
XEvent event;
Display* display = XOpenDisplay(NULL);
Window w = XCreateSimpleWindow(display, DefaultRootWindow(display), 50, 50, 250, 250, 1, BlackPixel(display, 0), WhitePixel(display, 0));
XMapWindow(display, w);
XSelectInput(display, w, ExposureMask);
for (;;) {
config.version=6
global.use_flock=false
profile1.qt.last_path=/root
profile1.qt.places.SortColumn=1
profile1.qt.places.SortOrder=0
profile1.qt.settingsdialog.exclude.SortColumn=1
profile1.qt.settingsdialog.exclude.SortOrder=0
profile1.qt.settingsdialog.include.SortColumn=1
profile1.qt.settingsdialog.include.SortOrder=0
profile1.schedule.custom_time=8,12,18,23
config.version=6
global.use_flock=false
profile1.qt.last_path=/root
profile1.qt.places.SortColumn=1
profile1.qt.places.SortOrder=0
profile1.qt.settingsdialog.exclude.SortColumn=1
profile1.qt.settingsdialog.exclude.SortOrder=0
profile1.qt.settingsdialog.include.SortColumn=1
profile1.qt.settingsdialog.include.SortOrder=0
profile1.schedule.custom_time=8,12,18,23
import gymnasium as gym
import numpy as np
from gymnasium.envs.mujoco.mujoco_env import MujocoEnv
# Env initialization
env = gym.make("Swimmer-v4", render_mode="human")
# Wrap to have reward statistics
env = gym.wrappers.RecordEpisodeStatistics(env)
mujoco_env = env.unwrapped
n_joints = 2
@ssghost
ssghost / rl-baselines-zoo.ipynb
Created January 18, 2024 22:25
rl-baselines-zoo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.