Skip to content

Instantly share code, notes, and snippets.

View chongshenng's full-sized avatar

Chong Shen Ng chongshenng

View GitHub Profile
@chongshenng
chongshenng / google-antigravity-key-repeat.md
Last active February 6, 2026 12:40
Allow Key-Repeating with Google Antigravity

TL;DR

# For macOS, run the following in the terminal
defaults write com.google.antigravity ApplePressAndHoldEnabled -bool false

Why?

I recently started to use Google Antigravity, moving away from VSCode. I'm also a heavy VIM user and the VIM extensions for VSCode-based IDEs has made dev life pretty sweet. But I also had some VIM defaults like key repeats to make navigation faster - actions like holding down j (to go down to the next line) or k (to go up). Gravity wasn't honoring my configs.

It turns out that macOS key-repeating is controlled per app bundle ID. So I had to do the same for Antigravity (see above).

@chongshenng
chongshenng / certificate.conf
Created December 3, 2025 12:44
An example `certificate.conf` for creating SuperNode authentication keys
[req]
default_bits = 4096
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[dn]
C = DE
ST = HH
@chongshenng
chongshenng / bash_strict_mode.md
Created May 29, 2025 14:49 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@chongshenng
chongshenng / embed_ipython.py
Created September 23, 2024 14:19
Embed `ipython` shell in a Python script
from IPython import embed
from traitlets.config import get_config
c = get_config()
c.InteractiveShellEmbed.colors = "Linux"
embed(config=c)
@chongshenng
chongshenng / howto_install_poetry_groups_with_pip.md
Created July 18, 2024 09:00
Install `poetry` groups with `pip`

Sometimes, you need to install poetry groups (for docs, test, or dev) but you want to use pip.

Here's how to do it.

First, install the poetry-plugin (see original link):

$ $POETRY_HOME/bin/pip install --user poetry-plugin

Then, for a group [tool.poetry.group.docs.dependencies], run

@chongshenng
chongshenng / docker_stuff.md
Last active August 22, 2023 16:05
Docker stuff

Here's a way we can seed everything for reproducing a DL training with PyTorch.

Ref: Decentralized AI in Dermatology (link)

# Creating seeds to make results reproducible
def seed_everything(seed_value):
    np.random.seed(seed_value)
    random.seed(seed_value)
 torch.manual_seed(seed_value)
@chongshenng
chongshenng / github_cheatsheet.md
Created May 2, 2023 12:38
GitHub cheatsheet for daily use

I find myself searching for this many times, so here's a reminder for myself

Filter PR by review-requested

is:open is:pr review-requested:[USERNAME]

@chongshenng
chongshenng / install_tex_for_matplotlib.sh
Created March 22, 2023 09:32
Fix TeX fonts for `matplotlib`
#!/bin/sh
# Ref: https://github.com/tanghaibao/jcvi/issues/489
sudo apt-get install -y texlive texlive-latex-extra texlive-latex-recommended dvipng cm-super msttcorefonts
@chongshenng
chongshenng / GitRecovery
Created March 17, 2023 14:08 — forked from pce1991/GitRecovery
Repair git says object files are empty/corrupted
find .git/objects/ -type f -empty | xargs rm
git fetch -p
git fsck --full
http://stackoverflow.com/questions/11706215/how-to-fix-git-error-object-file-is-empty