Skip to content

Instantly share code, notes, and snippets.

View wfjsw's full-sized avatar

Jianshu Wang wfjsw

View GitHub Profile
@wfjsw
wfjsw / convert_to_pth.py
Created August 3, 2023 16:54
A conceptual safetensors converter for RVC
import pathlib
import torch
from safetensors import safe_open
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument("input", metavar="in", type=str, default="model.safetensors", help="Input .safetensors model path")
parser.add_argument("-m", "--metadata", required=False, metavar="meta", type=str, default="model.json", help="Metadata .json path")
parser.add_argument("output", metavar="out", nargs="?", default=None, type=str, help="Output .pth model path")
@wfjsw
wfjsw / convert-pt-embedding-to-png.ipynb
Last active November 24, 2022 00:50
convert-pt-embedding-to-png.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wfjsw
wfjsw / map.java
Created August 9, 2022 14:01
paladin80/map - Paladin Vent Influence Map Source Code
import java.awt.image.BufferedImage;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.Rectangle2D;
import java.util.*;
import java.sql.*;
public class Map extends Frame implements Runnable {
private final int quarternizer = 1;
@wfjsw
wfjsw / plugin.ini
Created January 28, 2022 13:02 — forked from KagurazakaNyaa/plugin.ini
Pathfinder WaterMark
[PLUGIN]
MODULES_ENABLED = 1
[PLUGIN.MODULES]
DEMO = ./app/ui/module/demo
EMPTY = ./app/ui/module/empty
WATERMARK = ./app/ui/module/watermark
@wfjsw
wfjsw / enc.js
Last active August 31, 2023 07:56
const askhyZESMiTa = "aMq0Vk2QThOJ1qsK";
const asirwND73kx2 = "bENVgtN9llqTCWPS";
const ackQjV8pRLFF = "dKyBVluERbCaupYE";
const aciaallf8z0Q = "fZsaKttlA5A8GX7A";
const dskhXKbQZi19 = "hKVw3rIJQJlHirdh";
const dsizKZaAJQLb = "xH8I8jYDZY33QzJJ";
const dckvUcTa9vft = "oz2zCOI3ow8YN1gJ";
const dciZ7hxfi8SC = "ph4oq7nooy3NnkRE";
const aes_local_key = 'emhlbnFpcGFsbWtleQ==';
const aes_local_iv = 'emhlbnFpcGFsbWl2';
@wfjsw
wfjsw / go-shit.md
Last active December 28, 2020 14:24
Go 坑与经验教训

Go 坑与经验教训

记录一些 Go 应用开发时可能遇到的坑以备未来参考。个人见解或许有误。

  1. 注意限制传入 make 的长度范围,尤其是基于外部输入的时候,避免内存爆炸。错误写法范例: https://github.com/mumble-voip/grumble/blob/181a4f321998046264246cfeb348803636c1c386/cmd/grumble/client.go#L246-L252
	// Read the message length (32-bit big-endian unsigned integer)
	err = binary.Read(client.reader, binary.BigEndian, &length)
	if err != nil {
@wfjsw
wfjsw / 1000phone-sign-in.user.js
Last active May 30, 2020 06:00
1000phone auto sign in
// ==UserScript==
// @name 1000Phone Auto Sign In
// @namespace https://jsw3286.eu.org/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://pt.1000phone.net/livingRoom?*
// @require https://code.jquery.com/jquery-3.5.1.min.js
// @grant none
// ==/UserScript==
@wfjsw
wfjsw / ping.js
Created March 30, 2019 12:13
Script snippet used to check MTProxy availability.
var Uint64BE, Int64BE, Uint64LE, Int64LE; !function (E) { var g, A = "undefined", U = A !== typeof Buffer && Buffer, I = A !== typeof Uint8Array && Uint8Array, L = A !== typeof ArrayBuffer && ArrayBuffer, d = [0, 0, 0, 0, 0, 0, 0, 0], n = Array.isArray || function (t) { return !!t && "[object Array]" == Object.prototype.toString.call(t) }, w = 4294967296; function t(t, r, a) { var c = r ? 0 : 4, y = r ? 4 : 0, n = r ? 0 : 3, e = r ? 1 : 2, o = r ? 2 : 1, i = r ? 3 : 0, u = r ? k : J, s = r ? O : _, f = l.prototype, h = "is" + t, v = "_" + h; return f.buffer = void 0, f.offset = 0, f[v] = !0, f.toNumber = p, f.toString = function (t) { var r = this.buffer, f = this.offset, n = B(r, f + c), e = B(r, f + y), o = "", i = !a && 2147483648 & n; i && (n = ~n, e = w - e); t = t || 10; for (; ;) { var u = n % t * w + e; if (n = Math.floor(n / t), e = Math.floor(u / t), o = (u % t).toString(t) + o, !n && !e) break } i && (o = "-" + o); return o }, f.toJSON = p, f.toArray = m, U && (f.toBuffer = S), I && (f.toArrayBuffe
@wfjsw
wfjsw / stub.js
Created October 6, 2018 12:53
Fetch stats.craft.moe banned users.
let players = await fetch('/static/data/players.json')
players = await players.json()
let players_uuid = players.map(p => p.uuid)
let banned_uuids = []
for (let u of players_uuid) {
let p = await fetch(`/static/data/${u}/stats.json`)
p = await p.json()
if (p.data.banned) banned_uuids.push(u)
}
环境:(完全模拟 api.telegram.org 运行环境)
TDLib,运行参数:
use_message_database: false,
use_secret_chats: false,
use_chat_info_database: false,
use_file_database: false
同样的一条消息在 Full 全开 和 只开 Basic 之间的差距
两者得到的消息分别在两个 JSON 文件中