Skip to content

Instantly share code, notes, and snippets.

View XueshiQiao's full-sized avatar
🕶️
WebRTC

xueshi XueshiQiao

🕶️
WebRTC
View GitHub Profile
@XueshiQiao
XueshiQiao / macOS-like-keyboard.ahk
Last active April 12, 2025 05:41
在 Windows 上模拟 macOS 的快捷键体验 + Vim 体验
#Requires AutoHotkey v2.0
; recommended for performance and compatibility with future autohotkey releases.
#UseHook
#SingleInstance force
InstallKeybdHook()
SendMode "Input"
/**
@XueshiQiao
XueshiQiao / index.html
Last active August 31, 2024 03:12
Play streamed pcm on browser
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PCM to MP3 Player (with Queue and Delay)</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lamejs/1.2.0/lame.min.js"></script>
</head>
<body>
@XueshiQiao
XueshiQiao / joey_archlinux.toml
Last active May 7, 2024 08:43
Linux_evremap_config
# Config file for evremap (https://github.com/wez/evremap)
# usage:
# sudo target/release/evremap remap /path/to/joey_archlinux.toml
# device_name = "AT Translated Set 2 keyboard"
device_name = "Apple Inc. Magic Keyboard with Touch ID"
# add phys when multiple device_name with same name exists
phys = "usb-0000:02:00.0-6/input1"
# Hold capslock for ctrl, tap for esc
@XueshiQiao
XueshiQiao / run_whisper.sh
Last active March 27, 2024 08:46
Run Whisper
# whisper https://github.com/openai/whisper
# 使用GPU做ASR,因为 1080 显存限制,使用medium比较合适(medium 使用约 5G 显存,大于 10G 显存可以用 large)
# T4 GPU,16G 显存,跑 meidum 时耗比大概 0.36(303 秒的音频用了 108s),显存占用 4.8G,显卡利用率在 85% 左右
# --word_timestamps True --highlight_words True 显示 word-level 的时间戳(不加为 sentence-level)
whisper --model medium --language Chinese --verbose True --word_timestamps True --highlight_words True .\download.mp4
# 使用 CPU
whisper --device cpu --threads 10 --model large --language Chinese --verbose True --word_timestamps True --highlight_words True .\download2.mp4
#include <iostream>
#include <functional>
using namespace std;
// -std=c++17
template <typename In, typename Out>
class Filter {
public:
@XueshiQiao
XueshiQiao / .Xmodmap
Last active August 9, 2022 06:33
Global Vim-like Arrow Mapping configuration using xmodmap on Ubuntu
! ref: https://wiki.archlinux.org/title/Xmodmap
! exec: xmodmap ~/.Xmodmap
! Set Keyboard::Dispatch to 'keyCode' in VSCode, otherwise capslock remapping does't work
! ref: https://github.com/microsoft/vscode/issues/23991
! auto startup with system:
! add following command to 'Startup Applications Preferences' app on Ubuntu
! /bin/bash -c 'xmodmap /home/xueshi/.Xmodmap'
clear lock
! Map Caplock key to Mode_switch key, we use it as 'Hyper' key later
@XueshiQiao
XueshiQiao / cpp_move.cpp
Last active February 12, 2021 17:48
C++ std:move usage sample
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
class SimpleString {
public:
SimpleString(int s, const char* content): size(s+1), string(new char[s+1]) {
for (int i = 0; i < size - 1; i++) {
@XueshiQiao
XueshiQiao / cvim.conf
Last active February 6, 2020 07:04
configuration for Chrome extension cVim
"=======================设置=======================
set smoothscroll
let typelinkhintsdelay = 0
"let showtabindices = 1
let barposition = "top"
let searchlimit = 50
"let hintcharacters = "abc123"
"===============Custom Key maps===================
"打开书签管理器,自动搜索manager(但并不输入回车)
@XueshiQiao
XueshiQiao / plantuml_style.puml
Created August 30, 2019 03:03
Style configuration for PlantUML
'ORIGNAL: https://raw.githubusercontent.com/xuanye/plantuml-style-c4/master/core.puml
@startuml core
!includeurl https://raw.githubusercontent.com/xuanye/plantuml-style-c4/master/colors.puml
' uncomment the following line and comment the first to use locally
'!include colors.puml
!includeurl https://raw.githubusercontent.com/xuanye/plantuml-style-c4/master/skinparam.puml
' uncomment the following line and comment the first to use locally
'!include skinparam.puml
@XueshiQiao
XueshiQiao / ExportNetEaseMusicSongList.js
Last active October 25, 2024 19:29
导出网易云音乐歌单到 AppleMusic / Spotify 等平台
/**
* 使用方法:
* 1. 用 Chrome 打开歌单的 web 页面(可以通过分享拿到链接,链接类似这样:http://music.163.com/playlist?id=xxx&userid=yyy)
* 2. 然后右键“检查”(如果有左上角有 device 选项,需要选择 Laptop 开头的,可以在 Edit/编辑 里添加,添加的时候注意 “User Agent string” 里选择 Desktop)
* 3. 在 console 里输入下面脚本,即可输出 “歌曲名 - 歌手名” 格式的内容:
Springsteen - Eric Church
Chattahoochee - Alan Jackson
Baby Now That I Found You - Alison Krauss
Check Yes or No - George Strait