Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

xiaolai xiaolai

🎯
Focusing
View GitHub Profile
@xiaolai
xiaolai / coursera-dl.md
Created Mar 29, 2020
Download Coursera Material
View coursera-dl.md
@xiaolai
xiaolai / brew.md
Created Mar 16, 2020
homebrew upstream repo for China
View brew.md
# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

# 替换homebrew-bottles:
View Personal Library.md
  1. Download and pin books at https://read.amazon.com, and use epubor KCR converter to convert them into epubs.
  2. Download audio books at https://audible.com, with aax format.
  3. Obtain your activation bytes with the instruction of this post.
  4. Install ffmpeg with brew.
  5. Install audible-converter with npm. (File name will be extended automatically)
audible-converter "*.aax" -a <your-activation-bytes>
  1. Install atomicparsley with brew. (to add artwork to converted m4a files) Bash script to add artworks to m4a files:
@xiaolai
xiaolai / gist:2ffe003b05eb3a2f7ba933858d353d7d
Created Feb 6, 2020
search and replace all mal-rendered emphasized text in github markdown
View gist:2ffe003b05eb3a2f7ba933858d353d7d
search regex:
~*(?:^|[^~])(~~(\\w+(\\s\\w+)*)~~)
# replace with (attention: there's a white space at the end)
**$1**
@xiaolai
xiaolai / Style.css
Created Apr 13, 2019
vscode markdown github preview custom style
View Style.css
.vscode-body .markdown-body {
font-family: "PingFang SC"
}
.vscode-body strong {color:#6392BF;}
.vscode-body em {color: #A9312A; font-style: normal !important;}
.vscode-body table {font-size: 95% !important;}
.vscode-body .CodeMirror, .vscode-body pre {font-size: 90%;}
.vscode-body pre {
@xiaolai
xiaolai / jupyter-as-a-desktop-app.md
Last active Jun 7, 2020
Run Jupterlab as an desktop app
View jupyter-as-a-desktop-app.md

How to run Jupyterlab as a desktop app on Mac OSX

Tiered of opening terminal to launch Jupyterlab, and having to leave it opened all the time? Try to run Jupyterlab as a desktop app:

nativefier-jupyterlab

One of a benefits is avoiding the annoying accident: "closed Jupyterlab when quitting the browser".

1. Install Anaconda for mac

Run in Terminal

View gist:cef9c92caa9c252fe6aaa3f43cecb102
# install anaconda
jupyter-lab --generate-config
edit ~/.jupyter/jupyter_notebook_config.py, add lines:
c.NotebookApp.token = '' #you can set password here.
#https://github.com/jiahaog/nativefier
npm install nativefier -g
nativefier "http://localhost:8888"
View press.one
{"sig":"41013b02804b8287fbbeca6df8caf1cb3deeeb64463eac62887acba21ecca05e830c80679849425694e4e90e57ca4dd14d69b90e06a406efdd339ef79f33b08f1","msghash":"f65e36e3f7d2544814229ed32fa010ed664cad9d3fa2195919f20f65b72b99b6"}
View press.one
{"sig":"fdecada24235a801c3636785201e41d35d9ae2f94aab894101fb3e53c4e7fbdabe25692c1eb98737af270dde5cfbfaa580a68dc5ad92f3dbeefc3ac3bd767fe40","msghash":"c1517a536ca6ad241d5c10b7e7de84fa8fb845ae7ee0f0aa9dd3ceb6293474bb"}
View press.one
{"sig":"d5d9f2db2d03037ec02c903fbd1abce5063032f3ec257e4f9714b4d7ec83ea1acf8662230c4516ba497d0f8bbbece29c74550327cda367238c91d5b76f19fd01","msghash":"4e2d55ad6dc73c31b4a88b47114250a1761fc7dcd70b9a3fc0c05efe1930d0d4"}
You can’t perform that action at this time.