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

Register

Login


All New Register Login

All gists

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

LiuShen / Atom美化代码

0 likes
0 forks
1 files
Last active 6 months 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 6 months 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 6 months 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 7 months 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 7 months 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 8 months 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 9 months 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 9 months 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 = []
LiuShen's Avatar

LiuShen / artalk实现前端上传图片

1 likes
0 forks
1 files
Last active 7 months ago
hexo-theme-butterfly中,artalk实现前端上传图片,不使用upgit(不会QAQ,如果有谁会请联系我呜呜呜)
artalk javascript lsky picbed
1 // 请使用该文件替换“[root]\themes\butterfly\layout\includes\third-party\comments\artalk.pug”
2 - const { server, site, option } = theme.artalk
3 - const { use, lazyload } = theme.comments
4
5 script.
6 (() => {
7 let artalkItem = null
8 const option = !{JSON.stringify(option)}
9 const isShuoshuo = GLOBAL_CONFIG_SITE.pageType === 'shuoshuo'
LiuShen's Avatar

LiuShen / 仅仅刷新图片,而不刷新整站

0 likes
0 forks
1 files
Last active 7 months ago
点击图片仅仅刷新图片,而不刷新整站,通过添加参数防止缓存
css html javascript lazyload
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>局部刷新图片</title>
7 <style>
8 body {
9 display: flex;
10 justify-content: center;
Newer Older

Powered by Opengist ⋅ Load: 289ms⋅

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