Skip to content

Instantly share code, notes, and snippets.

View fightyz's full-sized avatar

Yang Zhou fightyz

  • DJI Technology Inc.
  • Shenzhen
View GitHub Profile
@fightyz
fightyz / com.googlecode.iterm2.plist
Created August 16, 2020 10:44
iterm2 的配置文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>ApplePressAndHoldEnabled</key>
<false/>
<key>AppleScrollAnimationEnabled</key>
<integer>0</integer>
set ts=4 "tab 四字节
set expandtab
set autoindent "自动格式化
set number
:inoremap jj <Esc>
@fightyz
fightyz / ys.zsh-theme
Last active August 16, 2020 10:27
zsh ys 主题文件
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# Mar 2013 Yad Smood
# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"
@fightyz
fightyz / .zshrc
Last active August 2, 2020 14:42
my .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
alias ls='ls -G'
alias grep='grep --color'
# autosuggest 的补全快捷键为逗号
bindkey ',' autosuggest-accept
ANDROID_HOME=~/Library/Android/sdk/platform-tools/
1. 查看当前 conda 环境中的配置
conda list
2. 查看 conda 管理的环境列表
conda info --envs
3. conda 切换环境
conda activate py2<environment name>
https://lnav.readthedocs.io/en/latest/hotkeys.html
lnav log.txt
:filter-in TAG
:filter-out TAG|TAG
/search
n/N 切换下一个/上一个
ctrl+w 可以开关单行
@fightyz
fightyz / mac_cmd
Last active December 2, 2019 12:04
### 查看所有进程
ps aux
### 杀死某个进程
kill [pid]
### 查找文件夹名
find / -name AnmyTest -type d(查找AnmyTest目录位置)
### 删除当前文件夹下除了 xx 文件外所有文件
rm -rf `ls | egrep -v '(README.md)'` // 删除当前文件夹下除了 README.md 外所有文件
### 1. 查看一个 https 连接的证书链
openssl s_client -connect douban.com:443
import android.content.Context;
public class DensityUtil {
/**
* 根据手机的分辨率从 dp 的单位 转成为 px(像素)
*/
public static int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
@fightyz
fightyz / vs_code_shortkey
Last active August 27, 2020 13:55
vs code shortkey
1. 跳转到上一个光标处:ctrl -
2. 跳转到下一个光标处:ctrl shift -
3. 跳转到实现处:cmd F12
4. 查找symbol: cmd shift o
5. 块编辑(block edit): shift option click
6. 整行上/下移动
[option] + [上下方向]
7. 格式化代码:[shift] + [Option] + f
8. 搜索出来的结果,全部按行搞到新的文件中: