Skip to content

Instantly share code, notes, and snippets.

@revotu
revotu / tmux-cheatsheet.markdown
Created September 20, 2018 03:11 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@revotu
revotu / remove_empty_directories.py
Created August 9, 2017 06:50
Python Recursively Remove Empty Directories
#Recursively Remove Empty Directories
import os
for root, dirs, files in os.walk(path, topdown=False):
if not files and not dirs:
os.rmdir(root)
#Recursively Remove Empty Directories, During do something like os.remove(file)
@revotu
revotu / remove_attrs.py
Last active January 27, 2024 06:48
remove all HTML attributes with BeautifulSoup except some tags(<a> <img>...)
from bs4 import BeautifulSoup
# remove all attributes
def _remove_all_attrs(soup):
for tag in soup.find_all(True):
tag.attrs = {}
return soup
# remove all attributes except some tags
def _remove_all_attrs_except(soup):