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 { escape } = require('mysql') | |
| function escapeValue(value) { return escape(value) } | |
| function escapeName(name) { return '`' + name + '`'; } | |
| // ================ export ================ | |
| function $limit(nu) { | |
| return `LIMIT ${escapeValue(nu)}` |
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 { template } = require('./template') | |
| function setEnv(env, paris) { | |
| for (const [name, value] of Object.entries(paris)) { | |
| let get | |
| if (typeof value === 'string') { |
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 function throttle<R>(func: () => Promise<R>): () => Promise<R> { | |
| let promise: Promise<R> | null = null | |
| return () => { | |
| if (promise) { | |
| return promise | |
| } else { | |
| promise = func() | |
| promise.finally(() => promise = null) | |
| return promise | |
| } |
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
| /* eslint-disable */ | |
| /* | |
| 一套基于 postMessage 的页面间通讯协议 | |
| */ | |
| /* | |
| interface Request { | |
| id: number | |
| type: 'req' |
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
| type BaseEventMap = { [event: string]: [] } | |
| type EventListener<EventMap extends BaseEventMap, Event extends keyof EventMap> | |
| = (...args: EventMap[Event]) => any | |
| type EventListenerItem<EventMap extends BaseEventMap, Event extends keyof EventMap> = { | |
| once: boolean | |
| listener: EventListener<EventMap, Event> | |
| } |
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
| import React, { PureComponent, createRef } from 'react'; | |
| /** | |
| * @class ExtendClickArea | |
| * @argument {PureComponent<{ extend: number, center: boolean }>} | |
| * @description 用来自动扩展按钮的点击区域 | |
| **/ | |
| export default class ExtendClickArea extends PureComponent { | |
| /** @type {{ width: number, height: number }} */ | |
| state = { width: 0, height: 0 }; |
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
| /** | |
| * @fileoverview | |
| * - Using the 'QRCode for Javascript library' | |
| * - Fixed dataset of 'QRCode for Javascript library' for support full-spec. | |
| * - this library has no dependencies. | |
| * | |
| * @author davidshimjs | |
| * @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> | |
| * @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> | |
| */ |
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 lark-doc-lock | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://bytedance.feishu.cn/* | |
| // @require https://github.com/bramblex/MonkeyBox/raw/master/monkey-box.user.js | |
| // ==/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
| import React, { createContext, useContext, useEffect } from 'react'; | |
| import './App.css'; | |
| interface LogData { | |
| [key: string]: number | string; | |
| } | |
| interface LogLayerData { | |
| name?: string; | |
| log: LogData; | |
| } |
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 acorn = require("acorn"); | |
| const astring = require("astring"); | |
| const estraverse = require("estraverse"); | |
| function withCancel(func) { | |
| const signalName = "__$isCancel__"; | |
| const shouldCancelName = "__$shouldCancel__"; | |
| function transform(node) { | |
| return estraverse.replace(node, { |