tech| 我的开发环境 & 效率工具

2019-07-08  本文已影响0人  daydaygo

date: 2018-8-30 13:15:52
title: 我的开发环境

zen


mark

# allow app form anywhere
sudo spctl --master-disable

# SIP(system integrity protection, rootless)
csrutil disable

# 使用简单密码
pwpolicy -clearaccountpolicies
passwd # 修改密码

# 删除默认输入法
cd ~/Library/Preferences
cp com.apple.HIToolbox.plist com.apple.HIToolbox.plist.bak
sudo open com.apple.HIToolbox.plist # 关闭SIP -> 切换到默认输入法, 才能保存 -> 安装xcode, 也可以 xed com.apple.HIToolbox.plist -> 重启

# 七牛图片高级处理: https://developer.qiniu.com/dora/manual/1270/the-advanced-treatment-of-images-imagemogr2
?imageMogr2/auto-orient/thumbnail/500x500 # 自动旋转; 等比限宽+高缩放
?imageMogr2/rotate/-90 # 旋转

alfred

alfred的确是神器, 需要好好提提:

Alfred workflow
workflow - gtihub: gh > help 查看帮助

iterm2

mouseless copy C-f-tab
Autocomplete C-;
Paste History C-S-h
Full Screen C-enter
Window Arrangements: 保存常用TAB布局
Shell Integration/Utilities https://iterm2.com/documentation-shell-integration.html
Password Manager
show timestamp
open quickly
find cursor C-/
iterm2 粘贴时有多余字符 0~ 1~: printf '\e[?2004l'
copy mode: cmd-S-c(进入) -> C-v(选中模式) jkhl(移动) y(复制)
使用ubuntu主题: Preferences(cmd+,)-Profiles-default-colors-(Color Presets...)下拉中选择ubuntu
可以点击Visit Online Gallery下载颜色主题

reference


mac PHP环境一键配置

# homebrew https://brew.sh/
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# homebrew 加速源: https://mirror.tuna.tsinghua.edu.cn/help/homebrew/
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
brew tap homebrew/core
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew tap homebrew/cask
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew update
# 复原
# git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
# git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
# git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
# brew update

# homebrew-bottles
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

# iterm2
brew cask install iterm2

# vim: 可以命令行使用 code 命令, 使用 vscode 编辑文件
# brew install vim

# fish shell: 推荐使用
brew install fish
# sudo echo '/usr/local/bin/fish' >> /etc/shells
# chsh -> 切换默认shell
# fish_config -> 配置 fish
# fish 配置目录: ~/.config/fish

# php: 项目中目前统一使用 7.2
# 踩到的坑: 本地 7.3 更新 composer 后, 有的包更新后强制要求使用 7.3, 导致其他环境 composer i 失败
brew install php@7.2
# 安装后注意根据提示添加 PATH
# composer: https://developer.aliyun.com/composer
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
# pecl: http://pecl.php.net/
# 可以在 pecl 上下载好包后直接安装, 避免重复网络请求
# swoole
# 确保环境变量里能找到 openssl 的编译库
pecl install swoole-4.4.13.tgz
# 使用 `php --ini` 查找 php.ini 文件位置, 编辑添加 `swoole.use_shortname = 0`, 使用 `php --ri swoole` 确认是否生效
pecl install redis-5.1.1.tgz
pecl install mongodb-1.6.1.tgz
# protobuf
brew install protobuf
pecl install protobuf-3.11.1.tgz
# kafka
brew install librdkafka
pecl install rdkafka-4.0.0.tgz
# zookeeper
brew install zookeeper
pecl install zookeeper-0.6.4.tgz
上一篇 下一篇

猜你喜欢

热点阅读