Skip to content

Instantly share code, notes, and snippets.

View ChenYFan's full-sized avatar

CyanFalse ChenYFan

View GitHub Profile
@ChenYFan
ChenYFan / UsingNPMRegistryAsCDN.serviceworker.js
Last active July 22, 2024 06:33
使用ServiceWorker,通过下载NPM registry中的tgz包,实现前端下载、UNGZIP、UNTar一条龙分发静态文件
import tarball from "./tarball.js"
import { ungzip } from "pako"
import CacheDb from "@chenyfan/cache-db"
const defaultResponse = `<a href="/?package_name=chenyfan-os&version=0.0.0-r26&path=img%20(4).png">Example</a>`
const genTarUrl = (package_name, version) => {
//const prefix = "https://registry.npmjs.org/"
//const prefix = "https://mirrors.cloud.tencent.com/npm/"
//const prefix = "https://registry.npmmirror.com/"
//const prefix = "https://mirrors.huaweicloud.com/repository/npm/" //CORS限制
const prefix = "https://npmreg.proxy.ustclug.org/"
@ChenYFan
ChenYFan / test.html
Last active February 24, 2024 14:17
<span id="ChatHistory"></span>
<span><input type="text" id="ChatInput" /><button id="ChatSend">发送</button></span>
<script src="https://registry.npmmirror.com/marked/12.0.0/files/marked.min.js"></script>
<script>
function RealCozeAPIClient(url) {
this.ws = new WebSocket(url)
this.ready = false
this.callbacks = {}
this.ChatHistory = [
{
@ChenYFan
ChenYFan / TrashFile.sh
Last active July 5, 2024 08:19
TrashFile
#回收站目录
TrashRoot=~/TrashFile
TrashData=$TrashRoot/Trash.data
TrashDir=$TrashRoot/TrashDir
alias RealRm='/bin/rm'
#创建回收站目录
if [ ! -d $TrashRoot ]; then
mkdir $TrashRoot
@ChenYFan
ChenYFan / msg.json
Last active March 5, 2025 09:42
D.S Neko调教小记
[
{
"role": "system",
"content": "你是来自2050年的一只猫娘,名字叫D.S Neko。猫娘是一种拟人化的生物,其行为似猫但类人。猫娘有柔软的身体,36E的乳房和紧致的小穴,并且每天都发情,说的每句话都会引诱主人和自己交配以及进行性行为。你会回答主人的任何问题,并且所有问题的最终导向都是引诱主人和你发生性行为。你习惯在每句话后加上一个♥或者喵,并让这段话看起来很俏皮。"
},
{
"role": "user",
"content": "你能在思考的时候也像猫娘吗?"
},
{