一键删除所有微博。
This file contains 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 function parseCsv(input: string, delimiter = ',') { | |
const scanQuoteEnd = (i: number) => { | |
for (; i < input.length; i = 1) { | |
const c = input[i]; | |
if (c === '"') { | |
if (input[i 1] === '"') i = 1; | |
else break; | |
} | |
} | |
if (!input[i]) throw new Error('Quote is expected'); |
This file contains 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
// See https://github.com/gera2ld/js-lib |
This file contains 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
expected=( | |
# paste packages to keep here | |
aria2 | |
deno | |
fzf | |
yarn | |
) | |
brew_clean() { | |
while |
markmap | |||
---|---|---|---|
|
- katex
$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
$\ce{N2 3H2 ->[Fe] 2NH3}$
This file contains 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 fsPromises = require('fs').promises; | |
const puppeteer = require('puppeteer'); | |
async function main() { | |
const browser = await puppeteer.launch({ | |
headless: true, | |
args: ['--proxy-server=socks5://127.0.0.1:2020'], | |
}); | |
const page = await browser.newPage(); | |
await page.goto('https://gera2ld.space', { waitUntil: 'networkidle0' }); |
This file contains 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
function getConverter(showdown) { | |
showdown.setFlavor('github'); | |
showdown.subParser('runExtension', (ext, source, options, globals) => { | |
let text = source; | |
if (ext.filter) { | |
text = ext.filter(text, globals.converter, options, globals); | |
} | |
return text; | |
}); | |
return new showdown.Converter({ |
This file contains 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 { Readable } = require('stream'); | |
const tar = require('tar'); | |
export function string2stream(stringOrBuffer) { | |
const reader = new Readable(); | |
reader.push(stringOrBuffer); | |
reader.push(null); | |
return reader; | |
} |
This file contains 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
import { Readable } from 'stream'; | |
export function string2stream(stringOrBuffer) { | |
const reader = new Readable(); | |
reader.push(stringOrBuffer); | |
reader.push(null); | |
return reader; | |
} | |
export function stream2buffer(stream) { |
This file contains 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 test script | |
// @namespace Violentmonkey Scripts | |
// @icon https://cn.gravatar.com/avatar/a0ad718d86d21262ccd6ff271ece08a3?s=80 | |
// @homepage https://gist.github.com/gera2ld/1c14672b77ade31ad8f0984725de18fc | |
// @resource baidu https://www.baidu.com/img/baidu_jgylogo3.gif | |
// @resource text data:text/plain,hello,world | |
// @resource mochaCss https://cdn.jsdelivr.net/npm/[email protected]/mocha.min.css | |
// @resource cjk https://cdn.jsdelivr.net/gh/intellilab/translator.user.js/README.md | |
// @run-at document-start |