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 | |
| # 配置:定义仓库路径,格式为 "路径|分支|命令" | |
| # - 分支:可选。指定要拉取的分支,如 "main" 或 "develop"。留空则使用当前检出的分支。 | |
| # - 命令:可选。pull 成功后执行的命令。 | |
| # | |
| # 示例: | |
| # "path/to/repo|main|npm install" -> 强制 main 分支,执行 npm install | |
| # "path/to/repo||npm install" -> 跟随当前分支,执行 npm install | |
| # "path/to/repo|develop" -> 强制 develop 分支,无后续命令 |
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
| /** | |
| * GitLab 贡献热力图生成器 (Contribution Graph) | |
| * | |
| * 1. 必填配置:修改下方 `GITLAB_CONFIG` (GitLab地址, Token, 目标用户)。 | |
| * 2. 运行脚本:node gitlab-contribution.js | |
| * // or envx run -f .env -- node gitlab-contribution.js | |
| */ | |
| const http = require('http'); |
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 http = require('http'); | |
| let lastPostData = ''; | |
| const clients = new Set(); | |
| const server = http.createServer((req, res) => { | |
| if (req.method === 'POST' && req.url.startsWith('/')) { | |
| // 解析 query 参数 interval | |
| const url = require('url'); | |
| const parsedUrl = url.parse(req.url, true); |
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 { Button, ConfigProvider, Modal } from "antd"; | |
| import React, { useEffect, useState } from "react"; | |
| import 'animate.css'; | |
| import clsx from "clsx"; | |
| // 动画持续时间 | |
| const ENTRY_DURATION = 800; | |
| const EXIT_DURATION = 600; | |
| const App = () => { |
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, { useRef, useState, useContext, createContext, useCallback, useMemo } from "react"; | |
| import { useInView } from "react-intersection-observer"; | |
| // 1. Create a single context to hold everything | |
| type SpyContextValue = { | |
| root: HTMLElement | null; | |
| onRatioChange: (key: string, ratio: number) => void; | |
| }; | |
| const SpyContext = createContext<SpyContextValue>({ |
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 | |
| # nvm-clean-major: 清理 nvm 已安装 Node.js 版本,只保留每个 major 版本的最新版本 | |
| # 仅在 macOS + bash 环境下测试通过 | |
| RED="\033[31;1m" | |
| GREEN="\033[32;1m" | |
| YELLOW="\033[33;1m" | |
| RESET="\033[0m" | |
| function clean_nvm_versions() { |
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
| <!DOCTYPE html> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>全球时区对照工具</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> | |
| <style> | |
| * { | |
| margin: 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
| const tmp = require('tmp'); | |
| const fse = require('fs-extra'); | |
| const path = require('path'); | |
| const dir = tmp.dirSync({ | |
| prefix: path.basename(path.dirname(__filename)) | |
| }); | |
| console.log(`Temporary directory created: ${dir.name}`); |
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
| /** | |
| * 集合操作工具类 | |
| * 支持排列、组合、笛卡尔积和全排列操作 | |
| */ | |
| class CombinatoricsKit<T> { | |
| private elements: T[]; | |
| // #region 构造函数 | |
| /** | |
| * 构造函数 |
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 { Typography, List, theme, Slider, Space, InputNumber, message } from "antd"; | |
| import { FastColor } from "@ant-design/fast-color"; | |
| import { createGlobalStyle, ThemeProvider, type ThemeMode, createStyles } from "antd-style"; | |
| import { NuqsAdapter } from "nuqs/adapters/react"; | |
| import type { PropsWithChildren } from "react"; | |
| import { parseAsStringEnum, useQueryState, parseAsInteger } from "nuqs"; | |
| export const setupInstructions = ` | |
| # Create a new directory for your project | |
| mkdir hi-antd-token && cd hi-antd-token |
NewerOlder