Skip to content

Instantly share code, notes, and snippets.

View Sg4Dylan's full-sized avatar
🐱

SgDylan Sg4Dylan

🐱
View GitHub Profile
@Sg4Dylan
Sg4Dylan / zansei.py
Last active June 18, 2021 15:53
「残声」概念验证
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Created: 06/18/2021
import numpy as np
from scipy import signal
from scipy.io.wavfile import write
import librosa
import resampy
@Sg4Dylan
Sg4Dylan / gfwlist2unbound.py
Created May 8, 2020 01:19
将 gfwlist 转换为 Unbound 的 forward-zone 格式
# -*- coding:utf-8 -*-
"""
Convert https://raw.githubusercontent.com/petronny/gfwlist2pac/master/gfwlist.pac for unbound.
"""
import re
with open("gfwlist.conf", 'w') as wp:
for line in open("gfwlist.pac"):
@Sg4Dylan
Sg4Dylan / silk-v3-decoder-compile-on-raspberry-pi.md
Last active August 15, 2021 16:32
silk-v3-decoder 树莓派编译手记

不要汇编优化

修改 Makefile

CC     = $(TOOLCHAIN_PREFIX)gcc$(TOOLCHAIN_SUFFIX) -DNO_ASM
CXX    = $(TOOLCHAIN_PREFIX)g++$(TOOLCHAIN_SUFFIX) -DNO_ASM

要汇编优化

特别适用于 ArchLinux ARM 选手,其他发行版需稍作修改

@Sg4Dylan
Sg4Dylan / NginxAutoindexExporter.js
Last active September 15, 2021 14:35
配合 phuslu 的 autoindex,实现 nginx 自动列目录导出到 aria2
// ==UserScript==
// @name NginxAutoindexExporter
// @namespace http://tampermonkey.net/
// @version 20180915(0.2)
// @description Export link from nginx autoindex to aria2
// @author SgDylan
// @match https://example.com/*
// @grant none
// ==/UserScript==
@Sg4Dylan
Sg4Dylan / ascii2d_batch_match.py
Created July 19, 2020 08:23
使用 Ascii2D 批量匹配可能存在于 Pixiv 的 Twitter 图片
import os
import re
import json
import urllib
import requests
import wget
from tqdm import tqdm
from bs4 import BeautifulSoup
# 执行推理用
import numpy as np
@Sg4Dylan
Sg4Dylan / README.md
Last active January 27, 2022 13:53
Sync Voicemeeter's gain control to Windows volume control

Install

pip install psutil pycaw future toml
git clone https://github.com/Freemanium/voicemeeter-remote-python
cd voicemeeter-remote-python
pip install .

Modify line 16 of voicemeeter/remote.py

@Sg4Dylan
Sg4Dylan / build_win64.yml
Created January 28, 2022 10:53
GitHub action workflow for building OBS plugin obs-libfdk on win64 platform
name: 'CI Build'
on:
push:
paths-ignore:
- '**.md'
branches:
- master
- 'release/**'
tags:
@Sg4Dylan
Sg4Dylan / BH1750_CTL.ino
Created June 24, 2019 12:58
显示器亮度自动调节套装
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup(){
Serial.begin(9600);
// Initialize the I2C bus (BH1750 library doesn't do this automatically)
// On esp8266 devices you can select SCL and SDA pins using Wire.begin(D4, D3);
Wire.begin();
@Sg4Dylan
Sg4Dylan / bilibili_download_them_all.py
Last active April 15, 2023 16:32
通过You-get批量下载Bilibili合集视频
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Purpose: A simple script to download video from Bilibili
# Created: 08/07/2016
import sys
from subprocess import call
def check_and_go(args):
@Sg4Dylan
Sg4Dylan / qbittorrent_rss_cleaner.py
Created May 30, 2023 07:24
Remove outdated RSS records for qBittorrent
import os
import json
import re
from datetime import datetime, timedelta
rss_json = ''
for i in os.listdir('.'):
if i.endswith('.json'):
rss_json = i