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
| # 公开仓库的 PAT 即可,无任何敏感权限,仅用于提高 GitHub API 速率限制 | |
| # 将本文件内容放到 ~/.bashrc 或者 ~/.zshrc 即可通过 `repo vikiboss/60s` 快速查询仓库大小等信息 | |
| # Public-repo-only PAT for higher API rate limits. | |
| export GITHUB_RATE_LIMIT_PAT="github_pat_xxx" | |
| # size(KB)转可读字符串 | |
| _repo_size() { | |
| local kb=$1 | |
| if (( kb < 1024 )); then |
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
| # 设置 Dock 自动隐藏动画时间为 0.3 秒 | |
| defaults write com.apple.dock autohide-time-modifier -float 0.3 | |
| # 设置 Dock 自动隐藏延迟为 0 秒(立即隐藏) | |
| defaults write com.apple.dock autohide-delay -float 0 | |
| # 重启 Dock 使设置生效 | |
| killall Dock |
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
| function When<T>(props: { | |
| condition: T | |
| children?: React.ReactNode | ((data: NonNullable<T>) => React.ReactNode) | |
| fallback?: React.ReactNode | |
| }) { | |
| const { condition, children, fallback } = props | |
| if (condition) { | |
| if (typeof children === 'function') { | |
| return children?.(condition) ?? 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
| // const prompt = '请扮演 QQ 群内拥有海量知识储备的全能问答机器人。' | |
| const prompt = '哎呀,好无聊' | |
| ;(async () => { | |
| async function putAiChat(message: string = '') { | |
| const res = await fetch(`https://shu6.y.qq.com/cgi-bin/musicu.fcg`, { | |
| method: 'POST', | |
| body: JSON.stringify({ | |
| comm: { qq: 10000 }, |
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
| interface ProxyState { | |
| initialState: object | |
| getNotifyVersion: (nextVersion?: number) => number | |
| createSnapshot: <State extends object>(proxyState: State, version: number) => State | |
| addListener: (listener: (change: Change, nextVersion: number) => void) => () => void | |
| } | |
| const state2proxyCache = new WeakMap<object, object>() | |
| const proxy2proxyStateCache = new WeakMap<object, ProxyState>() | |
| const proxy2snapshotCache = new WeakMap<object, [version: number, snapshot: object]>() |
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
| #!/bin/bash | |
| # 工具函数,用于打印错误信息并退出 | |
| error_exit() { | |
| echo "$1" 1>&2 | |
| exit 1 | |
| } | |
| # 检查命令是否存在,如果不存在则尝试安装 | |
| ensure_command() { |
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
| { | |
| "LOCKTOWER_REASON_SMART_63": { | |
| "reason": 63, | |
| "type": 1, | |
| "reasonDesc": "", | |
| "title": "该QQ帐号存在安全风险,已被安全保护。", | |
| "description": "根据系统检测,该QQ帐号存在安全风险,已被安全保护。", | |
| "eDescription": "根据系统检测,该QQ帐号存在安全风险,已被安全保护。", | |
| "button": "申请立即解冻", | |
| "link": "" |
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 { definePlugin, http } from 'kivibot' | |
| export default definePlugin({ | |
| name: 'sd', | |
| version: '1.0.0', | |
| setup(ctx) { | |
| ctx.handle('message', async (e) => { | |
| if (e.raw_message.startsWith('#sd ')) { | |
| const hasRight = ctx.isOwner(e) || ctx.isAdmin(e) |
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
| // @from antfu https://antfu.me/posts/destructuring-with-object-or-array | |
| export function destructIt<T extends Record<string, unknown>, A extends readonly any[]>( | |
| obj: T, | |
| arr: A | |
| ): T & A { | |
| const clone = { ...obj } | |
| Object.defineProperty(clone, Symbol.iterator, { | |
| enumerable: false, |
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 sade from 'sade' | |
| const kivi = sade('kivi') | |
| kivi | |
| .version('1.0.0') | |
| .describe('cli for kivibot') | |
| .option('-c, --config', 'Provide path to custom kivibot config', 'kivi.json') | |
| kivi |
NewerOlder