Skip to content

The Quibbler (Development Diary) #1

@EluvK

Description

@EluvK

12.22

By "refactor", I mean deleting 3k lines of code and rewriting another 3k lines of code. (Most of it was generated by codegen tools, which themselves are behind another 3k lines of code.)

12.24

Common scenario in software development:
Avoid developing a feature in isolation, as you cannot predict how the context may change in the future. It can be quite painful to revisit and understand what you have done months ago.

12.29

When finding it difficult to start work that requires a long context switch, try this solution: Tell yourself to do only a tiny part of it, like 5 minutes of work. This can help overcome the initial resistance and make it easier to get started.

01.07

Took some time with these prompt engineers' new toy: 'Skills'. It looks like a better MCP. I'm still not a fan of encoding what I should do and transferring the responsibility to LLMs.

01.23

Found a regex matching issue in some markdown rendering. Links endings with parenthesis are not correctly recognized. For example, the link https://example.com/path_(with_parentheses) is not fully matched. Need to adjust the regex pattern to account for such cases.

For future reference to debug my blog rendering issues, this might help.
https://github.com/streetwriters/notesnook/pull/3996/files

workaround for now: use url encoded links, e.g. https://example.com/path_%28with_parentheses%29

02.26

Drowning in some kind of situation that I can't use git commit && git push. Workaround is to beg AI to write an AHK script to save my ctrl+c and ctrl+v keystrokes.
Resulting script:

  1. first run this in terminal to copy the list of staged files to clipboard:
git diff --name-only --cached | clip
  1. Press Ctrl + F8 to run this:
Details
#Requires AutoHotkey v2.0

; --- 坐标配置区 ---
; 请使用 AHK 附带的 Window Spy 查看 "Screen" 坐标 (即全屏绝对坐标)
LocalX := 1000   ; 本地 VS Code 的点击位置
LocalY := 300
WebX := 3500    ; 浏览器 github.dev 的点击位置
WebY := 300
; ------------------

^F8:: {
    ; 1. 读取剪贴板内容 (假设你已经执行了 git diff ... | clip)
    PathList := A_Clipboard
    if (PathList == "") {
        MsgBox("剪贴板是空的!请先在终端执行 git diff --name-only --cached | clip")
        return
    }

    ; 2. 解析文件列表
    FileList := []
    FileListStr := "`n"
    Loop Parse, PathList, "`n", "`r" {
        if (Trim(A_LoopField) != "") {
            FileList.Push(Trim(A_LoopField))
            FileListStr .= Trim(A_LoopField) "`n"
        }
    }

    Total := FileList.Length
    Result := MsgBox("检测到 " Total " 个待同步文件。" FileListStr "`n坐标设定:`n本地(" LocalX "," LocalY ")`n网页(" WebX "," WebY ")`n`n准备开始同步?", "确认", 4)
    if (Result == "No")
        return

    ; 3. 循环搬运
    CoordMode("Mouse", "Screen") ; 确保点击是基于全屏坐标

    for index, filePath in FileList {
        ToolTip("正在搬运 (" index "/" Total "): " filePath)

        ; --- 步骤 A:去左边取内容 ---
        Click(LocalX, LocalY)
        Sleep(300)
        Send("^p")
        Sleep(400)
        SendText(filePath)
        Sleep(500)
        Send("{Enter}")
        Sleep(1000) ; 本地文件打开缓冲

        Send("^a")
        Sleep(200)
        Send("^c")
        Sleep(400)

        ; --- 步骤 B:去右边贴内容 ---
        Click(WebX, WebY)
        Sleep(300)
        Send("^p")
        Sleep(500)
        SendText(filePath)
        Sleep(600)
        Send("{Enter}")
        Sleep(3000) ; 网页加载文件通常比较慢,这里给足时间

        Send("^a")
        Send("{Delete}")
        Sleep(300)
        Send("^v")
        Sleep(800)
        Send("^s")
        Sleep(500)
    }

    ToolTip()
    MsgBox("同步完成!共处理 " Total " 个文件。")
}

;; Ctrl + Shift + F8 紧急停止
^+F8:: {
    ToolTip()
    MsgBox("脚本已停止")
    ; ExitApp()
}

Hilarious but it works! With the price of cannot use mouse/keyboard during the process.

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions