2025-07-17 08:00:00
就。突如其来的生活更新。因为我实在太想写点有活人气儿的内容了!
我时不时地会买上一袋玉米面,算是用作丰富食材多样性吧。不过感觉大部分家庭厨房里并不会频繁使用玉米面,简单记一下我的常用菜谱。
最经常做的玉米面方子。翻两倍烤上一大盘丢冰箱冷冻室,要吃时蒸一下,相当顶饱,是非常合格的早餐备餐。不过我会用蜂蜜替代枫糖浆(懒得特地买枫糖浆 ),糖油也减量,液体差的部分用牛奶或酸奶补足。第一次做建议跟着原方走,这个糖油量对大部分人都不算过分。
另一个常用方子,把配料中的面粉换成玉米粉即可,不过通常我会用 1/2 或 1/3 的玉米粉,这样口感不会过于粗糙。
依然是自己的方子。同样是玉米粉替换配料中的低筋粉。照我的糖油用量口感略干噎了些,毕竟玉米面不比柔润的低筋粉,我会搭配果酱、奶油奶酪或者希腊酸奶吃。
其实总体思路就是粗粮细做,既然玉米粉没有筋度,一切配料中使用无筋/低筋粉的方子都可以大胆尝试——但新手就不要挑战这种高难度动作了。我还做过的有,玉米面 pancake,窝窝头,玉米面华夫,玉米面鸡蛋蔬菜小饼等等。但这些我全凭经验手感在做,材料都不称,也就无从给出具体菜谱供参考。
另外打算尝试的一些的低糖朴实玉米面菜谱:
以及插播,虽然我们大部分人认为玉米的对应词汇是 corn,但实际这个词在欧洲大陆上指的是主要粮食作物,或泛指谷物,欧洲移民到达美洲后头次见到玉米,因为这和老家谷物的属性相同,所以用 corn 给玉米命了名,在美洲这个词也就几乎专门指玉米了。而严肃追究起来,玉米应该是……maize。所以在英国文学里看到 corn,大概率他们指的是谷物,可不能翻成玉米。而 corn 风靡全球,甚至爆米花都叫做 popcorn,不用问,必然是美国人的锅……
2025-07-13 08:00:00
存个档,主要是为了在一些网站批量下载音频文件,比如
https://sharedaudiobooks.co
、
https://findaudiobook.app/
等等。我自然也可以打开 dev tools 在 network
里找到文件链接,但一个还好,十几二十几个文件就有点烦人了,所以写了个简单的脚本来处理,而且我也才知道 Aria2 可以接受多个直链下载,真是太方便了。我爱现代科技!
这种没啥技术含量的就不在油猴插件市场上发布,而且它也不能适配那些逻辑复杂的网站。之所以记录下来是为了后续处理类似需求时可以来抄自己的作业。
This is a Tampermonkey userscript that helps you quickly extract direct media URLs (.mp3
, .mp4
, etc.) from the current web page and format them for downloading with aria2.
<audio>
, <video>
, and <source>
elementssrc
URLs (including lazy-loaded or partial sources)?_=1
) from the URLhttps://example.com/09.mp3?_=1 out=09.mp3
Add > Input > Paste
)aria2_input.txt
) for use with: aria2c -i aria2_input.txt
<audio>
, <video>
, or <source>
tags.<iframe>
, streaming manifests (.m3u8
, .mpd
), or Media Source Extensions (MSE).
// ==UserScript==
// @name Extract Media URLs for Aria2
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Extract media URLs and format for aria2
// @author AAA
// @match *://*/*
// @grant GM_setClipboard
// ==/UserScript==
(function() {
'use strict';
function cleanFilename(url) {
const base = url.split('?')[0]; // strip query
return decodeURIComponent(base.split('/').pop()); // get last segment
}
function extractMediaLinks() {
const mediaTags = [...document.querySelectorAll('audio, video, source')];
const urls = mediaTags.map(tag => tag.src || tag.currentSrc).filter(Boolean);
const uniqueUrls = [...new Set(urls)];
const aria2Lines = uniqueUrls
.map(url => `${url}\n out=${cleanFilename(url)}`)
.join('\n');
console.log('Extracted URLs:\n' + aria2Lines);
GM_setClipboard(aria2Lines);
alert(`Copied ${uniqueUrls.length} unique URL(s) in aria2 format to clipboard.`);
}
// Run it automatically or attach to shortcut
window.addEventListener('keydown', function(e) {
if (e.ctrlKey && e.key === 'q') { // Ctrl+Q
extractMediaLinks();
}
});
})();
2025-07-12 08:00:00
惭愧,放着正事儿不干,搓了个巨简陋的 NeoDB 脚本出来。
之前我一直在豆瓣上用 Douban Book+ 来查询书籍资源,很方便,但就条目的丰富性来说,豆瓣不如 NeoDB,所以我想有一个适配 NeoDB 的工具。
至于最终的实现结果不说 1:1 mock 吧怎会如此寒酸,我也是有理由的:
Anna’s Archive 搜索结果本就包含 Z Library,去掉 zlib 入口省掉我验证网址是否可用的功夫。
不返回查询结果而用 ISBN 和标题作为 query 直接跳转,因为用 Douban Book + 的经验告诉我,它说有资源,那一定有;但它说没有,可却未必。可能是抓取结果的延迟或上传资源的 ISBN 有误,不如自己手动跳转确认。
增加 Libby 查询,因为这是合法阅读渠道。不过 Libby 不支持直接检索(https://libbyapp.com/search?q=title
),甚至预填图书馆 slug (e.g. https://libbyapp.com/search/lapl
)也不行,并且它还不支持 ISBN,那我能想到的唯一曲线救国方法就是点击 Libby 后自动复制标题,在新页面打开 https://libbyapp.com/search
等待 Libby redirect 到浏览器已登录的图书馆查询页,粘贴书名,查询。我开启了鼠标手势因此只需要右键+下滑就可以实现粘贴+回车。
至于什么网易蜗牛、得到、微信读书,I DON’T CARE!
所以,就是这样了—— Neodb + Anna + Libby Quick Redirect 。本来我还想加上对 Goodreads 的支持,但转念一想 NeoDB 里添加 Goodreads 条目方便得很,费这事儿干嘛。
2025-07-09 08:00:00
Blog 地址迁移已三月有余我才拖拖拉拉地把善后工作基本做完,大致记录下。希望再也不要有第二次了。
我一直没买域名,所以本次迁移也就是从 GitHub 换到 Vercel 托管而已,只要在 Vercel 中导入 Hugo 站点源代码就可无缝上线。其他则是评论区、统计工具等零零总总的琐碎工作。
在站点结构毫无变动只有 baseurl 更改的情况下,Disqus 的评论迁移非常简单,根据官方教程 Migration Tools 走就行,简单来说就是 Disqus Admin > Tools > Migration Tools,输入新地址,一键结束。不仅评论连 reaction 都一并转移到了新页面。
我有三个统计工具,GA、Umami 和 Bing Webmasters Tools。
前两者都是在网站 head.html
加了追踪码,新站只是换了个壳,源码未变,追踪不受影响,顶多就是把 Google 和 Umami 里的站点地址改掉(不改也无所谓),但如果旧站(也就是 github.io
那个静态站)没删除这些代码,旧站访问依然会记入统计数据。在 Umami 里点击 Hosts 就可以看到分别的统计。迁移之后这几个月我几乎没发文,访客来源大部分是 organic search,新站访问量好可怜。
Bing 那边我用的 Google 账号登陆导入 Google Search Console,想要更换站点地址又不想搞更多验证,在 Google Search Console 内更新或添加新链接后重新导入一次即可。
关联阅读:
原计划是挂上变动通知几个月后把旧站下线,不过这阵子发现旧地址依然有源源不断的 organic search 流量,并且我知道有部分工具类博文被其他站点引用,我总不可能跑去每个 backlink 地址去通知别人更换 url 吧。再加上新地址墙内无法访问,本着方便他人的想法决定保留所有 Toolbox 类目下的文章。
最初是停用了 Hugo 项目里的 Hugo deploy Github Action,这样有新更新就不会触发 hugo build 命令,因而 GitHub Pages 页面也就不会更新,接着简单粗暴去 username/username.github.io
仓库下删除了多余的 html 页面。
但想要更精细化调整显然这样是不够的。后续我在 Hugo 站点 repo 里新建了一个 branch,重新启用 Github Action 但调整为仅被新 branch 变更触发。然后大刀阔斧删除 content
下文档,移除站点 nav bar,调整首页显示(只保留变更通知)等等等等。总之就是一切冗余内容都去除。
接着给所有还留存的页面都增加了一个 call-out 样式提醒。
改动的是 layouts
文件夹下 single.html
文件。
CSS:
<style>
.callout {
border-left: 4px solid #2d6cdf;
background: #eef3fb;
padding: 1rem;
margin: 1rem 0;
border-radius: 4px;
}
</style>
Call-out 部分代码:
<div class="callout notice">
<p>
本站已迁移。请访问<a href="https://thewanderingallison.vercel.app{{ .RelPermalink }}">此地址</a>以查看最新版本(如有)或发表评论。中国大陆用户无法访问新站,请仍在此页面阅读。
</p>
</div>
更理想的方式其实是搞 redirect,但在没有自有域名的前提下没办法通过设置 GitHub Pages 的 redirect 跳转,要么就自己写网页 JS,这也太折腾了,更何况我留着旧地址不就是为了方便墙内的访客看嘛,所以就这样吧!
最后,清除 Github Pages 仓库的 commit history。详细流程见 A Brand New GitHub Pages Each Time 。
2025-06-14 08:00:00
写点不太需要动脑的东西复健一下。
但我先搞了个英文版的,结果就是完全不想动手再翻回中文……算了,大概解释一下这是干嘛的,反正步骤列的很清楚了(不负责任)。
事情的起因就是,如果使用 GitHub Pages 来 host 静态站点,在没有 GitHub 会员的情况下,这个 GitHub Pages 仓库必须保持公开。那么问题就是,即使拥有自有域名 redirect 到自定义 url,原始仓库依然是公开可见的。每一次的编辑记录只要他人有心,仍然可以翻到。更别提像我原来那样,直接使用 username.github.io
,那更是明晃晃地把仓库摆给所有人看了。
这个流程就是试图最大化地减少记录曝光。处理逻辑是这样:
[Local Hugo Source] --> (Push to main) --> [Private GitHub Repo]
|
v
[GitHub Actions Workflow]
|
(Build site using Hugo) |
(Use PAT & force_orphan) v
-----------------------------------------------------
| Only /public folder is deployed as new commit |
| Entire Git history in public repo is replaced |
-----------------------------------------------------
|
v
[Public GitHub Pages Repo]
|
v
[GitHub Pages Live Website]
用一个私有仓库存放 Hugo 的源码和草稿,另一个公开仓库只放最终生成的静态页面。然后配合 GitHub Actions,每次部署都使用 force_orphan: true
重写整个提交历史,只保留最新一次的结果,这样即使其他人看到静态页面仓库,commit history 也始终只有一条。
最后,为什么我非要起这样一个英文标题,因为构思这个处理流程时,我脑子里一直在自动循环播放 Kodaline 的 Brand New Day,真的很好听呢!
This guide outlines a robust and secure deployment process for a Hugo project to a GitHub Pages repository, ensuring that the commit history is effectively “reset” with each new deployment. This method is particularly useful for keeping sensitive information out of the public repository and maintaining a clean, obfuscated history.
The setup involves two distinct GitHub repositories and an automated workflow:
github.com/username/hugo-source-repo
for example) holds all the Hugo project’s raw source code, including Markdown content, themes, and configuration. Keeping this private ensures sensitive data and work-in-progress remain confidential.github.com/username/username.github.io
for a user/organization page, or github.com/username/project-page
for a project page). Importantly, this repository will only contain the static HTML, CSS, JavaScript, and asset files generated by Hugo.main
).public
directory.public
directory.peaceiris/actions-gh-pages
action with the force_orphan: true
flag. This critical setting ensures that each new deployment creates a completely fresh, single commit that effectively replaces the entire history of the GitHub Pages branch. This prevents the accumulation of old commits and makes it difficult to trace past changes, enhancing privacy by design.This approach efficiently avoids manual history editing and reduces the risk of accidentally exposing sensitive information, as the public repository only ever receives the final, compiled static assets with a completely new history upon each deployment.
my-hugo-blog
.username.github.io
(e.g., johndoe.github.io
). GitHub will serve it from the main
branch.my-hugo-project-page
). GitHub Pages will typically serve it from the gh-pages
branch..gitignore
.Exclude public/
in .gitignore
: In the root of the private Hugo source repository, ensure the .gitignore
file includes public/
. This prevents generated static site files from being committed to the source code.
# .gitignore
/public/
/resources/_gen/
.hugo_build.lock
.DS_Store
Generate a Personal Access Token (PAT): The GitHub Actions workflow needs permission to push to the public GitHub Pages repository.
Hugo_Deploy_PAT
).repo
scope. This is essential for cross-repository pushes.Add the PAT as a Repository Secret:
my-hugo-website-source
), navigate to Settings > Secrets and variables > Actions.DEPLOY_TOKEN
.Secret
field.Create the GitHub Actions Workflow File: Inside the private Hugo source repository, create this file at .github/workflows/deploy.yml
.
name: hugo-deploy-CI
# Controls when the action will run.
on:
push:
branches:
- main # Change this to your source branch
workflow_dispatch:
jobs:
# docs:https://github.com/peaceiris/actions-gh-pages
deploy:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.81.0'
extended: true
- name: Build
run: hugo
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with: github_token: ${{ secrets.DEPLOY_TOKEN }} # Use the PAT from your repository secrets
publish_dir: ./public # The directory containing your built Hugo site
external_repository: username/username.github.io # IMPORTANT: Your PUBLIC GitHub Pages repo # For a project page, use: username/project-page
publish_branch: main # Use 'main' for User/Org Pages, 'gh-pages' for Project Pages
force_orphan: true
Key points for this workflow:
on: push: branches: - main
: Adjust main
to the branch where Hugo source code changes are pushed.github_token: ${{ secrets.DEPLOY_TOKEN }}
: This securely uses the Personal Access Token.external_repository: username/username.github.io
: Crucially, this must be the exact name of the public GitHub Pages repository.publish_branch: main
: Ensure this matches the branch configured for GitHub Pages (usually main
for user/org pages, gh-pages
for project pages).force_orphan: true
: This is the setting that replaces the entire branch history with a single new commit on each deployment.Deploy from a branch
for “Source”.main
and / (root)
for User/Organization Pages.gh-pages
and / (root)
for Project Pages.With these steps, every time changes are pushed to the designated deployment branch in the private source repository, GitHub Actions will automatically rebuild the Hugo site and deploy a fresh, clean version with a brand new history to the public GitHub Pages repository.
2025-04-04 08:00:00
随便写写。感觉我失去热情了……
哄睡一只小兔子要多久?
内容简单但细节多多,尤其是无处不在的时钟,仔细看指针就会发现,从这只 bunny 躺到床上到真的可以 “goodnight”,花了这么这么久呢。
骂人不好,但真的很想引用豆瓣这个短评:
故事通过极端的夸张与形式化,强调了“请”及附着其上的礼貌的重要性,配上 Briggs 夺人眼目、生动盎然的插画,做到了真正的寓教于乐。那些指责这书三观问题的,大概都是政治正确、一点幽默感也没有的傻逼。
至于豆瓣网友在说谁,点进上面的书籍链接就知。说实话看到所谓的“房间里的大象”的分析我也忍不住翻了个白眼。
两星。
介绍日本的各种妖怪,对这种书我要求已经很低了,但全是网络内容汇编,海量百度百科原句原段摘抄,谁给你们的勇气出成书?
Cozy and warm~
讲述森林里的小女巫的一年四季,首尾情节呼应,非常暖心。
以及下面这个画面真的不是在致敬拇指姑娘吗!
写了笔记。
绘本。正如标题,they all saw a cat! 那都是谁瞧见了呢?各种生灵。这个创作角度很有趣。
好多年前看过电影,剧情一般但我很喜欢设定:一个地下的微光城市。最近又想起来就找了 audiobook 听。书本身也就是及格分的 YA,情节很多地方过度简化稍微想想就觉得不对,但作者文笔不错,各个角色性格鲜明,而且有声书朗读者表现力十足,声线切换也十分自然,所以忽略设定上的 bug 听起来还是很愉快的。
听完之后去豆瓣翻了下发现我是 09 年看的电影,这片里居然还有罗南,配角阵容也很强大。不过似乎当年扑街得不行。书是系列小说,但电影续集再没有过消息。
副标题是 Not Just for Flying。那羽毛都有哪些功能?绘本里选择了各种鸟类不同部位的羽毛来表现。画面漂亮,文字准确,和之前我读过的另外两本 Feathers(分别见 2024十一月读书记录、2023读书简报)倒是正好可以互相映证。