Skip to content

Instantly share code, notes, and snippets.

@zxx
zxx / index.md
Created March 30, 2020 03:36
索引目录
#!/usr/bin/python3
from prettytable import PrettyTable
x = PrettyTable()
x.field_names = ["City name", "Area", "Population", "Annual Rainfall"]
x.add_row(["Adelaide", 1295, 1158259, 600.5])
x.add_row(["Brisbane", 5905, 1857594, 1146.4])
version: '3'
services:
tracker:
build: .
expose:
- "5000"
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
# top5 cpu
ps aux | sort -nrk 3,3 | head -n 5
Bloc makes it easy to separate presentation from business logic, making your code fast, easy to test, and reusable.
@zxx
zxx / mongo.ini
Last active February 19, 2020 05:44
[program:mongo]
command=/usr/local/opt/mongodb-community/bin/mongod --config /usr/local/etc/mongod.conf
# 1
mvn spring-boot:run
# 2
mvn install
java -jar target/xxx.jar
# 测试单个文件
go test device_test.go device.go
Full backup
Incremental backup
Differential backup
# 创建一个workbook 设置编码
workbook = xlwt.Workbook(encoding='utf-8')
# 创建一个worksheet
worksheet = workbook.add_sheet('0')
worksheet.write(0, 0, label='词典名') # 第一行第一列
worksheet.write(0, 1, label='词典标识') # 第一行第二列
row = 1
for d in dicts:
worksheet.write(row, 0, label=d['dict_name'])