LiuShen / 友链friend.json生成新方式
0 likes
0 forks
1 files
Last active 8 months ago
| 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( |
| 1 | addEventListener('fetch', event => { |
| 2 | event.respondWith(handleRequest(event.request)) |
| 3 | }) |
| 4 | const specialCases = { |
| 5 | "*": { |
| 6 | "Origin": "DELETE", |
| 7 | "Referer": "DELETE" |
| 8 | } |
| 9 | } |
| 10 | function handleSpecialCases(request) { |
LiuShen / Hexo-butterfly聊天记录外挂标签
1 likes
0 forks
2 files
Last active 1 year ago
基于鹊楠改进的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 likes
0 forks
1 files
Last active 1 year ago
解决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 likes
0 forks
2 files
Last active 1 year ago
使用worker转发,加速国内拉取速度
| 1 | <!DOCTYPE html> |
| 2 | <html lang="zh-CN"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | <title>V2镜像使用说明</title> |
| 7 | <style> |
| 8 | body { |
| 9 | font-family: 'Roboto', sans-serif; |
| 10 | margin: 0; |
LiuShen / CloudFlare反向代理Jsdelivr
0 likes
0 forks
1 files
Last active 1 year ago
可以设置自己的主页,加快国内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 | } |