Skip to content

Instantly share code, notes, and snippets.

View AllanChain's full-sized avatar
💭
I may be slow to respond.

Allan Chain AllanChain

💭
I may be slow to respond.
View GitHub Profile
@AllanChain
AllanChain / dockertags
Last active February 29, 2020 02:07
List docker image tags with 163 mirror
#!/bin/bash
# From https://stackoverflow.com/a/39454426/8810271
if [ $# -lt 1 ]
then
cat << HELP
dockertags -- list all tags for a Docker image on a remote registry.
EXAMPLE:
@AllanChain
AllanChain / profiles.json
Last active April 24, 2020 13:31
Windows Terminal Configuration
// This file was initially generated by Windows Terminal 0.11.1121.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@AllanChain
AllanChain / 00-startup.py
Created December 7, 2020 02:02
My ipython profile for experiment reports
import numpy as np
from numpy import sqrt
import pandas as pd
from matplotlib import pyplot as plt
plt.rcParams["figure.figsize"] = (10, 8)
plt.rcParams["font.size"] = 14
def read_excel(sheet):
CoordMode, Mouse, Screen
WinActivate, FRD-AL10
WinGetPos, X, Y, Width, Height, FRD-AL10
if ErrorLevel
MsgBox, Error
ButtonX := X + (Width / 2)
ButtonY := Y + (Height * 5 / 6)
MouseMove, ButtonX, ButtonY
; MsgBox %X%, %Y%, %Width%, %Height%, %ButtonX%, %ButtonY%
Loop, 100
@AllanChain
AllanChain / color.html
Last active December 21, 2020 15:28
Simple color picker page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Color Picker</title>
<style>
:root {
--current-color: #000000;
}
@AllanChain
AllanChain / big-sc.mplstyle
Created January 17, 2021 04:02
My Matplotlib style file.
figure.figsize: 10, 8
font.family: sans-serif
font.sans-serif: Noto Sans CJK SC
axes.unicode_minus: false
font.size: 16 # controls default text sizes
axes.titlesize: 20 # fontsize of the axes title
axes.labelsize: 20 # fontsize of the x and y labels
xtick.labelsize: 16 # fontsize of the tick labels
ytick.labelsize: 16 # fontsize of the tick labels
legend.fontsize: 16 # legend fontsize
@AllanChain
AllanChain / termux-init.sh
Created February 22, 2021 07:49
Termux Quick Setup
termux-setup-storage
apt install clang python python-dev fftw libzmq libzmq-dev freetype freetype-dev libpng libpng-dev pkg-config curl vim-python zsh
sh -c "$(curl -fsSL https://github.com/Cabbagec/termux-ohmyzsh/raw/master/install.sh)"
@AllanChain
AllanChain / xb.py
Created February 22, 2021 09:25
Termux auto start and open browser
from os import popen
from sys import argv
import subprocess
from re import findall
app_nickname = {'j': 'jupyter notebook --no-browser',
'd': 'grip',
'k': 'mkdocs serve'}
mode := 1
#c::
mode:=!mode ;not! toggle
return
#If mode ; All hotkeys below this line will only work if mode is TRUE
j::1
k::2
l::3
@AllanChain
AllanChain / README.md
Created June 13, 2021 03:59
提取 人类生存发展与核科学 课件中的文字

这是简单地提取 人类生存发展与核科学 课件中文字的脚本。

适用于已经有笔记但担心考一些课件里边角的内容有觉得把课件全打下来太浪费的同学。