A Trick to Troubleshoot Emacs Subprocess Creating

There are many packages of Emacs that leverage subprocesses to do their jobs, Magit, eglot, elpy, to name a few. And there are times that a subprocess doesn't work as expected, for example, Magit is slow, and you're sure that it's ok when running git commands on shell. So how to spot these problems effectively and quickly? The problem is that we don't know what's going on exactly, so here I want to share a few Elisp advices to make the subprocess creating visible, and print the exact program and its arguments to the *Message* buffer. [Read More]

ppcompile: An Emacs Package to Help Coding Locally

If you are a C/C++ programmer like me, you may experience jumping around different machines to write and compile your code, or you may write code on different machines for different projects, and scp/rsync/ftp the projects around. It works, but it's a bit tedious and takes too much burden on our brains. For example, say I have two projects that should be compiled on their compiling machines respectively. There are two obvious workflows for writing code for them "simultaneously": [Read More]
Emacs 

The Binary Search Idea for Narrowing Down Problem Space

Binary search algorithm is a search algorithm that finds the position of a target value within a sorted array. It cuts off the target array in half in a pass, so that it has a worst-case performance of O(log n). Visualization of the binary search algorithm where 7 is the target value(@wikipedia) We all know that it's an efficient searching algorithm, but the strategy behind it also applies for narrowing down other problem space, for example, finding out when a bug is first introduced in a series of git commits. [Read More]

Manage SSH Connections with ~/.ssh/config

I used to manage SSH connection with such GUI apps as MobaXterm, when I wrote code on Windows at work. As I changed my workflow to use a tiling window manager in a VirtualBox guest OS, I continued to improve my way of managing SSH connections, which I want to share here if you don't know yet. At first, I baked a helper Python script, which I named as qssh for "quick ssh", to help me assemble ssh arguments for me(such as username, Ip, port, etc. [Read More]

Why Can't Git Fetch Remote Branches Other Than Master?

Last week I came into a problem with Git, that I can't fetch the remote branch that I just pushed to. It was so weird because I can push it. It never happens before, and it happened when I was in a rush to rebase my code, as someone in my team pushed his code. After searching, it seemed that the configuration of fetch of that repo was different(this Stack Overflow thread for example) than before, it was specified that only master can be fetched. [Read More]
Git 

Open New Urxvt from within Emacs

I have been really enjoying the more concentration workflow qtile, a tiling window manager, brings me, since I started using it a few months ago. I am more focus on the current task now as all the windows I care about are laid out on the same screen. As I get more used to qtile at every day's work, I noticed that I became more depend on short-life terminal sessions. [Read More]

Build Docker Images for Qtile

One of Docker's use cases is to set up identical development environments easily and quickly for a dev team. Recently, I had an opportunity to give it a try, and build Docker images for Qtile, as it didn't have one yet as I get involved. With the images, it's easy to set up the environment to easily run the tests, and build the documentation. The best way to have a basic idea of Docker is to think it like a chroot environment, as Chris Tankersley stated in his Docker for Developers. [Read More]
Docker 

How To Run Bleeding-edge Qtile Within a Virtualenv

For having been using GNOME for quite a long time, I was considering trying some tiling window managers to see what it's like a few weeks ago. Along the way, I found a nice window manager written in Python: Qtile, what interests me most is that it's a hackable window manager, which makes it flexible to extend or change its behaviors. Well, switching to use a tiling window manager is far simpler than I thought. [Read More]

How To Revert a Series of Git Commits?

Sometimes, I need to revert a series of commits that I've already pushed, doing a git hard reset (git reset --hard) is not an option, as someone may already have new commits based on mine. For example, assume that I've made a few commits like below: 65a2c62 * commit 10 25cad43 * commit 9 72ad583 * commit 8 ceebf9a * commit 7 acf8a11 * commit 6 28d526f * commit 5 63af1e2 * commit 4 982c71c * commit 3 0fb4c2d * commit 2 acf9da1 * commit 1 b5f9933 * commit 0 For whatever reason, I need to "drop" the changes made by commit 6 to commit 10, that is, go back to "commit 5" without deleting these commits. [Read More]

How to Change Web Page Titles Easily

There are times that I need to open many web pages of some specific websites within a browser, and there are so many tabs that I can't efficiently access one of them, as their favicons are all the same. So I tried to find a way to rename their titles, preferably in a lightweight way, so that I can spot them quickly with my eyes. The first thought came into my mind was to find some browser extensions to do the job. [Read More]