Skip to content

Instantly share code, notes, and snippets.

View Xi-HHHM's full-sized avatar

Xi-Huang Xi-HHHM

View GitHub Profile
@Xi-HHHM
Xi-HHHM / iterm2.md
Created October 12, 2023 09:21 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)

##Python 代码优化常见技巧

###改进算法,选择合适的数据结构

  • 使用dict的查找要比list快很多

  • 当要求list的交集时,转化成set来计算比较快。set的常见操作:

    union: set(list1) | set(list2)
    intersection: set(list1) & set(list2)
    difference: set(list1) - set(list2)