This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zhangxinxu.com##body>:not(div) | |
time.geekbang.org##[class*="RichContentFootImg"] | |
time.geekbang.org##[class*="AudioPlayerPC"] | |
time.geekbang.org##.leads-wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 粘贴到 chrome devtool console 中执行 | |
// 使用场景 | |
// 1. 想复制只读文档的内容 | |
// 2. 担心复制内容的行为被公司监听了 | |
function removeAllEvents(event) { | |
function removeEvent(el, type) { | |
const listeners = (getEventListeners(el)[type] || []); | |
el[`on${type}`.toLowerCase()] = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
x = 1; | |
} | |
class B { | |
y = 2; | |
} | |
class C { | |
z = 3; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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)); |
NewerOlder