Skip to content

Instantly share code, notes, and snippets.

View Redlnn's full-sized avatar
🕊️
咕?咕咕?咕咕咕!

Kaedehara Kazuha Redlnn

🕊️
咕?咕咕?咕咕咕!
View GitHub Profile
@Redlnn
Redlnn / 1.html
Created December 23, 2023 09:14
<html>
<head>
<style>
/* 临时的 start */
main {
padding: 20px;
height: calc(100% - var(--footer-height) - var(--powered-height));
overflow: hidden;
}
hr {
@Redlnn
Redlnn / serif_css_gen.py
Last active December 30, 2023 10:04
一个生成用于 Stylus/Stylish 的全局衬线字体替换的 CSS 的脚本
# -*- coding: utf-8 -*-
"""
一个生成用于 Stylus/Stylish 的全局衬线字体替换的 CSS 的脚本
"""
template = '''\
@font-face {
font-family: '{{origin}}';
src: local('{{font}}');
@Redlnn
Redlnn / sanserif_css_gen.py
Last active December 30, 2023 10:05
一个生成用于 Stylus/Stylish 的全局非衬线字体替换的 CSS 的脚本
# -*- coding: utf-8 -*-
"""
一个生成用于 Stylus/Stylish 的全局无衬线字体替换的 CSS 的脚本
"""
import itertools
template = '''\
@font-face {
@Redlnn
Redlnn / cn2an.py
Last active September 27, 2022 01:36
中文数字转阿拉伯数字
# -*- coding: utf-8 -*-
import re
unit_map = {
'京': 10**16,
'亿亿': 10**16,
'千万亿': 10**15,
'百万亿': 10**14,
'十万亿': 10**13,
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""将 mirai 的旧版 decice.json 转换为新版(`'deviceInfoVersion': 2`)"""
import json
with open('device.json') as fp:
data = json.load(fp)