Skip to content

Instantly share code, notes, and snippets.

View syhily's full-sized avatar
🎯
Focusing

Yufan Sheng syhily

🎯
Focusing
View GitHub Profile

备份与还原(Backup & Restore)设置功能

Context

需要新增第 15 个设置 section backup,位于 /wp-admin/settings/backup。功能包括:定时自动备份(依赖 S3)、手动备份、备份文件列表/下载、从备份还原、手动上传还原。所有备份文件存储在 S3 的 backup/ 前缀下。

阶段一:Settings 管道注册

1.1 Zod Schema

@syhily
syhily / opposans.css
Last active April 22, 2024 09:11
opposans.css
/**
* OPPO Sans Fonts from: https://db.quike.com.cn/_nuxt/fonts/
*/
@font-face {
font-family: "OPPOSans";
src: url(https://db.quike.com.cn/_nuxt/fonts/OPPOSans-B.d74d1bd.woff2) format("woff2"), url(https://db.quike.com.cn/_nuxt/fonts/OPPOSans-B.b8436d4.woff) format("woff");
font-variation-settings: 'wght' 700;
font-weight: 700;
font-style: normal;
font-display: swap
@syhily
syhily / goimports.sh
Last active December 21, 2022 11:59
A custom goimports script with better -local sorting support. Used in pre-commit hooks.
#!/bin/bash
## This shell script is used with https://github.com/TekWizely/pre-commit-golang
# You should add it to your .pre-commit-config.yaml file with the options like
#
# - repo: https://github.com/tekwizely/pre-commit-golang
# rev: v1.0.0-rc.1
# hooks:
# - id: go-mod-tidy-repo
# - id: golangci-lint-mod
@syhily
syhily / pilimi-chinese-torrent-list.txt
Last active December 28, 2023 08:56
Filter the Chinese books that we need.
pilimi-zlib-420000-2379999.torrent
pilimi-zlib-2380000-2829999.torrent
pilimi-zlib-2830000-5239999.torrent
pilimi-zlib-5240000-5329999.torrent
pilimi-zlib-5330000-5359999.torrent
pilimi-zlib-5360000-5379999.torrent
pilimi-zlib-5380000-5449999.torrent
pilimi-zlib-5450000-5479999.torrent
pilimi-zlib-5480000-5499999.torrent
pilimi-zlib-5500000-5519999.torrent
@syhily
syhily / zc688.txt
Created June 7, 2022 01:55
Calibre-Web 书籍下载地址
This file has been truncated, but you can view the full file.
http://zc688.top:20206/download/1/epub/1.epub
http://zc688.top:20206/download/2/epub/2.epub
http://zc688.top:20206/download/3/epub/3.epub
http://zc688.top:20206/download/4/epub/4.epub
http://zc688.top:20206/download/5/epub/5.epub
http://zc688.top:20206/download/6/epub/6.epub
http://zc688.top:20206/download/7/epub/7.epub
http://zc688.top:20206/download/8/epub/8.epub
http://zc688.top:20206/download/9/epub/9.epub
@syhily
syhily / curl_tianlangbooks.sh
Last active February 2, 2025 03:33
抓取天浪书屋的蓝奏云下载链接
for((i=1;i<=10302;i++));
do
echo ""
echo ""
echo "Start download book from $i"
echo ""
echo ""
curl "https://www.tianlangbooks.com/$i.html" -H 'authority: www.tianlangbooks.com' --data-raw 'secret_key=359198&Submit=%E6%8F%90%E4%BA%A4' --compressed | grep "蓝奏云盘" >> download.txt
done
@syhily
syhily / docker-compose.yml
Last active October 26, 2022 11:42
Miniflux on Synology Docker
version: "3.4"
services:
miniflux:
image: miniflux/miniflux:latest
container_name: miniflux
depends_on:
- rsshub
- postgres
ports:
- 1541:8080
@syhily
syhily / bootstrap.sh
Last active June 4, 2022 15:58
How to use docker talebook with MySQL.
#!/usr/bin/env bash
# Patch current talebook for adding permission
grep -qxF 'user.permission = ' /var/www/talebook/webserver/handlers/user.py || sed -i '/user.email = email/a \ \ \ \ \ \ \ \ user.permission = '\''DEPRU'\''' /var/www/talebook/webserver/handlers/user.py
# Start talebook
source /var/www/talebook/docker/start.sh
@syhily
syhily / download_talebook.sh
Last active September 24, 2025 08:37
Download all the books from a talebook website. The https://curl.se/ and https://stedolan.github.io/jq/ are required for using this script.
#!/usr/bin/env bash
# Download metadata, modify these as your needs.
## The directory to save the downloaded files.
download_directory="/volume1/Download/EPUB"
## The website you want to visit.
calibre_site="http://soulseeker.myds.me:25788"
## The formats you want to download. We only download the first present format.
## All the formats should be upper case.
allow_formats=( EPUB MOBI AZW3 )
@syhily
syhily / sync_fork.sh
Last active November 14, 2021 08:27
Update git fork with tags and selected branches.
# Repo: apache/flink
# Fork: streamnative/flink
# Prepare the working enviroment
## Clone the forked repository
git clone git@github.com:streamnative/flink.git
## Add the original repository as the upstream git remote
git remote add upstream git@github.com:apache/flink.git