Welcome
Docusaurus blogging features are powered by the blog plugin.
Here are a few tips you might find useful.
Docusaurus blogging features are powered by the blog plugin.
Here are a few tips you might find useful.
Blog posts support Docusaurus Markdown features, such as MDX.
Use the power of React to create interactive blog posts.
npx @react-native-community/cli@latest init Project_name
你在 .watchmanconfig 配置了 ignore_dirs,目的是让 Watchman 忽略一些目录。如果修改了配置,需要让 Watchman 重新加载配置或重启 Watchman 监控。可以按照以下步骤操作:
watchman watch-del-all
这会移除所有 Watchman 的监控项目和缓存。
一般 Watchman 是守护进程,会在后台自动启动,但你可以确保它重新加载配置:
watchman shutdown-server
这会停止 Watchman 的守护进程,下一次有监控请求时会自动启动。
在项目根目录运行:
watchman watch-project .
这会重新添加当前目录的监控,并应用新的 .watchmanconfig 配置。
watchman watch-list
确认你的项目被监控,同时 Watchman 不会再监控 ignore_dirs 中列出的目录。
💡 小提示:每次修改 .watchmanconfig 后,最好执行 watchman watch-del-all && watchman watch-project .,避免旧缓存影响。
当一台电脑需要配置两个git,一个用来提交个人代码,一个用来提交工作代码
# 生成个人 SSH Key
ssh-keygen -t rsa -C "个人邮箱@gmail.com" -f ~/.ssh/id_rsa_personal
# 生成工作 SSH Key
ssh-keygen -t rsa -C "工作邮箱gmail.com" -f ~/.ssh/id_rsa_work
编辑 ~/.ssh/config 文件:
# 个人账号
Host github.com-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_personal
# 工作账号
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_work
此略
当远程工作仓库地址为git@github.com:github账号名/hello.git
如果想克隆下来需要修改一下: git clone git@github.com-work:github账号名/hello.git
当远程个人仓库地址为git@github.com:github账号名/hello.git
如果想克隆下来需要修改一下: git clone git@github.com-personal:github账号名/hello.git
git remote add origin git@github.com-work:github账号名/hello.git
defaults write -g InitialKeyRepeat -int 15
defaults write -g KeyRepeat -int 2
先确认你是否安装了 Homebrew(Mac 常用的包管理器):
brew -v
如果没有,执行:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
安装 MySQL:
brew install mysql
启动 MySQL 服务:
brew services start mysql
(如果只想临时运行,可以用 mysql.server start)
登录 MySQL:
mysql -u root
设置 root 密码(第一次可能为空密码):
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
FLUSH PRIVILEGES;
停止 MySQL:
brew services stop mysql
安装 Redis:
brew install redis
启动 Redis 服务:
brew services start redis
(临时启动可以用:redis-server /opt/homebrew/etc/redis.conf)
测试 Redis:
redis-cli
输入:
ping
返回 PONG 表示正常运行。
停止 Redis:
brew services stop redis
查看运行的服务:
brew services list
重启 MySQL:
brew services restart mysql
重启 Redis:
brew services restart redis
这样安装后,MySQL 默认监听 3306 端口,Redis 默认监听 6379 端口,你在本机就可以直接用客户端连接了。