Skip to content

Instantly share code, notes, and snippets.

  • vertical scroll bar的行为,选Use bar mode
  • preview features,不要开Use new dark theme
  • font,调[All Text Tool Windows]
  • nuget package manager,格式选PackageReference,不清楚现在是不是默认值
  • debugging,勾上Automatically close the console when debugging stops
@imba-tjd
imba-tjd / Update-Golang.psm1
Last active December 3, 2022 06:11
Update Node.js and Golang for Windows
function Get-GolangVer {
$ProgressPreference = 'SilentlyContinue'
$info = iwr 'https://golang.google.cn/dl/'
if (-not $?) { return }
$info -match '"toggleVisible" id="go(.+?)">' | Out-Null
$ver = $Matches[1]
$ProgressPreference = 'Continue'
return $ver
}
@imba-tjd
imba-tjd / youdao.py
Last active February 9, 2022 04:16
有道翻译2
'''fanyi.youdao.com 请求库。支持版本1和2,尽量精简,保留USER_ID且不伪装UA,自动获取新saltkey。不考虑网络异常'''
import urllib3
import time
import hashlib
import json
import logging
logger = logging.Logger(__name__)
logger.addHandler(logging.NullHandler())
__all__ = ['fanyi_v2', 'fanyi_v1']
https://github.com/2noise/ChatTTS/blob/main/README_CN.md 免费版会加底噪
https://github.com/FunAudioLLM/CosyVoice
https://github.com/RVC-Boss/GPT-SoVITS
https://huggingface.co/spaces/hexgrad/Kokoro-TTS
讯飞:
https://www.ffkuaidu.com/ https://www.zhihu.com/question/443123456
https://github.com/coqui-ai/TTS
@imba-tjd
imba-tjd / mi-ftp-open.cs
Last active November 18, 2024 11:10
快速打开我的小米的FTP
// csc /o /t:winexe mi-ftp-open.cs
using System.Net.Sockets;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Runtime.InteropServices;
class Program
{
static readonly string[] IPList = {
"192.168.0.100", "192.168.0.101", "192.168.0.102", "192.168.0.103", "192.168.0.104",
@imba-tjd
imba-tjd / check.c
Created January 11, 2023 10:45
SQLite Device Characteristics Check
/* SQLite Device Characteristics Check
Goal:
Tell you whether -DSQLITE_ENABLE_ATOMIC_WRITE has benefits on your filesystem.
However I don't konw much about sqlite so the logic may not be right.
Usage:
Download sqlite3 source code.
gcc check.c sqlite3.c -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_ATOMIC_WRITE -DSQLITE_OMIT_LOAD_EXTENSION
@imba-tjd
imba-tjd / ngenize.cs
Last active February 22, 2023 12:31
A wrapper for ngen.exe
// LICENSE: MIT
using System;
using System.IO;
using System.Diagnostics;
using System.Reflection;
class Ngenize
{
const string NgenX86Path = @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe";
const string NgenX64Path = @"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe";
// KP Backuper:帮助解决卡琳典狱长在非最低难度下强制覆盖自动保存的特性。
// 放到与nw.exe同一目录下。运行后每隔一分钟会检测存档有没有发生变化,如果变了,就备份到www/save_bak目录下。
// 并发安全性:读取时会加读锁,因此不会读到一半游戏自动保存导致读取内容错误,副作用是此次游戏的自动保存会不生效(静默失败);但本游戏保存很频繁,因此无影响。对于游戏保存到一半时本程序触发读,本程序会过一秒钟重试。
// 编译:C:\tools\bflat-7.0.1-windows-x64\bflat.exe build KPBackuper.cs -Os --no-globalization --no-reflection --no-stacktrace-data && upx --lzma KPBackuper.exe
using System;
using System.IO;
using System.Threading;
using System.Runtime.InteropServices;
[DllImport("user32")]
@imba-tjd
imba-tjd / realpath.go
Last active February 2, 2023 03:21
realpath.exe for windows
// Git for Windows or git-bash contains a realpath.exe which is required by git code.editor
// However I'm using Git distribution from VS, which doesn't have it.
// Copying from Git for Windows isn't a good choice because it needs msys-2.0.dll
// This program offers similar function, which is enough for me.
// It won't resolve '~'. It works when path contains whitespaces.
package main
import (
"fmt"
// https://github.com/abejfehr/URLDecode
// Compile: gcc -Ofast -mtune=native -D__USE_MINGW_ANSI_STDIO -o urld.exe
// When decoding UTF8-encoded data, work with [xargsu2a](https://gist.github.com/imba-tjd/0a5a41df029babc6c814efe5d9296593)
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
char *urlDecode(const char *str) {
int d = 0;