使用 Shadowrocket 代理,并添加以下规则
DOMAIN-SUFFIX,lookup-api.apple.com,PROXY
| import FFT from "fft.js"; | |
| const getColumns = (d: number[][], cs: number[]) => { | |
| const res: number[] = []; | |
| for (let i = 0; i < d.length; ++i) { | |
| const r = d[i]; | |
| res.push(...cs.map((x) => r[x])); | |
| } | |
| return res; | |
| }; |
| # Taken from https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore.yaml | |
| openapi: "3.0.0" | |
| info: | |
| version: 1.0.0 | |
| title: Swagger Petstore | |
| license: | |
| name: MIT | |
| servers: | |
| - url: https://petstore.swagger.io/v1 |
使用 Shadowrocket 代理,并添加以下规则
DOMAIN-SUFFIX,lookup-api.apple.com,PROXY
| export const getImageData = (image: HTMLImageElement) => { | |
| const canvas = document.createElement('canvas'); | |
| const ctx = canvas.getContext('2d') as CanvasRenderingContext2D; | |
| const width = image.width; | |
| const height = image.height; | |
| if (width === 0 || height === 0) throw new Error('image dimensions cannot be zero'); | |
| canvas.width = width; | |
| canvas.height = height; |
| /** | |
| * Returns SHA-256 hash from supplied message. | |
| * | |
| * @param {String} message. | |
| * @returns {String} hash as hex string. | |
| * | |
| * @example | |
| * sha256('abc').then(hash => console.log(hash)); | |
| * const hash = await sha256('abc'); | |
| */ |
| import fs from 'fs' | |
| import glob from 'glob' | |
| import cliProgress from 'cli-progress' | |
| import getThemeColor from './main' | |
| import ProHub from './prohub' | |
| const [path] = process.argv.slice(2) | |
| const bar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic) | |
| glob(path, function (err, matches) { |
| 描述 | 扩展名 | Magic Number |
|---|---|---|
| Adobe Illustrator | .ai | 25 50 44 46 [%PDF] |
| Bitmap graphic | .bmp | 42 4D [BM] |
| Class File | .class | CA FE BA BE |
| JPEG graphic file | .jpg | FF D8 |
| JPEG 2000 graphic file | .jp2 | 0000000C6A5020200D0A [....jP..] |
| 描述 | 扩展名 | Magic Number | |
|---|---|---|---|
| Adobe Illustrator | .ai | 25 50 44 46 [%PDF] | |
| Bitmap graphic | .bmp | 42 4D [BM] | |
| Class File | .class | CA FE BA BE | |
| JPEG graphic file | .jpg | FF D8 | |
| JPEG 2000 graphic file | .jp2 | 0 |
| type Job<T> = () => Promise<T> | |
| export const promiseThrottle = async <T>( | |
| jobs: Job<T>[], | |
| parallelCount: number, | |
| onParallelDone?: (results: T[], index: number) => void | |
| ): Promise<T[]> => { | |
| if (!(jobs && Array.isArray(jobs))) { | |
| return Promise.reject('jobs must be Array') | |
| } |
| import * as crypto from 'crypto' | |
| const HMAC_ALGORITHM = 'HmacSHA1' | |
| const ekey = Buffer.from('9527') | |
| const ikey = Buffer.from('2840') | |
| const mergeBytes = (...args: Uint8Array[]) => { | |
| return Buffer.concat(args) | |
| } |