LiuShen / 友链friend.json生成新方式
0 beğeniler
0 çatallar
1 dosyalar
Son aktivite
通过HEXO内置Generator生成,更加快捷,不需要json包
1 | const blacklist = ["友站名称1", "友站名称2", "友站名称3"]; |
2 | const path = "friend.json"; |
3 | |
4 | function genFriendJSON(locals) { |
5 | var friends = []; |
6 | var data = locals.data.link; |
7 | data.forEach((entry, index) => { |
8 | let lastIndex = 2; |
9 | if (index < lastIndex) { |
10 | const filteredLinkList = entry.link_list.filter( |
LiuShen / Hexo-butterfly聊天记录外挂标签
0 beğeniler
0 çatallar
2 dosyalar
Son aktivite
基于鹊楠改进的Hexo-butterfly聊天记录外挂标签
1 | /** |
2 | * Chat |
3 | */ |
4 | |
5 | "use strict"; |
6 | |
7 | // 预定义头像数组 |
8 | const avatars = [ |
9 | "https://i.p-i.vip/30/20240920-66ed9a608c2cf.png", |
10 | "https://i.p-i.vip/30/20240920-66ed9b0655cba.png", |
LiuShen / 解决Matplotlib不显示汉字的问题
0 beğeniler
0 çatallar
1 dosyalar
Son aktivite
解决Matplotlib不显示汉字的问题,设置汉语字体
1 | import matplotlib.pyplot as plt |
2 | import matplotlib.font_manager as fm |
3 | |
4 | # 设置中文字体 |
5 | plt.rcParams['font.sans-serif'] = ['SimHei'] # 使用黑体 |
6 | plt.rcParams['axes.unicode_minus'] = False # 解决负号显示问题 |
7 | |
8 | # 示例数据 |
9 | x = [1, 2, 3, 4] |
10 | y = [10, 20, 15, 25] |
LiuShen / cloudflare worker转发ghcr.io
0 beğeniler
0 çatallar
2 dosyalar
Son aktivite
使用worker转发,加速国内拉取速度
1 | import HTML from './index.html'; |
2 | |
3 | export default { |
4 | async fetch(request) { |
5 | const url = new URL(request.url); |
6 | const path = url.pathname; |
7 | const originalHost = request.headers.get("host"); |
8 | const registryHost = "ghcr.io"; |
9 | |
10 | if (path.startsWith("/v2/")) { |
LiuShen / CloudFlare反向代理Jsdelivr
0 beğeniler
0 çatallar
1 dosyalar
Son aktivite
可以设置自己的主页,加快国内Jsd速度,可以作为CDN源站
1 | const upstream = 'cdn.jsdelivr.net' |
2 | const upstream_mobile = 'cdn.jsdelivr.net' |
3 | |
4 | const blocked_region = ['KP', 'RU'] |
5 | const blocked_ip_address = ['0.0.0.0', '127.0.0.1'] |
6 | |
7 | const replace_dict = { |
8 | '$upstream': '$custom_domain', |
9 | '//cdn.jsdelivr.net': '' |
10 | } |
Daha yeni
Daha eski