Skip to content

Instantly share code, notes, and snippets.

View AngusFu's full-sized avatar
🎯
Focusing

文蔺 AngusFu

🎯
Focusing
View GitHub Profile
zhangxinxu.com##body>:not(div)
time.geekbang.org##[class*="RichContentFootImg"]
time.geekbang.org##[class*="AudioPlayerPC"]
time.geekbang.org##.leads-wrapper
@AngusFu
AngusFu / uploader.ts
Created April 19, 2022 08:46
Upload Tasks
export class Uploader<FileData, UploadResponse> {
private tasks: ITask<FileData, UploadResponse>[] = [];
constructor(public options: UploadOptions<FileData, UploadResponse>) {}
private async uploadWithRetry(task: ITask<FileData, UploadResponse>) {
let index = 0;
const {
file,
deferred: { resolve, reject },
@AngusFu
AngusFu / tianya.user.js
Last active September 14, 2021 08:59
tianya-cleaner
// ==UserScript==
// @name 天涯神贴
// @namespace https://gist.github.com/AngusFu/7e5bbe226ee66177faa17d48e4a69a64
// @version 0.3
// @description try to take over the world!
// @author You
// @match https://bbs.tianya.cn/m/post-*
// @icon https://www.google.com/s2/favicons?domain=tianya.cn
// @grant none
// ==/UserScript==
@AngusFu
AngusFu / readonly-breaker.js
Last active September 9, 2021 12:59
只读克星:前端眼里,没有「read only」文档这回事
// 粘贴到 chrome devtool console 中执行
// 使用场景
// 1. 想复制只读文档的内容
// 2. 担心复制内容的行为被公司监听了
function removeAllEvents(event) {
function removeEvent(el, type) {
const listeners = (getEventListeners(el)[type] || []);
el[`on${type}`.toLowerCase()] = null;
@AngusFu
AngusFu / mdnice-weekly-util.user.js
Last active September 10, 2021 11:16
周刊排版助手
// ==UserScript==
// @name 周刊排版助手
// @namespace https://gist.github.com/AngusFu/fe7be4676453cb12afd75851bf32af32
// @version 0.2
// @description try to take over the world!
// @author wemlion
// @match https://editor.mdnice.com/*
// @icon https://www.google.com/s2/favicons?domain=mdnice.com
// @grant none
// ==/UserScript==
@AngusFu
AngusFu / abc.md
Last active March 20, 2023 02:46
声享 ppt 备份(导出 html 文件)


class A {
x = 1;
}
class B {
y = 2;
}
class C {
z = 3;
}
const addListener = HTMLElement.prototype.addEventListener
const removeListener = HTMLElement.prototype.removeEventListener
// click:stop:prevent
HTMLElement.prototype.addEventListener = function (name, handler, option) {
const re = /:(stop|prevent)$/
const opt = {}
while (true) {
let n = name.replace(re, '')
--r: 1;
--g: 213;
--b: 103;
--percent: 0.1;
--r1: calc(var(--r) + (255 - var(--r)) * var(--percent));
--g1: calc(var(--g) + (255 - var(--g)) * var(--percent));
--b1: calc(var(--b) + (255 - var(--b)) * var(--percent));