Ben Chuanlong Du's Blog

It is never too late to learn.

Generating Completions Script Using Crazy-Complete

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

There are many tools for generating completion scripts for shell languages (bash, zsh, fish, etc), crazy-complete is one of the best among such tools.

ldc -h | crazy-complete --input-type=help …

Tips on the Fish Shell

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Configuration

~/.config/fish

Key Bindings

Shortcuts Description
Alt-. Get parameter of previous commands.
Alt-e Edit the current command line in an external editor.

Please refer to Interactive use for a more …

Async in Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Combining asynchronous code with synchronous code that can cause blocking is never a wise choice. When calling asynchronous code from a synchronous context, use futures::executor::block_on and spawn the async …

Manage Python Projects Using uv

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Installation

curl -LsSf https://astral.sh/uv/install.sh | sh

curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="/usr/local/bin" sh

Usage

Ad-hoc Python Shell & Scripts

  1. You can …

Extracting Data from PDF Files

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Sometimes, a PDF file is corrupted or encrypted making it hard to extract data from it directly. In this case, you can convert a PDF page to an image first and …