Skip to content

Instantly share code, notes, and snippets.

View Sansui233's full-sized avatar
🙉
Boom!

Sansui233 Sansui233

🙉
Boom!
View GitHub Profile
@Sansui233
Sansui233 / generate_list.py
Last active August 30, 2025 08:51
Generate .list file for gpt-sovits and genshin-voice dataset by 红血球 in a quick way. 这个数据集并不需要 ASR 标注与前置处理,只需要生成 list 文件就可以了
import argparse
import os
import subprocess
import sys
import wave
def check_ffmpeg():
"""Check if ffmpeg is installed."""
try:
var FindProxyForURL = function(init, profiles) {
return function(url, host) {
"use strict";
var result = init, scheme = url.substr(0, url.indexOf(":"));
do {
if (!profiles[result]) return result;
result = profiles[result];
if (typeof result === "function") result = result(url, host, scheme);
} while (typeof result !== "string" || result.charCodeAt(0) === 43);
return result;
@Sansui233
Sansui233 / draw.io.custom.json
Last active November 10, 2024 18:46
draw.io text style, color presets, vertex and edge style custom configuration (modern design)
{
"defaultGridEnabled": false,
"defaultPageVisible": false,
"customFonts": [
"Inter",
"pingfang sc"
],
"defaultVertexStyle": {
"strokeWidth": 2,
"fontSize": 16,
@Sansui233
Sansui233 / .zshrc
Last active March 15, 2024 18:36
Terminal configure with zi and p10k
alias proxy="export http_proxy='socks://127.0.0.1:10808';export https_proxy='socks://127.0.0.1:10808'"
alias unproxy="export http_proxy='';export https_proxy=''"
alias vim='/c/Program\ Files/Neovim/bin/nvim.exe'
alias sudo='/c/Program\ Files\ \(x86\)/gsudo/sudo.exe'
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
if [ -f '/c/Users/lingn/miniconda3/Scripts/conda.exe' ]; then
@Sansui233
Sansui233 / Microsoft.PowerShell_profile.ps1
Last active August 11, 2025 07:09
Make powershell command more unix-like.
Write-Host ("Current time: " + (Get-Date -Format "yyyy-MM-dd HH:mm:ss"))
# Import-Module posh-git # select posh-git or oh-my-posh
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\pure.omp.json" | Invoke-Expression
#Invoke-Expression (&starship init powershell)
Import-Module PSReadLine
Set-PSReadLineKeyHandler -Key Ctrl+Shift+c -Function Copy
Set-PSReadLineKeyHandler -Key Ctrl+v -Function Paste
#Set-PSReadLineOption -EditMode Emacs
@Sansui233
Sansui233 / fix-indentation-logseq.py
Last active June 7, 2021 09:06
fix indentation destroyed by logseq
import re
import os
one = re.compile(r'(\t )+')
two = re.compile(r'(\t\t )+')
three = re.compile(r'(\t\t\t )+')
four = re.compile(r'(\t\t\t\t )+')
five = re.compile(r'(\t\t\t\t\t )+')
six = re.compile(r'(\t\t\t\t\t\t\t )+')
@Sansui233
Sansui233 / wubiConv.py
Last active March 31, 2021 11:47
五笔字典格式转换-清歌to落格
#!/usr/local/bin/python3.8
#!conding=utf8
import os
from datetime import date
# ==== Config ====
qgpath = "/Users/sansui233/Library/Mobile Documents/com~apple~CloudDocs/App备份/五笔/qgdict.txt"
lgpath = "/Users/sansui233/Library/Mobile Documents/com~apple~CloudDocs/App备份/五笔/output.txt"
outpath = "/Users/sansui233/Library/Mobile Documents/com~apple~CloudDocs/App备份/五笔/"
@Sansui233
Sansui233 / crc32calc.go
Last active January 30, 2021 05:38
crc32 encoding and decoding example / bilibili uid hash
func main() {
// IEEE is crc32b, which is used to hash bilibili uid
// Encode
uid := "21670130"
h := fmt.Sprintf("%x", crc32.ChecksumIEEE([]byte(uid)))
fmt.Printf("Encoding of %s: %s\n", uid, h)
// Decode
hashed := "6acc8733"
fmt.Printf("Start Decoding... \n")
for i := 1; i < 500000000; i++ {
@Sansui233
Sansui233 / default
Created December 6, 2020 08:13
nginx
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@Sansui233
Sansui233 / imgwidth640.sh
Created December 1, 2020 17:46
fix image width to 640px with ffmpeg
echo "Fix your images width into 640px"
path=$(pwd)
cd $path
echo "\033[34m[Info] Workdir: $path" $(tput sgr0)
files=$(ls $path)
for filename in $files
do
echo "\033[34m[Info] Converting $filename ........." $(tput sgr0)