跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 半年前,我发布了我的第一个开源工具

发表于

我个人有个习惯: 总是把每天要做的事情先写一遍. 否则容易忘记. 我称之为工作日志

刚开始我是用有道云笔记, 工作几年下来文件都几万行. 打开的速度越来越慢, 页面越来越卡.

而且还不能上传文件. 虽然可以贴图进去, 但这样会让页面更卡 后来,我开始尝试用 vscode 写日志. 发现这才是最好用的笔记软件

所以我的笔记方案为: github + vscode

这样做的好处是:

  1. 笔记可以连续存很多年, 不会超过 10M
  2. 可以当做小型网盘来用
  3. 云端存储, 到家后 git pull 一下就可以同步

就这样过了几年后我还是发现有些不方便, 这个同步的动作是有点多余的, 能否实现自动同步呢? 其实也很简单, 用定时器 自动 git pull, 然后在 提交一下就完了呗

# 定时执行
git pull
git add .
git commit -m "update"
git push

所以我实现了一个简单 nodejs 程序, 名字叫 codesave (码记) 本质上就是一个定时器, 用法非常简单

https://www.npmjs.com/package/codesave?activeTab=readme

  1. 全局安装 npm i -g codesave
  2. 进入你的 笔记目录(必须是 git 仓库)
  3. 输入 codesave 命令

看到 这个输出, 就说明成功了

  ---------------------
  欢迎使用 [码记]
  作者: 程序员小石
  微信: CoderXiaoShi
  ---------------------

  1. 开始自动同步 [已开启]
  2. 立刻同步代码
  3. 打开 vsCode
  4. [已开启] 默认同步
  5. 当前目录
  6. 帮助
  7. 退出
  请输入指令序号, 按下回车键结束:

  ---------------------
  请继续输入:

码记还有其他的功能

  1. 记录笔记目录: 只要在你电脑上输入过 codesave 的目录, 都会被记录下来. 以后无需再进入笔记目录, 在任意目录 只要是输入 codesave 都可以立刻开始同步
  2. 输入 3 就可以立刻打开 vscode 编辑笔记

这个工具我用了半年下来, 还是很方便的. 极大的解决了我的自动同步问题

如果喜欢的话, 麻烦给个 star https://github.com/CoderXiaoShi/codesave

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.