Skip to content

Instantly share code, notes, and snippets.

@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:不重编码(快,零画质损失)
@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 / .vimrc
Last active May 20, 2026 04:33
Vim
" ==============================
" UI & behavior
" ==============================
if has('termguicolors')
set termguicolors
endif
set background=dark
syntax enable
@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 / 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
# 支持显示特殊字符
# set -g default-terminal "screen-256color"
# set -ga terminal-overrides ",xterm*:Tc:sitm=\E[3m"
set -g default-terminal "tmux-256color"
set -as terminal-features ",xterm*:RGB"
set -g base-index 1 # 窗口编号从 1 开始计数
set -g display-panes-time 10000 # PREFIX-Q 显示编号的驻留时长,单位 ms
set -g mouse on # 开启鼠标
set -g pane-base-index 1 # 窗格编号从 1 开始计数
@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