Skip to content

Instantly share code, notes, and snippets.

View timerring's full-sized avatar
🚀
Rhythmic trend.

John Howe timerring

🚀
Rhythmic trend.
View GitHub Profile
@timerring
timerring / latex
Created July 20, 2025 08:29
the latex code template
\usepackage{listings}
\usepackage{xcolor} % using colorful setting
\lstset{ % overall setting
language=Python,
basicstyle=\ttfamily\small,
keywordstyle=\color{blue},
commentstyle=\color{gray},
numbers=left,
numberstyle=\tiny,
frame=single,

Toml simple docs

Tom's Obvious, Minimal Language. See details on toml.io.

Specification

  • TOML is case-sensitive.
  • # is the comment symbol.
  • key = "value" is the key-value pair.

Keys

The essence of git is to track the files rather than the folders. Hence, if you just want to track the empty folder, which basically can not be supported in git and on github.

The solution is to add a .gitkeep file to the folder. Due to the property of hidden file, the file usually does not show up. And you can track it in the git, with the configuration in .gitignore:

targetFolder/*
!targetFolder/.gitkeep

You can just leave it as the blank file, or you can add some explanation in the file.

The github does not support custom fonts in README.md. Thus to use custom fonts, we need to use other methods.

The Github README files are essentially markdown files thus it supports embedding SVG images. One of the SVG pros is that you can make updates to the SVG images and they will be rendered in the README.md files.

So let us talk about how to embed SVG. From the docs we know that github usually strips out any external resources when rendering the README.md files, which accounts for the reason why the @import does not work.

Thus we need to embedding font data using Base64 encoding. So we need to convert the TTF file to Base64 encoding. You can try this website

Then it will generate the SVG code in the css and html, you can merge them into the SVG file. Take my project as an example. And introduce the SVG file into the README.md file. You can change the SVG path to follow the system.

In addition to the common usage of markdown, there are also some special usage of markdown.

Mention

  • In github, you can use #id tp mention the specific PR or issue in the repository.
  • @username is also available which can mention the specific account of developer.

Emoji

You can add the :emoji-code: in the markdown to appear the corresponding icon. You can check the whole codes here.

How to run jupyter on vscode

Config the kernel

  1. activate your virtual enviroment and install ipykernel
    pip install --upgrade ipykernel
  2. install the kernel in the env

conda install -n envName ipykernel

@timerring
timerring / sparse-clone.md
Last active November 8, 2024 03:48
Pull the repository partially

If you want to pull the repository partially, you can try the commmands of sparse clone:

# open the sparse clone
git config core.sparsecheckout true
echo "some/dir/" >> ./git/info/sparse-checkout

Then you just need to pull as usual: git pull origin main.