Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View xiaolai's full-sized avatar

xiaolai xiaolai

View GitHub Profile
xiaolai /
Created December 25, 2022 08:43
Bash Function to Open a Gepo's Github Page from Terminal
function github {
if [ -d .git ]; then
remotes=$(git remote -v | head -1 | awk -F'' '{print $2}' | cut -d" " -f1)
if [ -z "$remotes" ];
remotes=$(git remote -v | awk -F'' '{print $2}' | cut -d" " -f1)
remote_url=$(echo $remotes | cut -d" " -f1)
xiaolai /
Last active June 25, 2023 23:44
A better way to listen audiobook on MacOS
xiaolai / download-all-my-kindle-books.ipynb
Last active August 16, 2023 01:17
a jupyter notebook for downloading all books to devices, using Selenium.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
xiaolai / Using various profiles for
Last active December 5, 2022 12:31
Using various profiles for
alias codedefault="/opt/homebrew/bin/code"
alias code="codedefault --extensions-dir $HOME/.vscode/default/extentions --user-data-dir $HOME/.vscode/default/user"
alias codedart="codedefault --extensions-dir $HOME/.vscode/dart/extentions --user-data-dir $HOME/.vscode/dart/user"
alias codejs="codedefault --extensions-dir $HOME/.vscode/js/extentions --user-data-dir $HOME/.vscode/js/user"
alias codego="codedefault --extensions-dir $HOME/.vscode/go/extentions --user-data-dir $HOME/.vscode/go/user"
alias codemd="codedefault --extensions-dir $HOME/.vscode/markdown/extentions --user-data-dir $HOME/.vscode/markdown/user"
alias codepy="codedefault --extensions-dir $HOME/.vscode/python/extentions --user-data-dir $HOME/.vscode/python/user"
xiaolai / index.html
Last active November 27, 2022 09:15
Electron Fiddle Gist
<!DOCTYPE html>
<meta charset="UTF-8">
<!-- -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<link href="./styles.css" rel="stylesheet">
<title>Hello World!</title>
xiaolai /
Last active August 4, 2023 03:07
Change fonts of Notion APP

Change font settings for Notion (Web/Desktop App)

Notion provides only three fonts to choose... I have to inject css styles to meet my ends, using Stylus extension for Edge and Nativefier for Desktop App.


.notion-page-content {
    font-family: 'Kaiti SC'
xiaolai /
Created September 26, 2022 01:29 — forked from JoeyBurzynski/
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
xiaolai / Python 2 and Alfred on macOS
Last active March 27, 2022 03:15
Python 2 and Alfred on macOS Monterey
xiaolai /
Created October 21, 2021 01:46
multiple account on github with ssh-key

In Terminal:

ssh-keygen -t rsa -f "id_rsa_<new account name>" -C "<email of new account>"
ssh-add ~/.ssh id_rsa_<new account name>

Edit ~/.ssh/config:

xiaolai / keybindings.json
Created October 17, 2021 07:05
VSCode enclose selection with unicode
"key": "ctrl+shift+'",
"command": "editor.action.insertSnippet",
"args": {"snippet": "“$TM_SELECTED_TEXT$0”"},
"when": "editorTextFocus&&editorHasSelection"
"key": "ctrl+'",
"command": "editor.action.insertSnippet",