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
# !/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
"""将 mirai 的旧版 decice.json 转换为新版(`'deviceInfoVersion': 2`)""" | |
import json | |
with open('device.json') as fp: | |
data = json.load(fp) |
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
# -*- coding: utf-8 -*- | |
import re | |
unit_map = { | |
'京': 10**16, | |
'亿亿': 10**16, | |
'千万亿': 10**15, | |
'百万亿': 10**14, | |
'十万亿': 10**13, |
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
# -*- coding: utf-8 -*- | |
""" | |
一个生成用于 Stylus/Stylish 的全局无衬线字体替换的 CSS 的脚本 | |
""" | |
import itertools | |
template = '''\ | |
@font-face { |
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
# -*- coding: utf-8 -*- | |
""" | |
一个生成用于 Stylus/Stylish 的全局衬线字体替换的 CSS 的脚本 | |
""" | |
template = '''\ | |
@font-face { | |
font-family: '{{origin}}'; | |
src: local('{{font}}'); |
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
<html> | |
<head> | |
<style> | |
/* 临时的 start */ | |
main { | |
padding: 20px; | |
height: calc(100% - var(--footer-height) - var(--powered-height)); | |
overflow: hidden; | |
} | |
hr { |