Skip to content

Instantly share code, notes, and snippets.

@lazydao
lazydao / pick.lua
Last active May 20, 2022 03:46
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 / tips.md
Last active June 2, 2022 02:24
CSS 学习集
  • 颜色:"black" = "#000000" = "#000" = rgb(0, 0, 0)
  • style 优先级:!important > inline styles > id > class > 声明更前的class
@lazydao
lazydao / .tmux.conf
Last active April 24, 2024 05:48
tmux配置
# 支持显示特殊字符
# set -g default-terminal "xterm-256color" # 有些情况需要改用这个配置,一般情况下用下面两条
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
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 开始计数
set -g renumber-windows on # 关掉某个窗口后,编号重排
@lazydao
lazydao / ipyenv.sh
Last active April 24, 2024 05:49
Linux集子
# 用淘宝源下载python包进行安装
v=$1
wget https://npm.taobao.org/mirrors/python/$v/Python-$v.tar.xz -P ~/.pyenv/cache/
pyenv install $v
@lazydao
lazydao / .vimrc
Last active April 24, 2024 11:12
vim配置
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) | PlugInstall --sync | source $MYVIMRC | endif
call plug#begin('~/.vim/plugged')