Skip to content

Instantly share code, notes, and snippets.

View bombless's full-sized avatar

York Xiang bombless

  • Guangzhou, China
View GitHub Profile
@bombless
bombless / play_tones.py
Created July 19, 2024 09:17
Play twinkle song
import math
import sounddevice as sd
def frequency(base_freq, semitones):
return base_freq * (2 ** (semitones / 12))
DO = 440
RE = frequency(DO, 2)
https://stackoverflow.com/questions/26590174/convert-rtsp-stream-to-virtual-web-camera
@bombless
bombless / PrintDirect.cs
Last active January 18, 2024 03:29 — forked from corytodd/csharp_gdi_print.cs
GDI Printing Example for C#
// https://www.c-sharpcorner.com/UploadFile/dbeniwal321/using-gdi-print-functionality/
//PrintDirect.cs
//shows how to write data directly to the
//printer using Win32 APIs.
//this code sends Hewlett-Packard PCL5 codes
//to the printer to print
//out a rectangle in the middle of the page.
using System;
using System.Text;
using System.Runtime.InteropServices;
@bombless
bombless / gist:0191487e074f40d988ca35773e4bcdd2
Created November 24, 2023 13:36
gpt4v and stable video diffusion
https://www.gpt4v.net/zh-CN/yeschat/
https://weel.co.jp/media/stable-video-diffusion
{
"svd": ["https://huggingface.co/stabilityai/stable-video-diffusion-img2vid/resolve/main/svd.safetensors", "checkpoints/svd.safetensors"],
"svd_xt": ["https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt/resolve/main/svd_xt.safetensors", "checkpoints/svd_xt.safetensors"]
}
https://websetnet.net/how-to-install-wechat-desktop-client-in-ubuntu-linux/
Snap makes it easier to install WeChat unofficial client in Linux. Before you can install electronic-chat, you will need to install snapd and snapd-xdg-open. Run the below command to install it:
sudo apt install snapd snapd-xdg-open
Once done, type the following command to install it.
sudo snap install electronic-chat
This will install WeChat client. Once done, launch it from the terminal by typing:
electronic-chat
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdflsdk/
@bombless
bombless / paddleocr.md
Created June 27, 2023 08:14
安装paddleocr
@bombless
bombless / javascript-parse-javascript-string-literal.md
Created May 9, 2023 23:27
javascript parse javascript string literal
const acorn = require("acorn");

const code = `export default "hello, world";`;

const parsed = acorn.parse(code, {
  sourceType: "module",
});

const stringLiteral = parsed.body[0].declaration.arguments[0].value;
@bombless
bombless / knowledge.sh
Last active May 26, 2023 08:44
新学的命令行
# 读取当前目录下这些目录中各有多少文件
ls . |awk -F ' ' '{("find "$1" |wc -l") | getline n;print n "\t" $1}'
# 从命令输出而不是文件名得到一个文件流重定向
awk '{print "hello,",$0}' <(echo mr. white)
# 在命令的任意位置指定重定向到文件
echo Hello, world. > hello Nice to meet you!
@bombless
bombless / egui-font-update-tips.md
Created April 16, 2023 15:22
egui font update tips

set_fonts set fonts inside a font cache on Context and then fonts in cache are actually updated on frame startup

that's why you need to load font and display it in the next frame