diff options
| author | eltrac <hi@eltr.ac> | 2026-02-15 11:49:59 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-02-15 11:49:59 +0800 |
| commit | a7d632331058b76b3e704deb642008420da125cc (patch) | |
| tree | 57e03401228b57d02d7cf585371c17d57aa3e57d /content | |
| parent | 7e9c48ae0d30727e5f9a6808ede6315847b09851 (diff) | |
docs: restructure categories
Diffstat (limited to 'content')
| -rw-r--r-- | content/categories/game++/_index.md | 6 | ||||
| -rw-r--r-- | content/categories/代码炼金术/_index.md | 4 | ||||
| -rw-r--r-- | content/categories/艺术脑袋/_index.md | 4 | ||||
| -rw-r--r-- | content/categories/雨天集/_index.md | 4 | ||||
| -rw-r--r-- | content/essays/go-philosophy.md | 24 | ||||
| -rw-r--r-- | content/essays/libra-js-开发日志.md | 4 | ||||
| -rw-r--r-- | content/essays/如何优雅地部署一个静态网站.md | 1 | ||||
| -rw-r--r-- | content/essays/零JavaScript的博客统计图表.md | 2 | ||||
| -rw-r--r-- | content/posts/IN-LIBRIS-LIBERTAS.md | 1 | ||||
| -rw-r--r-- | content/posts/webpage-as-lists.md | 2 | ||||
| -rw-r--r-- | content/posts/为什么不玩扑克呢.md | 4 | ||||
| -rw-r--r-- | content/posts/为战斗献上心脏.md | 2 | ||||
| -rw-r--r-- | content/posts/今夜不爱就死.md | 1 | ||||
| -rw-r--r-- | content/posts/健康的灵魂是世上最无趣之物.md | 3 | ||||
| -rw-r--r-- | content/posts/大概是下雨的关系.md | 2 | ||||
| -rw-r--r-- | content/posts/我的 RSS 解决方案.md | 3 | ||||
| -rw-r--r-- | content/posts/撞到人要说对不起.md | 1 | ||||
| -rw-r--r-- | content/posts/有才华的同人作品是怎样的.md | 1 | ||||
| -rw-r--r-- | content/posts/死亡浪漫主义-II.md | 9 | ||||
| -rw-r--r-- | content/posts/这个世界会累死完美主义者吗.md | 1 | ||||
| -rw-r--r-- | content/posts/逃离独居生活.md | 3 | ||||
| -rw-r--r-- | content/posts/逃离群居生活.md | 1 |
22 files changed, 43 insertions, 40 deletions
diff --git a/content/categories/game++/_index.md b/content/categories/game++/_index.md deleted file mode 100644 index 428b6f84..00000000 --- a/content/categories/game++/_index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Game++ -description: 写游戏开发日志的地方。 -aliases: - - "Game++" ---- diff --git a/content/categories/代码炼金术/_index.md b/content/categories/代码炼金术/_index.md new file mode 100644 index 00000000..6cac9913 --- /dev/null +++ b/content/categories/代码炼金术/_index.md @@ -0,0 +1,4 @@ ++++ +title = "代码炼金术" +description = "_Who are we to fight the Alchemy?_" ++++ diff --git a/content/categories/艺术脑袋/_index.md b/content/categories/艺术脑袋/_index.md deleted file mode 100644 index c79a890c..00000000 --- a/content/categories/艺术脑袋/_index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: 艺术脑袋 -description: 有时我的大脑会以为它很懂艺术。 ---- diff --git a/content/categories/雨天集/_index.md b/content/categories/雨天集/_index.md new file mode 100644 index 00000000..ffe0bfc1 --- /dev/null +++ b/content/categories/雨天集/_index.md @@ -0,0 +1,4 @@ ++++ +title = "雨天集" +description = "_真希望雨能下不停。_" ++++ diff --git a/content/essays/go-philosophy.md b/content/essays/go-philosophy.md index 5481655d..2284f090 100644 --- a/content/essays/go-philosophy.md +++ b/content/essays/go-philosophy.md @@ -9,7 +9,7 @@ draft: false toc: true aliases: - /posts/go-philosophy -categories: Coding +categories: 代码炼金术 --- @@ -267,7 +267,7 @@ func Process(data string, logger Logger) { 短小的接口看起来没用,但接口完全可以像搭积木一样把方法堆叠起来,比如下面这个类型就既是 `Writer` 又是 `Closer` 还是 `Logger`。 ```go -type FileWriter struct { +type FileWriter struct { f *os.File } @@ -282,7 +282,7 @@ func (*fw FileWriter) Log() { ... } ```java // 在 Java 中实现接口 -class FileWriter implements Writer { +class FileWriter implements Writer { public void write() { ... } } ``` @@ -350,7 +350,7 @@ func (c *Config) Path() string { `interface{}` 常常被用来接收不确定类型的值,很多时候这种操作是必要的,但 Rob Pike 指出,很多人滥用了空接口类型,他说: > You might as well write in Python. -> +> > 你还不如去写 Python 呢。[^2] 将代码保持在 Go 严格的类型系统中,有助于保持程序的安全性。除此之外,空接口最大的问题是「不够清晰」——清晰的代码可读性是 Go 语言的核心之一。使用空接口类型让函数的输入和行为都变得不可预测,代码更难阅读,而且更难发现 Bug。 @@ -471,10 +471,10 @@ console.log(OK ? "It's okay" : "It's not okay") 这看起来还挺清晰的,但 Go 的设计者发现有不少人会用三目表达式来编写令人费解的控制结构。 ```js -const someString = isAnimal +const someString = isAnimal ? (isElephant ? "I'm an elephant" : "I'm just a dumb animal") - : (CheckIfItIsAPlant() - ? "I can't speak. I'm a plant" + : (CheckIfItIsAPlant() + ? "I can't speak. I'm a plant" : "Fuck, I'm not even a plant?") ``` @@ -538,19 +538,19 @@ func doSomeReflection(i interface{}) { // 获取 i 的类型 // 一个定义在 main 包里、名为 User 的结构体会返回 main.User t := reflect.TypeOf(i) - + // 获取 i 的底层类型 // 同样一个名为 User 的结构体,会返回 struct k := reflect.KindOf(i) - + // 获取 i 的值 v := reflect.ValueOf(i) // 如果要获取值的类型,就可以这样写 vk := reflect.ValueOf(i).Kind() - + // 如果 i 是一个结构体,可以用这个方法获取它的字段数量 nf := reflect.NumField(i) - + // Field() 方法用于获取字段,配合上面的方法可以遍历结构体 for n := 0; n < numberOfFields; n++ { // 这里会输出该字段的类型和值 @@ -671,7 +671,7 @@ func safelyDo(work *Work) { 这句话直接翻译过来是:文档是给用户的。 > A lot of time when people write documentation, they say "this is what the function does", and they don't think about "what the function is for". -> +> > 很多时候人们写文档,会写「这个函数会做这个事情」,而他们不会想「这个函数是拿来干嘛的」。 这条也更像是工程智慧,而非语言的基础知识。在我的理解力,「这个函数是拿来干嘛的」其实是提供了相关的上下文,即「为什么一开始要设计这个函数」「为什么用户会用到这个函数」。在上一小节的例子中,`safelyDo()` 函数封装了 `do()` 函数,用于恢复可能出现的 `panic`,如果只考虑「做什么」,文档就应该是这样: diff --git a/content/essays/libra-js-开发日志.md b/content/essays/libra-js-开发日志.md index 5209b800..7e63231d 100644 --- a/content/essays/libra-js-开发日志.md +++ b/content/essays/libra-js-开发日志.md @@ -7,7 +7,7 @@ draft: false toc: true aliases: - /posts/libra-js-开发日志 -categories: Coding +categories: 代码炼金术 --- 博客从去年十二月开始就一直在用 [Fancybox](https://fancyapps.com/fancybox/) 作为博客的图片灯箱插件,之前还在用 Typecho 搭建博客的时候就在用这个库。所谓灯箱,其实就是点击图片之后将图片放大并居中显示,就像现实世界中的广告灯牌一样。不过我其实一直很想要把 Fancybox 换掉,因为它太臃肿了,包含了很多我不需要的功能(比如 1:1 放大、镜像翻转、前后切换等等),体积接近 100 KB;不仅如此,Fancybox 实际上是一个商业库,并不是免费开源的。出于这些原因,我决定自己从零开始做一个灯箱插件。<!--more--> @@ -184,7 +184,7 @@ animate(startingState, finalState) { [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame) 是这样描述这个方法的: > The frequency of calls to the callback function will generally match the display refresh rate. The most common refresh rate is 60hz, (60 cycles/frames per second), though 75hz, 120hz, and 144hz are also widely used. -> +> > 调用回调函数的频率一般会和显示器的刷新率匹配。最常见的刷新率是 60 赫兹(每秒 60 个循环/帧),不过 75 赫兹、120 赫兹和 144 赫兹也被广泛使用。 我不确定描述是否属实,因为测试时动画偶尔会掉帧,往往是在第一次执行动画时,这有可能是浏览器或者操作系统为了平衡性能和管理系统资源导致的偶发性问题吧,不过我只是在画 2D 图像啊…… 如果图片要移动的距离比较长,也容易出现卡顿或者闪现,这是因为动画的帧数是写死的,太长的话,每帧之间的差异也就会大一些。总之,使用 `requestAnimationFrame` 的方法不太美妙。 diff --git a/content/essays/如何优雅地部署一个静态网站.md b/content/essays/如何优雅地部署一个静态网站.md index 7920f79e..740081fc 100644 --- a/content/essays/如何优雅地部署一个静态网站.md +++ b/content/essays/如何优雅地部署一个静态网站.md @@ -2,6 +2,7 @@ title = '如何优雅地部署一个静态网站?' tags = ['DevOps', 'Geek', 'Web'] slug = 'deploying-static-sites' +categories = '代码炼金术' date = 2026-01-28 18:07:29 draft = false toc = true diff --git a/content/essays/零JavaScript的博客统计图表.md b/content/essays/零JavaScript的博客统计图表.md index d985b880..9b6f0ba1 100644 --- a/content/essays/零JavaScript的博客统计图表.md +++ b/content/essays/零JavaScript的博客统计图表.md @@ -9,7 +9,7 @@ toc: true slug: zero-js-chart aliases: - /posts/zero-js-chart -categories: Coding +categories: 代码炼金术 --- diff --git a/content/posts/IN-LIBRIS-LIBERTAS.md b/content/posts/IN-LIBRIS-LIBERTAS.md index 9eb69613..ce7a3152 100644 --- a/content/posts/IN-LIBRIS-LIBERTAS.md +++ b/content/posts/IN-LIBRIS-LIBERTAS.md @@ -6,6 +6,7 @@ draft: false tags: - 阅读 toc: true +categories: 年终总结 aliases: - /posts/in-libris-libertas --- diff --git a/content/posts/webpage-as-lists.md b/content/posts/webpage-as-lists.md index 02f7869d..0e068e66 100644 --- a/content/posts/webpage-as-lists.md +++ b/content/posts/webpage-as-lists.md @@ -3,7 +3,7 @@ title = '网页即列表!' subtitle = '用 Clojure 构建静态网站' slug = 'webpage-as-lists' tags = ['编程','Web','Lisp'] -categories = 'Coding' +categories = '代码炼金术' date = 2026-02-13 22:30:17 draft = false toc = true diff --git a/content/posts/为什么不玩扑克呢.md b/content/posts/为什么不玩扑克呢.md index 0f4eec44..0189d571 100644 --- a/content/posts/为什么不玩扑克呢.md +++ b/content/posts/为什么不玩扑克呢.md @@ -1,7 +1,7 @@ --- title: 为什么不玩扑克呢? subtitle: 游戏《Expoker》设计日志 -categories: Game++ +categories: 代码炼金术 tags: - 游戏 date: 2025-02-12 09:06:30 @@ -200,4 +200,4 @@ Joker 牌只有两张,是一种稀缺资源。前面提到配置稀缺资源çš [^1]: [Ace - quword](https://www.quword.com/ciyuan/s/ace) -[^2]: *啊?你问《Warstro》怎么办?呃…… 改天再说吧*
\ No newline at end of file +[^2]: *啊?你问《Warstro》怎么办?呃…… 改天再说吧* diff --git a/content/posts/为战斗献上心脏.md b/content/posts/为战斗献上心脏.md index 33ff1f4f..148217f7 100644 --- a/content/posts/为战斗献上心脏.md +++ b/content/posts/为战斗献上心脏.md @@ -1,7 +1,7 @@ --- title: 为战斗献上心脏! subtitle: 游戏《Heart Hunter》开发日志 -categories: Game++ +categories: 代码炼金术 tags: - 游戏 date: 2025-03-18 10:08:06 diff --git a/content/posts/今夜不爱就死.md b/content/posts/今夜不爱就死.md index 5e09a557..523f3021 100644 --- a/content/posts/今夜不爱就死.md +++ b/content/posts/今夜不爱就死.md @@ -1,7 +1,6 @@ --- title: 今夜不爱就死 subtitle: 赏析 Lady Gaga 新单曲《Abracadabra》 -categories: 艺术脑袋 tags: - 音乐 - 文化 diff --git a/content/posts/健康的灵魂是世上最无趣之物.md b/content/posts/健康的灵魂是世上最无趣之物.md index 48f3ce41..ea5d969c 100644 --- a/content/posts/健康的灵魂是世上最无趣之物.md +++ b/content/posts/健康的灵魂是世上最无趣之物.md @@ -1,7 +1,6 @@ --- title: 健康的灵魂是世上最无趣之物 subtitle: 观《魂断威尼斯》有感 -categories: 艺术脑袋 tags: - 性少数 - 健康 @@ -43,7 +42,7 @@ aliases: 身体的衰退很显然是衰老带来的影响,在回忆片段中,阿弗雷德也直言不讳地指出古斯塔夫年事已高,而老年让他变得不再纯洁。 > There's no impurity so impure as old age. -> +> > 世上没有不洁比得上老年。 身体上的衰退还有两种体现。首先,是古斯塔夫来到威尼斯的原因——修养身心。朋友阿弗雷德为古斯塔夫请来医生之后,医生发现他的心脏并不健康,认为他需要好好休息,所以,古斯塔夫就去到了威尼斯的一家酒店度假。其次是故事中发生在威尼斯的疫情,这里电影还映射了一些社会现实,由于威尼斯是一个极度依赖旅游业的城市,传染病的消息一旦传到游客耳中,必定会影响当地经济,所以,电影里几乎所有人都在欺骗古斯塔夫,最后古斯塔夫应该是死于霍乱,不过究竟是不是病死的,电影没有指明(但根据酒店里某个工作人员告诉古斯塔夫的内容,最开始得霍乱死的人,有一个黑瘦的船夫和一个卖水果的商贩,而古斯塔夫在一开始就是乘船来的,船夫的形象与描述吻合,在海滩上时,他也吃过其他游客都谨慎不愿意买的草莓)。所以,身体患上传染病大概也是一种衰退。 diff --git a/content/posts/大概是下雨的关系.md b/content/posts/大概是下雨的关系.md index 191c2f99..0567a103 100644 --- a/content/posts/大概是下雨的关系.md +++ b/content/posts/大概是下雨的关系.md @@ -6,7 +6,7 @@ tags: date: 2025-10-23 23:07:10 draft: false toc: false -categories: 乱章 +categories: 雨天集 aliases: - /posts/大概是下雨的关系 --- diff --git a/content/posts/我的 RSS 解决方案.md b/content/posts/我的 RSS 解决方案.md index 91855aa6..2fc364f3 100644 --- a/content/posts/我的 RSS 解决方案.md +++ b/content/posts/我的 RSS 解决方案.md @@ -1,11 +1,12 @@ --- date: 2024-11-07 -description: 小小 RSS,竟然这么棘手? +subtitle: 小小 RSS,竟然这么棘手? draft: false title: 2024 年,我的 RSS 解决方案 toc: true tags: - Geek +categories: 生产力报告 aliases: - /posts/我的-rss-解决方案 --- diff --git a/content/posts/撞到人要说对不起.md b/content/posts/撞到人要说对不起.md index ae8d476a..be16c2cc 100644 --- a/content/posts/撞到人要说对不起.md +++ b/content/posts/撞到人要说对不起.md @@ -8,6 +8,7 @@ date: 2025-12-25T01:39:00 draft: false toc: false slug: love-lost-in-xmas-eve +categories: 乱章 aliases: - /posts/撞到人要说对不起/ --- diff --git a/content/posts/有才华的同人作品是怎样的.md b/content/posts/有才华的同人作品是怎样的.md index 43f7513d..eb3154ef 100644 --- a/content/posts/有才华的同人作品是怎样的.md +++ b/content/posts/有才华的同人作品是怎样的.md @@ -3,7 +3,6 @@ title: 有才华的同人作品是怎样的? subtitle: 《魔法坏女巫》教你写同人 description: 去年年底一个人去电影院看了《魔法坏女巫》,主要是为了 Ariana Grande 去的,看了之后才惊喜地放下这部电影居然是《绿野仙踪》的同人作品,更惊喜地是,这部电影实际上是同名百老汇音乐剧改编,早在 2003 年就首映了。 -categories: 艺术脑袋 tags: - 写作 - 创作 diff --git a/content/posts/死亡浪漫主义-II.md b/content/posts/死亡浪漫主义-II.md index fafd07ed..a29999f8 100644 --- a/content/posts/死亡浪漫主义-II.md +++ b/content/posts/死亡浪漫主义-II.md @@ -5,6 +5,7 @@ tags: - 自杀 - 写作 date: 2025-08-19 11:29:00 +categories: 乱章 draft: false aliases: - /posts/死亡浪漫主义-ii @@ -42,13 +43,13 @@ aliases: 讨论自杀的时候,我们不该只关注自杀的手法和细节,这点与破解谋杀案恰恰相反。自杀这一行为最值得关注的是动机,即个体在什么时候想死,那种想法是怎么来的,又是如何消失的,那种想法在脑中浮现时是何种质感?一个人想要终结自己的生命,就证明他觉得人生不值得活了,那么对自杀者来说,什么样的人生是值得活的,现在的人生与那样的人生又有何种区别?自杀想法在脑中涌现时,个体的认知和思维会被缩得很小,看不到过去和未来,也无法对自己的人生和值得过的人生有个准确的判断,但当下的那种「无意义感」一定足够强烈,强烈到终结生命也无所谓。==我喜欢有关死亡的故事,因为一个人如何死去,就反映了他曾经怎样活过。== > 雨下得不大,然而不撑伞也不是什么明智之举。 -> +> > 但是,我没有撑伞。 -> +> > “会着凉的。” -> +> > 古寺站在伞下这样忠告我。 -> +> > “就算死了也无所谓。” {{< right "——乙一《[未来预报](/library/2025/寂寞的频率/#i--未来预报)》" >}} diff --git a/content/posts/这个世界会累死完美主义者吗.md b/content/posts/这个世界会累死完美主义者吗.md index dc0d1e90..e933cf4e 100644 --- a/content/posts/这个世界会累死完美主义者吗.md +++ b/content/posts/这个世界会累死完美主义者吗.md @@ -6,6 +6,7 @@ tags: date: 2025-12-18T00:14:00 draft: false slug: exhausted-perfectionist +categories: 乱章 aliases: - /exhausted-perfectionist --- diff --git a/content/posts/逃离独居生活.md b/content/posts/逃离独居生活.md index c12c3b8f..edf9e567 100644 --- a/content/posts/逃离独居生活.md +++ b/content/posts/逃离独居生活.md @@ -5,6 +5,7 @@ tags: - 生活 - 人际交往 date: 2025-09-11 17:44:00 +categories: 乱章 draft: false toc: true aliases: @@ -82,7 +83,7 @@ O 带着失望而我带着~~心理创伤~~离开之后,我们就跟着中介åŽ 周四让 O 问了问那边的客服,表示可以今天再联系,O 还把我的微信号发给了对方,之后他就出门了。后来很快收到了一条短信,是中国移动发过来的,提醒我有一条新来电,但是我没有接到这个电话,未接来电也没有显示,而且来电号码显然是个人号,不清楚是不是被当作骚扰电话屏蔽了。作为一个有电话恐惧症的人,我又被狠狠地创伤了…… 我不理解为什么这样的业务不能通过短信或者微信联系确认,等待一个不知道什么时候会打过来的电话,错过了还得回拨,这真的很可怕! -下午接到了顺丰快递员的电话,问我方不方便送货上门,之后很快就收到了之前买的千兆路由器…… +下午接到了顺丰快递员的电话,问我方不方便送货上门,之后很快就收到了之前买的千兆路由器……  diff --git a/content/posts/逃离群居生活.md b/content/posts/逃离群居生活.md index 96518a19..d1378d1a 100644 --- a/content/posts/逃离群居生活.md +++ b/content/posts/逃离群居生活.md @@ -5,6 +5,7 @@ tags: - 人际交往 - 大学时代 - 生活 +categories: 乱章 date: 2025-05-29 15:07:00 draft: false toc: true |
