Skip to content

Instantly share code, notes, and snippets.

View ZiuChen's full-sized avatar
🎯
Focusing

Ziu ZiuChen

🎯
Focusing
View GitHub Profile
@ZiuChen
ZiuChen / extract-source-from-source-map.ts
Created February 28, 2025 08:31 — forked from banyudu/extract-source-from-source-map.ts
Extract source code from source map
#!/usr/bin/env ts-node
import * as fs from 'fs'
import * as path from 'path'
import { promisify } from 'util'
import { SourceMapConsumer } from 'source-map'
const writeFile = promisify(fs.writeFile)
const mapFile = process.argv[2]
@ZiuChen
ZiuChen / base64.js
Created June 4, 2022 02:40
NodeJS: Save base64 image to disk
// Save base64 image to disk
try {
// Decoding base-64 image
// Source: http://stackoverflow.com/questions/20267939/nodejs-write-base64-image-file
function decodeBase64Image(dataString) {
var matches = dataString.match(/^data:([A-Za-z-+\/]+);base64,(.+)$/);
var response = {};
if (matches.length !== 3) {
return new Error('Invalid input string');
@ZiuChen
ZiuChen / bili-auto-judgement.user.js
Last active May 17, 2022 00:24
全自动风纪委
// ==UserScript==
// @name 全自动风纪委
// @description 进入评价界面自动开始提交风纪委评价
// @namespace http://tampermonkey.net
// @supportURL https://github.com/ZiuChen/userscript
// @version 0.5
// @author ZiuChen
// @updateURL https://cdn.jsdelivr.net/gh/ZiuChen/userscript@main/scripts/bili-auto-judgement.user.js
// @downloadURL https://cdn.jsdelivr.net/gh/ZiuChen/userscript@main/scripts/bili-auto-judgement.user.js
// @match https://www.bilibili.com/judgement/*