Skip to content

Instantly share code, notes, and snippets.

View chongchonghe's full-sized avatar

ChongChong He chongchonghe

View GitHub Profile
@chongchonghe
chongchonghe / fuzzycheat.py
Created July 17, 2022 19:26
A simply fuzzy search extension to cheat/cheat
#!/usr/bin/env python3
"""
Make this file executable, link it to your PATH and rename it as ch.
Usage: ch arg1 [arg2 ...]
If arg1 starts with '-', execute cheat from https://github.com/cheat/cheat:
`cheat arg1 [arg2 ...]`.
Otherwise, do a fuzzy search for arg1 which returns 'tag', then execute `cheat tag`.
"""
@chongchonghe
chongchonghe / .vimrc
Last active September 20, 2020 17:13
A minimal vim configuration file
" A minimal .vimrc with no plugin manager required
" About: This file is a combination of Integralist/.vimrc on github and a bunch of
" scripts I found useful.
" Author: Chong-Chong He
" Email: che1234@umd.edu
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" The following script is downloaded from
" Integralist/.vimrc: https://gist.github.com/Integralist/b435e36cfb3fdea1579b8f342b72974e
" Now the link failed and here is Integralist's new .vimrc:
@chongchonghe
chongchonghe / solar_system.py
Last active February 4, 2024 02:53
Python solar system (a file in this repo https://github.com/chongchonghe/Python-solar-system )
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from astropy.time import Time
from astroquery.jplhorizons import Horizons
sim_start_date = "2018-01-01" # simulating a solar system starting from this date
sim_duration = 2 * 365 # (int) simulation duration in days
m_earth = 5.9722e24 / 1.98847e30 # Mass of Earth relative to mass of the sun