All New

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

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

all:systemctl search all fields

Register

Login

All New Register Login

All gists

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

LiuShen / ech0说说展示到前端网站

0 likes
0 forks
2 files
Last active 1 month ago
将ech0说说展示到前端网站页面
ech0 hexo javascript shuoshuo
1 const goComment = (e) => {
2 const n = document.querySelector(".el-textarea__inner");
3 n.value = `> ${e}\n\n`;
4 n.focus();
5 btf.snackbarShow("已为您引用该说说,不删除空格效果更佳");
6 };
7
8 // 如果是twikoo评论区,请自行替换goComment函数,注意,如果评论区开了懒加载可能导致无法找到元素。
LiuShen's Avatar

LiuShen / 生成标准化owo.json

0 likes
0 forks
3 files
Last active 1 month ago
从基本文件格式,生成标准化JSON,用于表情包
artalk json owo python twikoo

整理好表情包为如下格式:

. 📂 owo
└── 📂 bilibili/
│  ├── 📄 bilibili-doge.png
│  ├── 📄 bilibili-大佬.png
│  ├── 📄 …………
└── 📂 blobcat/
│  ├── 📄 blobcat0_0.png
LiuShen's Avatar

LiuShen / Atom美化代码

0 likes
0 forks
1 files
Last active 1 month ago
Atom通过XSL代码进行HTML化并进行美化
atom feed hexo pretty xml xsl
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="3.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:atom="http://www.w3.org/2005/Atom">
5 <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
6
7 <xsl:template match="/">
8 <xsl:variable name="title">
9 <xsl:value-of select="/atom:feed/atom:title"/>
10 </xsl:variable>
LiuShen's Avatar

LiuShen / Mihomo Party 覆写整理脚本

0 likes
0 forks
1 files
Last active 1 month ago
Mihomo Party 覆写整理脚本,整合资源,实现更完整的分组,多订阅共享
clash mohomo-party rewrite
1 // Define the `main` function
2
3 const proxyName = "代理模式";
4
5 function main (params) {
6 if (!params.proxies) return params;
7 overwriteRules (params);
8 overwriteProxyGroups (params);
9 overwriteDns (params);
10 return params;
LiuShen's Avatar

LiuShen / Webhook实现仓库自动备份

0 likes
0 forks
1 files
Last active 1 month ago
宝塔面板,使用Webhook,自动同步更新后的仓库,拉取静态源码部署博客
cmd github shell sync webhook
1 #!/bin/bash
2 echo ""
3 #输出当前时间
4 date --date='0 days ago' "+%Y-%m-%d %H:%M:%S"
5 echo "Start"
6 #判断宝塔WebHook参数是否存在
7 if [ ! -n "$1" ];
8 then
9 echo "param参数错误"
10 echo "End"
LiuShen's Avatar

LiuShen / 利用CF Worker实现一个每日bing一图接口API

0 likes
0 forks
1 files
Last active 1 month ago
利用CF Worker实现一个每日bing一图接口API,可以直接用作图片数据。
api bing cache cloudflare worker
1 // 利用api.nsmao.net实现的bing接口
2 const API_KEY = "ajdlfklahweufbrffbhjefjfsmd,shj" // 自行申请API
3 const CACHE_TTL = 36000 // 10 小时
4
5 export default {
6 async fetch(request, env, ctx) {
7 const { pathname } = new URL(request.url)
8
9 // 首页说明
10 if (pathname === "/") {
LiuShen's Avatar

LiuShen / Linux服务器添加SWAP虚拟内存

0 likes
0 forks
1 files
Last active 1 month ago
在Linux服务器添加SWAP虚拟内存,提高服务器使用率
bash linux ram swap
1 #!/bin/bash
2
3 # ============================
4 # 创建一个 4GB 的 Swap 文件
5 # ============================
6
7 # 步骤 1:创建 4GB 的 Swap 文件
8 echo "步骤 1:创建 4GB 的 Swap 文件"
9
10 # 使用 fallocate 创建一个 4GB 的 swap 文件
LiuShen's Avatar

LiuShen / 快速提取所有ppt中的文本内容

0 likes
0 forks
1 files
Last active 1 month ago
利用visual basic将PPT中的所有文本提取出来
Convert PPT TXT VBA
1 Sub ExportText()
2 Dim oPres As Presentation
3 Dim oSlides As Slides
4 Dim oSld As Slide 'Slide Object
5 Dim oShp As Shape 'Shape Object
6 Dim iFile As Integer 'File handle for output
7 iFile = FreeFile 'Get a free file number
8 Dim PathSep As String
9 Dim FileNum As Integer
10 Dim sTempString As String
LiuShen's Avatar

LiuShen / 通过cloudflare Worker创建github api中间件

0 likes
0 forks
1 files
Last active 1 month ago
通过cloudflare Worker创建github api中间件,在隐藏token的情况下获取仓库提交信息
Javascript cloudflare commit github-api worker
1 /**
2 * Welcome to Cloudflare Workers! This is your first worker.
3 *
4 * - Run "npm run dev" in your terminal to start a development server
5 * - Open a browser tab at http://localhost:8787/ to see your worker in action
6 * - Run "npm run deploy" to publish your worker
7 *
8 * Learn more at https://developers.cloudflare.com/workers/
9 */
LiuShen's Avatar

LiuShen / twikoo的表情包格式转artalk的表情包格式

0 likes
0 forks
1 files
Last active 1 month ago
twikoo的表情包格式转artalk的表情包格式
artalk json owo twikoo
1 import json
2 import requests
3
4 def fetch_data_from_url(url):
5 # 获取JSON数据
6 response = requests.get(url)
7 return response.json()
8
9 def convert_data(original_data):
10 converted_data = []
Newer Older

Powered by Opengist ⋅ Load: 166ms⋅

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