Skip to content

Instantly share code, notes, and snippets.

@lazydao
lazydao / ipyenv.sh
Last active September 1, 2025 02:20
Linux
# 用淘宝源下载python包进行安装
v=$1
wget https://npm.taobao.org/mirrors/python/$v/Python-$v.tar.xz -P ~/.pyenv/cache/
pyenv install $v
@lazydao
lazydao / .tmux.conf
Last active August 5, 2026 09:03
Tmux
# --- Terminal / truecolor ---
set -g default-terminal "tmux-256color"
# 注意:terminal-features 匹配的是【外层终端的 TERM】,不是上面的 default-terminal。
# TERM 不以 xterm 开头的终端(wezterm/foot/alacritty/ghostty)不会命中 xterm* 规则,
# 且 RGB 与 extkeys 会一并静默失效、无任何报错。故预先列出常见项。
set -as terminal-features ",xterm*:RGB:extkeys" # 含 xterm-256color / xterm-kitty / xterm-ghostty
set -as terminal-features ",alacritty*:RGB:extkeys"
set -as terminal-features ",wezterm*:RGB:extkeys"
set -as terminal-features ",foot*:RGB:extkeys"
@lazydao
lazydao / pick.lua
Last active August 25, 2025 06:59
Lua
local function pick(rules, count, random_func)
random_func = random_func or math.random
count = count or 1
local ret = {}
local total_weight = 0
for _, v in ipairs(rules) do
local weight = v.weight
total_weight = total_weight + weight
end
@lazydao
lazydao / style.css
Last active December 9, 2025 02:52
CSS
/* 引入思源黑体和思源宋体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700&family=Noto+Serif+SC:wght@400;700&display=swap');
.document-content p,
.document-content body,
.document-content span,
.document-content ul li,
.document-content div {
font-family: 'Noto Serif SC', serif !important;
}
@lazydao
lazydao / .vimrc
Last active July 2, 2026 08:01
Vim
" ==============================
" UI & behavior
" ==============================
if has('termguicolors')
set termguicolors
endif
set background=dark
syntax enable
@lazydao
lazydao / ex.py
Created April 28, 2025 08:18
SnipDo
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import clr
clr.AddReference('System')
clr.AddReference('System.Web.Extensions')
from System import Uri
from System.Net import HttpWebRequest
from System.Text import Encoding
@lazydao
lazydao / command.md
Last active April 27, 2026 03:32
ffmpeg

视频截取最后1分钟

① 最快(不重编码,直接拷贝)

ffmpeg -sseof -60 -i "input.mp4" -c copy -avoid_negative_ts make_zero "last1min.mp4"
  • -sseof -60:从文件末尾往前定位 60 秒
  • -c copy:不重编码(快,零画质损失)