One of my colleagues shared an article on writing (good) Git commit messages today: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" This is a personal used vimrc, single file for basic settings | |
" indent | |
set autoindent | |
set smartindent | |
" TAB | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
def parse_line(line: str) -> dict: | |
start_index = line.index(':') | |
record_line = line[start_index:] | |
record = { | |
'byte_count': int(record_line[1:3], 16), | |
'address': record_line[3:7], | |
'type': record_line[7:9], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt install -y \ | |
build-essential \ | |
gcc-arm-linux-gnueabihf \ | |
libssl-dev \ | |
flex \ | |
bison \ | |
python-mako \ | |
libncurses5 \ | |
libncurses5-dev \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
channels: | |
- defaults | |
show_channel_urls: true | |
default_channels: | |
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main | |
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free | |
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r | |
custom_channels: | |
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud | |
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## This gist contains step by step instructions to install cuda v10.0 and cudnn 7.5 in Ubuntu 18.04 | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymysql.cursors | |
def execute(cursor): | |
# Read a single record | |
sql = "SELECT `id`, `password` FROM `users` WHERE `email`=%s" | |
cursor.execute(sql, ('[email protected]',)) | |
result = cursor.fetchone() | |
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo Install Chocolatey | |
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 从阿里云的镜像安装 Docker CE | |
# 参考:https://help.aliyun.com/document_detail/60742.html | |
# step 1: 安装必要的一些系统工具 | |
apt-get update | |
apt-get -y install apt-transport-https ca-certificates curl software-properties-common | |
# step 2: 安装GPG证书 |
NewerOlder