Whether you are writing a fancy database, or simple CLI program, it's always helpful to embed git commit into the binary. With it, you can know which exact lines of code is to be blamed when users throw you an unhappy backtrace. Previously I have done similar thing in Go, and it's fairly easy: 1 go build -ldflags="-X main.Commit=$(git rev-parse HEAD)" And in you main.go, you have something like| KeepCoding
I don't know which version to start with, the max open files of macOS has been changed to 1024, which is too small to develop with LSP in Emacs. And this problem cannot be simply solved by increasing ulimit. In this reddit thread, rpluim user mentioned: Emacs uses pselect, which is limited to FD_SETSIZE file descriptors, usually 1024. I suspect you've got one of the file-watching utilities enabled in emacs, which tends to use up a lot of file descriptors.| KeepCoding
For Emacs users, optimizing their configuration is a fun thing, and it is also the best way to learn Emacs. Newbies are suggested to copy/paste configuration, which is the fastest and most effective way to learn. However, the configuration usually becomes more complicated and a little messy if still copy/paste after one year or two, more knowledge is required to master Emacs. This article will introduce my experience in optimizing configuration, including mainly two part:| KeepCoding
When it comes to Emacs, every programmer should have heard its name more or less. After all, Emacs has nearly forty years of history. However, many users abandon Emacs before comfort with it due to the steep learning curve. I understand their frustration, I also made many attempts before "skilled" in Emacs. After spend honey moon with Emacs for four years, I think I can share what I learn from Emacs and shed some light for newcomers.| en.liujiacai.net
As the popularity of zig cc, more developers may realize Zig is not only a programming language, but also a toolchain to help maintaining C/C++/Zig project. Today I want to discuss one vital part of this toolchain: Zig's build system, build.zig the first non-trivial Zig program for newcomers. Note: This post is based on Zig 0.11.0-dev.2560+602029bb2. Step When we initialize project scaffold via zig init-exe, it will generate build.zig with detailed comments to help us understand what it does.| en.liujiacai.net
When I was playing with my Emacs configs today, a tramp related message suddenly appeared in minibuffer: 1 Tramp: Opening connection nil for dev using ssh... My Emacs also hang at the same moment since the dev host is out of reach. I haven’t used tramp for sometime, so when I first saw this message, I was curious about which function trigger tramp. I have some experience in troubleshooting tramp hang issue before, and I know that some seemingly unrelated functions will access the opened tra...| en.liujiacai.net
I've been working on a Zig project in my spare time for the last few weeks: jiacai2050/simargs: A simple, opinionated, struct-based argument parser in Zig. Here I want to share the experience learned during the development of simargs. Since simargs is my second non-trivial project, and my experience of Zig is limited, so welcome to point out any mistakes I made in this post. Let's begin. Disclaimer: As a 3-year Rust developer, I will compare Zig with Rust in some sections.| en.liujiacai.net
I'm glad to announce my package Oh My GitHub v1.0 is out. Besides bug fixes, it introduce a very practical feature: create pull request without leaving Emacs. AFAIK, there already exists a similar package called github-pullrequest does this job, but its interface is not very flexible, the PR's title and description is hard coded, and this will break template setup by owners if there exists one. In oh-my-github, M-x omg-pull-create will open an org-mode buffer to edit what a PR required:| en.liujiacai.net