Skip to content

Instantly share code, notes, and snippets.

View Cozy228's full-sized avatar

Cozy Cozy228

View GitHub Profile
你现在是一个前端/React/TypeScript 代码改造助手,目标很明确:
把“纯 `<pre>` 渲染的 ASCII 文本面板”改造成:
1)支持带颜色的数值变量,
2)仍然完全不破坏 ASCII 布局(边框不位移、对齐不乱),
3)数据和模板分离。
请严格按下面步骤和约束修改代码。
--------------------
@Cozy228
Cozy228 / a
Last active November 12, 2025 09:57
gsap
// src/App.tsx
// 修复:FULL_HOLD 段视觉“完全静止”——在 holdStart~holdEnd 期间强制钳制到全屏几何与内容底部位移
import React, { useLayoutEffect, useRef } from "react";
import "./app.css";
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useLenisGsap } from "./hooks/useLenisGsap";
import { IS_DEV } from "./utils/env";
import FpsHud from "./components/FpsHud";
import Card, { type CardData } from "./components/Card";
@Cozy228
Cozy228 / aielements.json
Last active August 27, 2025 09:31
aielements.json
{"$schema":"https://ui.shadcn.com/schema/registry.json","name":"ai-elements","homepage":"https://registry.ai-sdk.dev/elements","items":[{"name":"actions","type":"registry:component","title":"Actions","description":"AI-powered actions component.","files":[{"path":"registry/default/ai-elements/actions.tsx","type":"registry:component"}]},{"name":"branch","type":"registry:component","title":"Branch","description":"AI-powered branch component.","files":[{"path":"registry/default/ai-elements/branch.tsx","type":"registry:component"}]},{"name":"code-block","type":"registry:component","title":"Code Block","description":"AI-powered code block component.","files":[{"path":"registry/default/ai-elements/code-block.tsx","type":"registry:component"}]},{"name":"conversation","type":"registry:component","title":"Conversation","description":"AI-powered conversation component.","files":[{"path":"registry/default/ai-elements/conversation.tsx","type":"registry:component"}]},{"name":"image","type":"registry:component","title":"Ima

升级前必看:

  1. 以下任何数据均为个人体验,你可能花费的时间更少。
  2. 备份任何重要文件到 Box 或者 onedrive。
  3. 不要在家升级。
  4. 我的整个升级过程(指点下弹框的开始按钮到成功进入系统)大约需要耗费 6-7 小时,数次重启,请保持笔记本全程插电,连接公司网络,并且期间有 5 小时完全不能使用电脑,请合理安排。
  5. 确保你的 C 盘有足够的空间,我的剩余空间大于 100G,升级完之后还多了几十 G。
  6. Teams 上建议挂一个 Windows 11 upgrading 的状态防止失联。
  7. 如果任意步骤失败或者完全不符合描述请及时找 IT 大神帮忙,需要清空 C 盘重新安装,此时你已经没机会备份了。
  8. 下面的每一条也是必看,等你开始也没机会再看了。

Process Flow Breakdown

  1. Human Account & Initial Setup:

    • A Human Account is the starting point.
    • This account needs to create an Application and its corresponding Client ID & Client Secret. This is done via the APIGateway.
      • Onboarding Guide for App/Client ID creation: Refer to xxx
    • The permissions and roles associated with this Human Account (including those needed for consuming APIs and potentially for managing knowledge bases) are managed and approved in Sailpoint.
  2. Client Applications (Backstage Chatbot / Document Upload Pipeline):

  • Both Backstage Chatbot and the Document Upload Pipeline act as client applications.
// components/ChatHistorySidebar/ChatHistorySidebar.tsx
import React, { useState, useEffect, useCallback, ChangeEvent } from 'react'; // Added ChangeEvent
import {
List,
ListItem,
ListItemText,
ListItemSecondaryAction,
IconButton,
Button,
Box,

Backstage Dev Container (Yarn 4, 无 Dockerfile)

本设置包含 Backstage 应用、PostgreSQL 数据库和配置了自签名 SSL 证书的 Nginx 反向代理。使用 Yarn 4 作为包管理器,并且不依赖自定义的 Dockerfile。

1. 初始化步骤 (首次设置需执行)

在启动 Dev Container 之前,请在你的项目根目录下执行以下命令来创建 Nginx 所需的 SSL 证书。

创建证书目录:

// components/ChatPage/ChatPage.tsx (or appropriate path)
import React, { useState, useCallback } from 'react';
import { Grid, Paper, makeStyles } from '@material-ui/core';
import { ChatHistorySidebar } from '../ChatHistorySidebar'; // Adjust path as needed
import { ChatWindow } from '../ChatWindow'; // Adjust path as needed
// Optional: Custom styles for consistent height and layout
const useStyles = makeStyles((theme) => ({
container: {

Workflow Management Tools: A Comprehensive Comparison

Workflow management tools are critical for automating and orchestrating tasks across data pipelines, machine learning (ML) workflows, and general business processes. This guide compares nine popular open-source tools—Airflow, n8n, Activepieces, Argo Workflow, Dagu, Flyte, Inngest, Kestra, and Prefect—highlighting their use cases, ease of use, scalability, and more, all formatted in Markdown for easy navigation.

Overview of Tools

Each tool serves distinct needs, from data orchestration to no-code automation. Below is a breakdown to help you choose the right one.

Use Cases and Suitability

import getpass
import os
import logging
import pandas as pd
import numpy as np
import plotly.graph_objects as go
from datasets import Dataset
from ragas import evaluate
from ragas.metrics import (
context_precision,