All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Login


All New Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated
LiuShen's Avatar

LiuShen / 友链friend.json生成新方式

0 likes
0 forks
1 files
Last active 1744361444
通过HEXO内置Generator生成,更加快捷,不需要json包
hexo json script
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's Avatar

LiuShen / Alist美化代码

0 likes
0 forks
2 files
Last active 1746508284
Alist全局和页脚简单美化,适配暗夜模式
alist css footer html javascript
1 <div class="copyright" align="center">
2 <div class="about">
3 <div class="runtime">
4 <span class="run_item">
5 <span class="name">AList</span>
6 <span class="link">UI</span>
7 </span>
8 <span class="run_item">
9 <span class="name">云驰互联</span>
10 <span class="link">搭建</span>
LiuShen's Avatar

LiuShen / Cloudflare 通用转发代理

0 likes
0 forks
1 files
Last active 1744361578
通用转发代理,适合所有站点
Cloudflare nginx worker
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's Avatar

LiuShen / Hexo-butterfly聊天记录外挂标签

1 likes
0 forks
2 files
Last active 1726890905
基于鹊楠改进的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's Avatar

LiuShen / 截图API

0 likes
0 forks
1 files
Last active 1726714294
利用cf worker实现简单截图api
1 import HOME_HTML from './home.html';
2
3 import SCREENSHOT_HTML from './screenshot.html';
4
5 export default {
6 async fetch(request, env, ctx) {
7 // 获取请求的 URL 和路径
8 const url = new URL(request.url);
9 const path = url.pathname;
LiuShen's Avatar

LiuShen / Twikoo自用邮件模板

0 likes
0 forks
2 files
Last active 1726713336
Twikoo模板html文件
1 <div>
2 <div id="content" style="margin-top: 20px;margin-bottom: 20px">
3 <div style="background: #ddefff;width: 95%;max-width: 800px;margin: auto auto;border-radius: 12px;border: #49b1f5 1px solid;overflow: hidden;-webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.4);box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.4); ">
4 <header style="overflow: hidden"><img src="https://i.p-i.vip/30/20240818-66c19b7c531ed.jpg" style="width: 100%; z-index: 666"></header>
5 <div style="padding: 5px 20px">
6 <div class="dear" style="border-radius: 30px;position: relative;color: white;float: left;z-index: 999;background: #347aa9;padding: 5px 30px;margin: -20px auto 0;box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);">亲爱的清羽飞扬站长:</div><br>
7 <center>
8 <h3>你的博客收到了来自${NICK}的评论!</h3>
9 </center>
10 <hr style="width:200px;border:0;border-bottom:1px solid #e5e5e5;margin:12px auto;"><br>&nbsp;&nbsp;<p style="font-weight: bold;">&nbsp;评论者信息:&nbsp;</p>
LiuShen's Avatar

LiuShen / 油猴脚本:获取页面表格

0 likes
0 forks
1 files
Last active 1725936890
获取武汉理工大学教务系统成绩表格的油猴插件
1 // ==UserScript==
2 // @name 武汉理工大学获取成绩表格
3 // @namespace http://tampermonkey.net/
4 // @version 2024-09-08
5 // @license MIT
6 // @description 提取教务处中的成绩为表格并进行下载,适用地址:http://202.114.50.130/Score/login.do*
7 // @author LiuShen
8 // @match http://202.114.50.130/Score/login.do*
9 // @icon https://www.google.com/s2/favicons?sz=64&domain=50.130
10 // @grant none
LiuShen's Avatar

LiuShen / 解决Matplotlib不显示汉字的问题

0 likes
0 forks
1 files
Last active 1725710320
解决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's Avatar

LiuShen / cloudflare worker转发ghcr.io

0 likes
0 forks
2 files
Last active 1725467575
使用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's Avatar

LiuShen / CloudFlare反向代理Jsdelivr

0 likes
0 forks
1 files
Last active 1725433337
可以设置自己的主页,加快国内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 }
Newer Older

Powered by Opengist ⋅ Load: 174ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ 个人主页 ⋅ 站长博客