2021 hexo butterfly 上手记录
依赖12git --versionnode --version
一键启动1npm install hexo && npx hexo init blog && cd blog && npm un hexo-theme-landscape && npm i hexo-theme-butterfly hexo-renderer-pug && sed 's/landscape/butterfly/g' _config.yml > _config.yml.tmp && mv _config.yml.tmp _config.yml && curl -o _config.butterfly.yml https://cdn.jsdelivr.net/gh/jerryc127/hexo-theme-butterfly/_config.yml && npx hexo clean && npx hexo server
http://lo ...
谷歌网页性能测试
在线https://developers.google.cn/speed/pagespeed/insights/
https://www.googlespeed.cn/
本地Chrome浏览器winF12打开lighthouse,点击Generate report。
macOSoption + command + i 打开lighthouse,点击Generate report。
参考https://developers.google.com/speed/pagespeed/insights/
Visual Studio Code 终端分屏独立操作
Shift + control + ` 新建终端
command + \ 分屏
Hexo 实现随机文章跳转
代码没有请创建blog/scripts/random.js
1234567891011hexo.extend.generator.register('random', function (locals) { const config = hexo.config.random || {} const posts = [] for (const post of locals.posts.data) { if (post.random !== false) posts.push(post.path) } return { path: config.path || 'random/index.html', data: `<html><head><script>var posts=${JSON.stringify(posts)};window.open('/'+posts[Math.flo ...
浅谈依赖,轻装上阵
什么是依赖依赖是一个泛说法,字面理解是有关系。
具体表现在家里,我们的关系是父亲母亲;在生活中,各种各样的欲望,都跟你有关系,想要的越多,你的压力就越大。
删繁就简 不管在任何年龄阶段,都有两个极端事情,重要的和不重要的事情。我挑重要的事情作为我的依赖,我的压力,而那些不重要的事情,可以暂时放一放。这个博客,我写给自己看的,那些教程,基本上都是自己看得懂,如果读者没有留言,我一般不会去为了零基础的读者多写几句,只有闲暇之余,才会来打理下博客。现实会给我的依赖做加法,而生活中得适当给自己的依赖做减法。
轻装上阵不重要的事情,放一边,等时间也不那么重要的时候,去做不那么重要的事情,“门当户对”嘛。
参考https://baike.baidu.com/item/%E4%BE%9D%E8%B5%96/7458405
最优雅的安装 nodejs
win下载node-v14.15.1-x64.msi.zip
安装一直下一步
macOS下载node-v14.15.4.pkg.zip
安装一直下一步
参考https://nodejs.org/en/download/
https://nodejs.org/en/
https://nodejs.org/en/download/package-manager/#macos
最优雅的安装 Git
win
下载最新版Git-2.30.0-64-bit.exe
历史版本Git-2.30.0-32-bit.exe
Git-2.28.0-64-bit.exe
安装一直下一步
参考https://git-scm.com/download/win
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
hexo 最优雅的换电脑写博客
备份hexo源码进入blog运行下面代码
1rm -rf Thumbs.db node_modules/ db.json public/ .deploy package-lock.json
备份blog
新电脑依赖12git --versionnode --version
安装hexo依赖进入之前拷贝的源码blog
1npm i
预览1npx hexo clean && npx hexo server #清理和启动主题
http://localhost:4000/
参考https://hexo.io/
https://docs.npmjs.com/
最有效的时间管理
时间管理宝贵时间,先在脑子里使用重要紧急工作法初判,再使用GTD有条不紊的记下。
四象限:重要紧急工作法横轴重要程度,纵轴紧急程度
紧急但不重要
紧急且重要
拿快递
学习
不紧急且不重要
不紧急但重要
看电视
吃饭
GTD:好记性不如烂笔头macOS的App Store 下载Todoist,支持看板和清单,时间线任务一目了然。
参考https://linkle.tech/archives/swbook1
彻底解决 GitHub git clone 卡慢
对比
方式
位置
只代理GitHub代码
git clone gh效果
ssh
~/.ssh/config配置
Host github.comHostName github.comUser gitProxyCommand nc -v -x 127.0.0.1:7890 %h %p
飞快
https
终端输入
git config --global http.https://github.com.proxy socks5://127.0.0.1:7890
飞快
使用理由12git clone --depth=1 git@github.com:jerryc127/hexo-theme-butterfly.gitgit clone --depth=1 https://github.com/jerryc127/hexo-theme-butterfly.git
浅拷贝git clone --depth=1 ref速度确实快,但是版本回退是问题,在 GitHub 上 Pull requests非常不方便,而ssh全拷贝会方便进行git的操作,可是全拷贝速度奇慢,只能通过代理下载, ...