跳至主要內容
常用的js代码片段
function getSelectedText() {
	if (window.getSelection) { // This technique is the most likely to be standardized.         
		// getSelection() returns a Selection object, which we do not document.        
		return window.getSelection()
			.toString();
	} else if (document.getSelection) {
		// This is an older, simpler technique that returns a string        
		return document.getSelection();
	} else if (document.selection) {
		// This is the IE-specific technique.         
		// We do not document the IE selection property or TextRange objects.         
		return document.selection.createRange()
			.text;
	}
}

爱喝水的木子...大约 2 分钟codejavascriptcode
关于m4a文件转成wav文件

m4a文件转为16bit,单声道,采样率为48kHz

for i in *.m4a; do ffmpeg -i "$i" -acodec pcm_s16le -ac 1 -ar 48000 "${i%}.wav"; done
-acodec pcm_s16le:16bit
-ac 1:单声道
-ar 48000:48kHZ

爱喝水的木子...小于 1 分钟codeffmpegpythoncode
服务器上安装vscode-远程写代码

安装

curl -fOL https://github.com/coder/code-server/releases/download/v4.2.0/code-server_4.2.0_amd64.deb

修改配置

vim ~/.config/code-server/config.yaml
bind-addr:后面的部分改成0.0.0.0:xxxx(xxxx表示端口号,可随意设置)
password:后面的部分改成你想要的密码

爱喝水的木子...小于 1 分钟devcodeserverdev