咸糖 - 自律者自由 https://vim0.com/ Recent content on 咸糖 - 自律者自由 Hugo -- gohugo.io zh-cn Sun, 28 Dec 2025 15:31:25 +0800 2025 年终总结:降噪、重构与长期主义 https://vim0.com/post/2025_recap/ Sun, 28 Dec 2025 15:31:25 +0800 https://vim0.com/post/2025_recap/ 2025 年终总结:降噪、重构与长期主义 过了圣诞,接着就是元旦。刚才试着口述梳理思路,录到一半被猫打断,喂完罐头回来继续写。 站在 2025 的尾巴上,回看这一 在新加坡和新山吃过最好的食物(持续更新) https://vim0.com/post/best-food-in-sg-and-jb/ Sat, 01 Nov 2025 10:00:00 +0800 https://vim0.com/post/best-food-in-sg-and-jb/ 个人在新加坡和新山吃过最好的食物(持续更新) 因为我对象特别喜欢吃,并且我作为一个程序员虽然对吃没有太在行,但是我对于找餐厅做 research 是非常专业的。 写给还在迷茫的你:我的三本大学回忆 https://vim0.com/post/university/ Sat, 05 Jul 2025 01:08:16 +0800 https://vim0.com/post/university/ 开头 前几天在网上看到一个快毕业的哥们儿抱怨,说大学没意义。这说法我觉得太片面了。以及还有就是我的高中同学总是认为学了计算机就能找到高薪工作, 2024 年终总结 https://vim0.com/post/2024_recap/ Sun, 01 Dec 2024 15:31:25 +0800 https://vim0.com/post/2024_recap/ 今天是 2024 即将收尾的最后一个月,我看到很多平台都有在发年度的 recap,像 reddit 啥的,我也想写一篇年度总结,记录一下这一年发生的事情。 2024 年终总结 一 Neovim: No Crash Incremental Selection https://vim0.com/post/neovim_no_crash_incremental_selection/ Thu, 11 Jul 2024 23:16:09 +0800 https://vim0.com/post/neovim_no_crash_incremental_selection/ When I use neovim treesitter incremental selection, it randomly crashes, but I cannot stable reproduce it. And I found some issues and complaints about this issue, but no solution. So I decide to write a blog post to record this issue and the solution. related issues: https://www.reddit.com/r/neovim/comments/10wwkft/comment/j7qla2q/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button https://github.com/neovim/neovim/issues/24336 https://github.com/neovim/neovim/issues/25254 https://www.reddit.com/r/neovim/comments/18dn4qt/treesitter_incremental_selection/ TL;DR paste this https://github.com/xiantang/nvim-conf/blob/7c0d6cbf6d9fd7b6a8960de887db1109332419bf/lua/plugins/treesitter.lua#L62-L132 into your neovim configuration file. this is my treesitter incremental selection configuration: 1 2 3 4 5 6 7 8 9 incremental_selection = { enable = true, keymaps = { init_selection = true, node_incremental = "v", node_decremental = "<BS>", }, }, sometime when I use v to expand the selection, it crashes, and it’s a Segmentation fault, and I have the report: 2022 年终总结 https://vim0.com/post/2022/ Sun, 01 Jan 2023 16:30:40 +0800 https://vim0.com/post/2022/ 今天是 2023 年的第一天,我想写一篇年终总结,回顾一下 2022 年的一些事情。 同时也是一个自我的回顾。 2022 年终总结 2022 年是一个不大顺利的一年, 似乎因为经济下行 使用 neovim 作为 PDE(个性化开发环境) https://vim0.com/post/neovim/ Sat, 29 Oct 2022 20:45:20 +0800 https://vim0.com/post/neovim/ 本文不会告诉你如何一步一步地配置 neovim,而是告诉你一些关于 PDE 的 “道”, 不是具体实践的 “术&rdqu shell 是一个不错的生产力工具 https://vim0.com/post/shell_is_useful_tool/ Mon, 12 Sep 2022 14:34:53 +0800 https://vim0.com/post/shell_is_useful_tool/ 连续三个命令的序列,重复执行了第二次,那么就建议你将它写成一个 Shell 脚本 – blog.fleeto.us 最近越来越发觉 shell 是一门可以代替 python 作为 devops 的工程师的第二门语言. 因为日常 使用二八法则省力地学习 awk https://vim0.com/post/awk/ Wed, 29 Jun 2022 22:14:09 +0800 https://vim0.com/post/awk/ 篇幅只占20%、然而有效性却达到80% -二八法则 本文你能学到什么? 在本文中,我们将学习到如何使用二八法则来省力轻松学习 linux 文本处理命令 awk。 肉身翻墙新加坡安顿指南 https://vim0.com/post/singapore_3_month/ Sun, 12 Jun 2022 21:33:31 +0800 https://vim0.com/post/singapore_3_month/ 阅读本文能获得什么 本文主要讲的是如何来到新加坡工作之后,需要做的一些事情。 阅读本文你能获得到在新加坡落地之后,需要做的一些必须的 事项例如租房 使用 Docker Compose 建立你自己的开发环境 https://vim0.com/post/docker-compose-dev/ Thu, 05 May 2022 22:08:34 +0800 https://vim0.com/post/docker-compose-dev/ Docker 其实并不是一种新技术,而是一个新瓶装旧酒的工具。 其实我在大学上学的时候就用过 Docker,那个时候还是 17 年左右,Docker 还是如日中天的 关于编写可维护的代码的一些实践与想法 https://vim0.com/post/write_-maintainable_code/ Sun, 10 Apr 2022 23:08:16 +0800 https://vim0.com/post/write_-maintainable_code/ 关于编写可维护的代码的一些实践与想法 最近在改一个代码风格迥异并且经历过很多手的历史代码,发现中间中了很多代码设计上的一些反模式的错误。导致我 我为什么使用双向链接做笔记? https://vim0.com/post/two-way-link/ Sun, 27 Feb 2022 23:15:45 +0800 https://vim0.com/post/two-way-link/ 记忆信息后寻找之间的联系才是人的价值。 之前向身边的朋友推荐双相链接的软件来记录八股文,很多人会来问我“为什么要用双向链接?有啥好处?” 。 我这 关于焦虑和拖延症 https://vim0.com/post/anxiety/ Sun, 20 Feb 2022 21:17:20 +0800 https://vim0.com/post/anxiety/ 拖延总能让我们苟且偷安,但难题并没有消失。–《番茄工作法图解》 目前存在的问题 压力产生焦虑,在互联网公司始终会有很多的压力,有些是 Golang: 如何处理日渐膨胀的 interface https://vim0.com/post/how_to_fix_big_interface/ Sun, 13 Feb 2022 20:23:51 +0800 https://vim0.com/post/how_to_fix_big_interface/ The bigger the interface,the weaker the abstraction。Go Proverbs 先说结论吧,如果你的 Golang interface 有太多函数导致你很难横向拓展,那就把它按照职责拆分 使用番茄工作法来更好的利用你的时间 https://vim0.com/post/pomodoro_todo/ Thu, 03 Feb 2022 00:48:05 +0800 https://vim0.com/post/pomodoro_todo/ 对于我还来说,很容易陷入一种工作一整天,一整天都很忙但是不知道在忙什么的状态,导致第二天还是很焦虑,早会还是不知道要讲什么,只能做一下让自己 Unix 如何杀死一个进程和它的子孙进程? https://vim0.com/post/kill_process_and_its_childs/ Mon, 24 Jan 2022 21:49:48 +0800 https://vim0.com/post/kill_process_and_its_childs/ 最近周末在维护一个开源项目,叫做 air。它是一个 Golang 的热加载代码的工具,会监听本地的文件变化,然后自动重新加载。 遇到的问题 最近遇到一个特别有意 Golang: 让你的零值更有用 https://vim0.com/post/make_zero_value_useful/ Sun, 16 Jan 2022 15:04:40 +0800 https://vim0.com/post/make_zero_value_useful/ Make the zero value useful。 –Go Proverbs 让我们从 Golang blog 开始吧:The zero value 当内存被分配来存储一个值时,无论是通过声明还是调用 make 或 new,并且没有提供明确的初始 使用 Mock 和 Interface 进行 Golang 单测 https://vim0.com/post/golang/use_mock_to_test/ Fri, 07 Jan 2022 01:37:56 +0800 https://vim0.com/post/golang/use_mock_to_test/ 在工作中我经常会发现很多工程师的 Golang 单测是写的有问题的,只是单纯的调用代码做输出,并且会包含各种 IO 操作,导致单测无法到处运行。 使用 Mock 和 Interface 进行 Golang 关于 Golang Slice 的一些细节 https://vim0.com/post/golang/about_slice/ Tue, 21 Dec 2021 01:37:56 +0800 https://vim0.com/post/golang/about_slice/ 关于 Golang Slice 的一些细节 在 Golang 中,有两种数据类型: 一种是限定长度的数组,叫做 Array,另外一种是不限定长度的数组,叫做 Slice。 区分 Array 和 Slice Array 和 Slice 总结一些计算机常用的原则 https://vim0.com/post/summary/rules/ Wed, 10 Nov 2021 00:00:00 +0000 https://vim0.com/post/summary/rules/ 计算机常用的原则 在写代码的时候我们经常会有一些体会和经验所得,这些经验所得其实老早被之前的大神归纳成为原则。最近这一年我就一直在收集各种原则 重新学习英语语法 https://vim0.com/post/english/english_grammar/ Thu, 14 Oct 2021 01:37:56 +0800 https://vim0.com/post/english/english_grammar/ 背景 感觉自己对英语还是有很多的欠缺,所以前一段时间学习了一些英语相关的语法,其实很多都是初中要学的东西但是自己当时一点都不上心,压根就没从老 上班族近期小半年入门投资基金组合的学习与实践经历 https://vim0.com/post/investment/learned_about_investment/ Tue, 01 Jun 2021 20:55:56 +0800 https://vim0.com/post/investment/learned_about_investment/ ”每个人都应该投资,越早越好。哪怕你一直输钱,十年后至少你学会了如何少输。而不是等到十年后被迫必须投资时,一次输掉大部分本金“ –@xiaodotdo 前言 笔者因为 疫情期间的肉身翻墙新加坡指南 https://vim0.com/post/softskills/physical_break_gfw/ Wed, 19 May 2021 14:40:53 +0800 https://vim0.com/post/softskills/physical_break_gfw/ ”国外生活的难度比想象的小,但出国需要的决心比想象的大“ –@FreiheitYu 作者写下这篇文章的时候是 2021 年上旬,随着出入境政策的放松与收紧可能会有出入,仅供参考 About me https://vim0.com/post/about/about_me/ Sat, 15 May 2021 14:40:53 +0800 https://vim0.com/post/about/about_me/ About me 欢迎!我是咸糖。这是我的个人网站,我在其中博客是我在日常生活中学到的东西或思考,希望你能喜欢它。 我在这里分享我学到的东西,如果给你造成了 软技能:大厂底层员工打工指南 https://vim0.com/post/softskills/how_to_live_in_big_company/ Mon, 26 Apr 2021 14:40:53 +0800 https://vim0.com/post/softskills/how_to_live_in_big_company/ “我发现很多文章面经都是在讲如何进入大厂的,但是其实在大厂生存也是一个学问” 前言 笔者最近换了工作,选择了心脏跳动,没有在之前的某跳动继续工作 软技能:我是如何获取知识与信息的? https://vim0.com/post/softskills/how_do_i_acquire_knowledge_and_information/ Fri, 02 Apr 2021 14:40:53 +0800 https://vim0.com/post/softskills/how_do_i_acquire_knowledge_and_information/ ​ ”我们每个人都是信息时代的荒野猎人,在信息构成的一望无际的荒野中求存。“ -《为什么要成为信息捕食者》 ​ 在信息爆炸的移动互联网时代,每个互联 分布式的令牌桶算法的实现 https://vim0.com/post/interview/%E5%88%86%E5%B8%83%E5%BC%8F%E7%9A%84%E4%BB%A4%E7%89%8C%E6%A1%B6%E7%AE%97%E6%B3%95%E7%9A%84%E5%AE%9E%E7%8E%B0/ Thu, 09 Apr 2020 01:37:56 +0800 https://vim0.com/post/interview/%E5%88%86%E5%B8%83%E5%BC%8F%E7%9A%84%E4%BB%A4%E7%89%8C%E6%A1%B6%E7%AE%97%E6%B3%95%E7%9A%84%E5%AE%9E%E7%8E%B0/ 什么是令牌桶算法? 令牌桶算法是一种限流算法,他与漏桶算法的实现是一种相反的实现。 漏桶算法是按照一定频率的速率进行漏水,然后对于我们的请求就可 实现一个AtomicInteger https://vim0.com/post/concurrency/%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AAatomicinteger/ Mon, 06 Apr 2020 16:33:34 +0800 https://vim0.com/post/concurrency/%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AAatomicinteger/ 什么是 AtomicInteger AtomicInteger 顾名思义是一个具有原子化操作的 Integer,与普通的 Integer 的区别是 AtomicInteger 采用一个 CAS 的方式使 Integer 的自增等操作变成原子化操作。 实现的之前需要了 GC root 在哪里? https://vim0.com/post/jvm/gc_root/ Mon, 06 Apr 2020 01:37:56 +0800 https://vim0.com/post/jvm/gc_root/ 什么是GC Root 首先我们知道标记算法,JVM 的标记算法我们可以了解为一个可达性算法,所以所有的可达性算法都会有起点,那么这个起点就是GC Root 什么是 Minor GC/Major GC https://vim0.com/post/jvm/full_gc/ Mon, 06 Apr 2020 01:37:56 +0800 https://vim0.com/post/jvm/full_gc/ 什么是 Minor GC/Major GC 首先我们先科普一下JVM 经典的堆布局: 对于经典的 JVM heap 布局,有两个区域比较清晰,首先是Young 区,一般会来存放年轻的对象或者刚被 漏桶算法的设计与实现 https://vim0.com/post/interview/%E6%BC%8F%E6%A1%B6%E7%AE%97%E6%B3%95%E8%AE%BE%E8%AE%A1%E5%92%8C%E5%AE%9E%E7%8E%B0/ Sun, 05 Apr 2020 01:37:56 +0800 https://vim0.com/post/interview/%E6%BC%8F%E6%A1%B6%E7%AE%97%E6%B3%95%E8%AE%BE%E8%AE%A1%E5%92%8C%E5%AE%9E%E7%8E%B0/ 什么是漏斗算法? 漏斗算法顾名思义采用一个漏斗来对流量进行限制。 因为漏斗下面有孔,所以会定时的漏水下去,然后我们可以将流量想象为从上边落入漏斗 剑指offer https://vim0.com/post/interview/5%E5%A4%A9%E5%88%B7%E5%AE%8C%E5%89%91%E6%8C%87/ Fri, 03 Apr 2020 01:37:56 +0800 https://vim0.com/post/interview/5%E5%A4%A9%E5%88%B7%E5%AE%8C%E5%89%91%E6%8C%87/ No2 单例模式 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 class No2TwiceCheckSingleton { private volatile static No2TwiceCheckSingleton instance = null; private static final Object sybObj = new Object(); // 一定记住要私有化构造器,不然人家还是能够创建 private No2TwiceCheckSingleton() { } 单例模式 https://vim0.com/post/interview/%E6%89%8B%E5%86%99%E5%8D%95%E4%BE%8B/ Fri, 03 Apr 2020 01:37:56 +0800 https://vim0.com/post/interview/%E6%89%8B%E5%86%99%E5%8D%95%E4%BE%8B/ 单例模式是什么? 单例模式,也叫单子模式,是一种常用的软件设计模式,属于创建型模式的一种。 在这个设计模式中,单例对象的类必须保证只有一个实例存 TCP 针对面试学习 https://vim0.com/post/network/tcp%E9%92%88%E5%AF%B9%E9%9D%A2%E8%AF%95%E5%AD%A6%E4%B9%A0/ Wed, 01 Apr 2020 01:37:56 +0800 https://vim0.com/post/network/tcp%E9%92%88%E5%AF%B9%E9%9D%A2%E8%AF%95%E5%AD%A6%E4%B9%A0/ 什么是 TCP TCP 是一个全双工面向字节流的基于 IP 协议的协议。 TCP 端到端的准确传输。 对于每一个字节进行确认 对于恶劣的网络情况的处理 超时重传 拥塞控制 效率提 Actor 如何处理阻塞消息 https://vim0.com/post/scala/future_in_actor/ Wed, 15 Jan 2020 17:51:36 +0800 https://vim0.com/post/scala/future_in_actor/ 观察了一下业务的代码中发现在 Actor 中采用了很多 import scala.concurrent.ExecutionContext.Implicits.global 来作为 Actor 内部的执行 Future 的线程池,之前觉得好像也没啥问题。 但是在看完 akka 源码后发现好像有些不妥。 简单 Akka 源码解析 https://vim0.com/post/scala/akka_source_code/ Wed, 15 Jan 2020 17:26:53 +0800 https://vim0.com/post/scala/akka_source_code/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 object Main1 extends App { val system = ActorSystem("HelloSystem") val jazzListener = system.actorOf(Props[Listener]) val musicListener = system.actorOf(Props[Listener]) system.eventStream.subscribe(jazzListener, classOf[Jazz]) // jazzListener 订阅 Jazz 事件 system.eventStream.subscribe(musicListener, classOf[AllKindsOfMusic]) // musicListener 订阅 AllKindsOfMusic 以及它的子类 事件 // 只有 musicListener 接收到这个事件 system.eventStream.publish(Electronic("Parov Stelar")) // jazzListener How to learn scala https://vim0.com/post/scala/how_to_learn_scala/ Wed, 15 Jan 2020 16:33:34 +0800 https://vim0.com/post/scala/how_to_learn_scala/ 背景: 刚来到以scala为技术栈的公司的时候,配置了半天环境,然后终于将项目起了起来,发现里面的代码很奇怪,没有任何循环,数据的操作是一个函 AES 需要限制 SEED 长度 https://vim0.com/post/scala/aes_limit_length/ Sun, 20 Oct 2019 01:37:56 +0800 https://vim0.com/post/scala/aes_limit_length/ 写了一个工具类用来加密解密数据库的 app 字段 本地环境运行单测什么都没有任何问题,但是一到生产环境就出现 BUG。 这个的原因是因为线上环境没有支持 AES Java 如何区分==与.equals()方法 https://vim0.com/post/translate/java_equals/ Sun, 24 Feb 2019 14:40:53 +0800 https://vim0.com/post/translate/java_equals/ 一般来说equals()和"=="运算符是用来比较两个对象是否相等,但是这两者之前还是有许多不同: 最主要的不同是.equ 2018年年度总结 https://vim0.com/post/summary/2018_summary/ Sun, 30 Dec 2018 14:40:53 +0800 https://vim0.com/post/summary/2018_summary/ 到年底啦,稍微写一点总结总结一下这个2018年。 这一年有失去也有获得吧。失去是一段没有结果的感情的失败,获得则是整个人质的提升。 失去的就让他 Java 集合扩容 https://vim0.com/post/collection/collection/ Fri, 07 Dec 2018 01:37:56 +0800 https://vim0.com/post/collection/collection/ 集合扩容 ArrayList 对于 ArrayList 他默认的容量为 10,所以如果需要对 ArrayList 进行大数据量的处理的时候的话,就需要使用显式制定容量的方式进行处理。这样可以减少不必要的