Skip to content

Instantly share code, notes, and snippets.

View shuxiaokai's full-sized avatar
:octocat:

shuxiaokai

:octocat:
  • M78 Nebula
  • Mars
View GitHub Profile
@shuxiaokai
shuxiaokai / unwxapkg.py
Created November 21, 2024 13:03 — forked from Integ/unwxapkg.py
A useful tool for unpack wxapkg file with python3 surport.
# coding: utf-8
# py2 origin author lrdcq
# usage python3 unwxapkg.py filename
__author__ = 'Integ: https://github.com./integ'
import sys, os
import struct
class WxapkgFile(object):
@shuxiaokai
shuxiaokai / index.html
Created September 12, 2024 15:10
Nixie Tube Clock
<svg id="noise-svg">
<!-- gives background a bit of texture -->
<filter id='noiseFilter'>
<feTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch' />
</filter>
<rect id="noise-rect" filter='url(#noiseFilter)' />
</svg>
<div class="clock off">
<div class="shadow"></div>
@shuxiaokai
shuxiaokai / fast_speech_text_speech.py
Created February 16, 2024 04:13 — forked from thomwolf/fast_speech_text_speech.py
speech to text to speech
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
pip install whisper pynput pyaudio
"""
from openai import OpenAI
import time
@shuxiaokai
shuxiaokai / gist:869dad8c4285fae4d01d9436b3d8b3a5
Created November 28, 2023 08:33 — forked from levelsio/gist:5bc87fd1b1ffbf4a705047bebd9b4790
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@shuxiaokai
shuxiaokai / docker-registry-mirrors.md
Created June 30, 2023 06:45 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@shuxiaokai
shuxiaokai / colab_vscode.py
Created October 4, 2022 09:59 — forked from nmichlo/colab_vscode.py
Run vscode on colab!
# Adapted from https://amitness.com/vscode-on-colab
# Copy this script into a colab cell
# install deps if needed
!(command -v "code-server" 1>/dev/null) || (curl -fsSL https://code-server.dev/install.sh | sh && echo)
!(python -c "import pyngrok" 2>/dev/null) || (pip install -qqq pyngrok)
# run vscode in background if needed
!(ps -ef|awk '/code-server/&&!/awk/{exit 1}') && (nohup code-server --port 9000 --auth none &)
@shuxiaokai
shuxiaokai / downloadGitLfsFiles.md
Created August 9, 2022 10:11 — forked from fkraeutli/downloadGitLfsFiles.md
How to download GIT LFS files

How to retrieve GIT LFS files from GitHub

Retrieving non-LFS files

Through the GitHub API it is possible to retrieve individual files from a Git repository via, e.g. curl. To do so, first retrieve the content information for the relevant file (or folder):

curl https://api.github.com/repos/{organisation}/{repository}/contents/{file or folder path}

For private repositories, authenticate using your username and a personal access token

@shuxiaokai
shuxiaokai / README.md
Created June 14, 2022 08:35 — forked from ZipFile/README.md
Pixiv OAuth Flow

Retrieving Auth Token

  1. Run the command:

    python pixiv_auth.py login

    This will open the browser with Pixiv login page.

@shuxiaokai
shuxiaokai / README.md
Created May 5, 2022 08:06 — forked from florimondmanca/README.md
HTTPX vs aiohttp (over HTTPS)

Usage

  • Generate TLS certificates for localhost:
pip install trustme-cli
trustme-cli
  • Run wrk on each endpoint, eg: