Skip to content

Instantly share code, notes, and snippets.

View ChenYFan's full-sized avatar

CyanFalse ChenYFan

View GitHub Profile
! wget https://raw.githubusercontent.com/ChenYFan/GoogleColabRDP/main/install.sh &> /dev/null
! chmod +x install.sh
! ./install.sh
@ChenYFan
ChenYFan / index.js
Last active February 25, 2021 06:06
ChenYFanのAPI部分开源
function getJsonLength(jsonData) {
var jsonLength = 0;
for (var item in jsonData) {
jsonLength++;
}
return jsonLength;
}
async function handleRequest(request) {
const req = request
const urlStr = req.url
@ChenYFan
ChenYFan / index.js
Last active March 12, 2021 07:53
CloudFlare无服务器学历验证
/*两个密码子,建议手滚键盘*/
const privatek = ""
const privatepass = ""
/*前端处理区域,将征用三个目录*/
if (rp(path) == "/getaccesstoken" || rp(path) == "/getcap" || rp(path) == '/getcapimg') {
try { await JSON.parse(Decrypt(urlObj.searchParams.get('refreshtoken'), privatek)) } catch (e) { return returnc(0) }
const RToken = urlObj.searchParams.get('refreshtoken')
const _RT = await JSON.parse(Decrypt(RToken, privatek))
if (checktime(_RT)) {
if (await checkban(RToken, privatek)) {
@ChenYFan
ChenYFan / WAFKV.js
Last active March 24, 2021 11:39
将WAF当作KV来存
const WAFKV = {
GET: async function (key) {
let item;
let filters = await WAFKV.FILTERS()
let result = (await filters.json()).result
for (let i = 0; i < result.length; i++) {
if (result[i].id && result[i].id == RULEID) {
item = result[i]
break
}
@ChenYFan
ChenYFan / hostlocavatar.user.js
Created May 2, 2021 07:52
hostloc论坛头像上传非flash修正版本
// ==UserScript==
// @name Discuz论坛头像上传助手
// @author 枫谷剑仙
// @description 突破图片尺寸、GIF帧数限制,无损上传
// @version 2.0.6
// @namespace http://www.mapaler.com/
// @include */home.php?mod=spacecp&ac=avatar*
// @icon https://gitee.com/ComsenzDiscuz/DiscuzX/raw/master/upload/uc_server/images/noavatar_small.gif
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
import sw2express from "sw2express";
import * as customPage from "./sw2express.customDefaultPage.js";
const app = new sw2express();
app.extend(customPage.default);
app.use(async(req,rep)=>{
const statusCode = req.path.replace("/", "");
if (!isNaN(statusCode) && customPage.codeAlternative[statusCode] !== undefined) {
console.log(statusCode);
await customPage.getPage({
statusCode: statusCode,
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 292 155.125" clip-path="url(#clip)" width="512" height="272"><defs><clipPath id="clip" clipPathUnits="objectBoundingBox"><rect x="0" y="0" width="292" height="155.125"/></clipPath></defs><rect x="0" y="0" width="292" height="155.125" fill="rgb(111, 75, 76)"/><path d="M52,-12L259,-12L259,65L52,65Z" fill="rgb(247, 151, 100)" fill-opacity="0.83"/><path d="M-5,79L259,79L259,155L-5,155Z" fill="rgb(43, 0, 61)" fill-opacity="0.56"/><path d="M91,58L172,58L172,94L91,94Z" fill="rgb(255, 77, 94)" fill-opacity="0.43"/><path d="M205,50L313,50L313,160L205,160Z" fill="rgb(0, 0, 28)" fill-opacity="0.45"/><path d="M-18,-4L41,-4L41,161L-18,161Z" fill="rgb(20, 21, 31)" fill-opacity="0.71"/><ellipse cx="129" cy="142" rx="28" ry="21" fill="rgb(219, 56, 147)" fill-opacity="0.48"/><ellipse cx="287" cy="12" rx="9" ry="21" fill="rgb(255, 210, 131)" fill-opacity="0.60"/><path d="M141,40L251,40L251,73L141,73Z" fill="rgb(212, 58, 77)" fill-opacity="0.53"/><path d="M45,29L132,29L132,73
name: HexoBlogBuild
on:
- push
jobs:
buildstatic:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
https://cyfan-my.sharepoint.com/:f:/g/personal/chenyfan_cyfan_onmicrosoft_com/ElhO3ZzyxRRMv2bdAjZQBRUBdjocadBtZTN3hPrA0k7YWQ?e=aH0puf
@ChenYFan
ChenYFan / sw.js
Created June 26, 2022 09:46
Fix Wrong Header Support
const buffer = await res.arrayBuffer()
if(urlStr.match(/\.html$/g) || urlStr.match(/\.htm$/g)){
return new Response(buffer,{
status: 200,
headers: {
'Content-Type': 'text/html;chartset=utf-8'
}
})
}else{
return res