Skip to content

Instantly share code, notes, and snippets.

View syhily's full-sized avatar
🎯
Focusing

Yufan Sheng syhily

🎯
Focusing
View GitHub Profile
@syhily
syhily / SKILL.md
Created October 26, 2026 10:06
把扫描版中文书籍 PDF 制作成排版精良的 EPUB 3 电子书的 SKILL
name scanned-book-to-epub
description 把扫描版中文书籍 PDF 制作成排版精良的 EPUB 3 电子书并发布到 GitHub Releases 的完整工作流——书籍勘察、脚手架移植、MinerU 双模式 OCR(pipeline 底稿 + vlm 交叉比对)、并行子代理 swarm 交叉校对(Ghostscript 渲染原页裁决分歧、页底脚注逐页补回)、pandoc + Lua 过滤器构建、tag 触发 CI 发布。当用户要把某本扫描书/PDF 做成 EPUB 电子书、提到"OCR 实现 EPUB"、"孙绍振系列"、"close-reading-of-* 项目"、"审校完前不要打 tag"等时使用。已验证项目:syhily/close-reading-of-masterpieces(名作细读)、syhily/close-reading-of-classical-poetry(月迷津渡)、syhily/close-reading-of-classical-prose(古典散文解读全编,455 页 62 篇,7 代理 swarm 完成)。

扫描书 → EPUB 工作流

把一本扫描版中文书做成 EPUB 3 并发布 GitHub Release。六个阶段:勘察 → 脚手架 → OCR → swarm 交叉校对 → 全书统一与卫生检查 → 构建发布。

模板项目

@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 / curl_tianlangbooks.sh
Last active November 7, 2026 17:20
抓取天浪书屋的蓝奏云下载链接
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
@syhily
syhily / build-protoc.sh
Created January 21, 2021 09:54
Build protoc.exe for Apple M1
#!/bin/bash
# Builds protoc executable into target/<OS>/<ARCH>/protoc.exe; optionally builds
# protoc plugins into target/<OS>/<ARCH>/protoc-gen-*.exe
#
# Usage: ./build-protoc.sh <OS> <ARCH> <TARGET>
#
# <TARGET> can be "protoc" or "protoc-gen-javalite". Supported <OS> <ARCH>
# combinations:
# HOST <OS> <ARCH> <COMMENT>
@syhily
syhily / ThunderPlugInsDeleter-macOS.sh
Created January 15, 2021 01:10
这段脚本可以让macOS上迅雷的外观更加简洁
cd /Applications/Thunder.app/Contents/PlugIns
rm -rf featuredpage.* advertising.* xlbrowser.* activitycenter.* xlplayer.* xiazaibao.* iOSThunder.* searchtask.* lixianspace.* softmanager.* webgame.* livestream.*
package json
import (
"bytes"
"fmt"
"io"
"net/http"
"strings"
"github.com/gin-gonic/gin/binding"