Skip to content

Instantly share code, notes, and snippets.

View Peter-Chou's full-sized avatar
😉
I may be slow to respond.

Minhao Chou Peter-Chou

😉
I may be slow to respond.
View GitHub Profile
@Peter-Chou
Peter-Chou / gunicorn.py
Created January 11, 2025 09:19 — forked from HacKanCuBa/gunicorn.py
A config file of gunicorn(http://gunicorn.org/) contains fundamental configuration.
"""Gunicorn config file.
by HacKan (https://hackan.net)
Find it at: https://gist.github.com/HacKanCuBa/275bfca09d614ee9370727f5f40dab9e
Based on: https://gist.github.com/KodeKracker/6bc6a3a35dcfbc36e2b7
Changelog
=========
See revisions to access other versions of this file.
@Peter-Chou
Peter-Chou / eglot-codelens.el
Created May 13, 2024 12:30 — forked from Gavinok/eglot-codelens.el
Add support for code lenses in eglot for emacs
;; eglot-codelens.el --- Add support for codelenses to eglot -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;;; Extending eglot to support lenses
;;;; Findings
;; Lenses often support the option to be used as a code action
;; some servers rely on custom code actions implemented by the client
;; - [[https://github.com/emacs-lsp/lsp-mode/issues/2250]] mentions this
例如:
echo -e "\033[41;36m something here \033[0m"
其中41的位置代表底色, 36的位置是代表字的颜色
那些ascii code 是对颜色调用的始末.
\033[ ; m …… \033[0m
@Peter-Chou
Peter-Chou / .emacs
Created July 17, 2022 06:25 — forked from redguardtoo/.emacs
minimum emacs setup for Emacs plugin testing
;; A minimum .emacs to test Emacs plugins
(show-paren-mode 1)
(eval-when-compile (require 'cl))
;; test elisps download from internet here
(setq test-elisp-dir "~/test-elisp/")
(unless (file-exists-p (expand-file-name test-elisp-dir))
(make-directory (expand-file-name test-elisp-dir)))
(setq load-path

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation

#!/usr/bin/env python
from __future__ import print_function
import argparse
import numpy as np
import time
tt = time.time()
import cv2
from grpc.beta import implementations
Keys Description
C Ctrl
M Alt
Helper functions:
C-h k key-binding Describe the function bound to the key binding. To get this to work, you actually perform the key sequence after typing C-h k.
C-h f Describe function.
Cider/REPL bindings:
M-x cider-jack-in Jack into the REPL
Window key bindings:
@Peter-Chou
Peter-Chou / generate-ssh-key.sh
Created June 30, 2020 06:29 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@Peter-Chou
Peter-Chou / coursier mirror setting
Last active April 1, 2020 13:23
mirror.properties
# Windows: C:\Users\<user_name>\AppData\Roaming\Coursier\config\mirror.properties
# Linux: ~/.config/coursier/mirror.properties
# MacOS: ~/Library/Preferences/Coursier/mirror.properties
jcenter.from=https://repo1.maven.org/maven2
jcenter.to=https://maven.aliyun.com/repository/central
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │ 7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command_to_execute