Skip to content

Instantly share code, notes, and snippets.

View alexzhang1030's full-sized avatar
🎯
Focusing

Alex alexzhang1030

🎯
Focusing
View GitHub Profile
@alexzhang1030
alexzhang1030 / webrtc-note-draft.md
Last active June 13, 2024 03:21
WebRTC Note Draft

WebRTC

目前仅存储有关 DataChannel 的信息

通信模型

在进行 WebRTC 通信时,节点间会按照如下顺序获取对方的地址:

  • 如果双端在同一个内网,直接用内网IP通信;
  • 通过 STUN 服务器,为双端构造可以直接访问的地址,打造一条可以穿透 NAT 的通路,俗称“打洞”;
@alexzhang1030
alexzhang1030 / tsup.config.ts
Created June 18, 2024 01:31
Custom bundle vue with treeshake
import { resolve } from 'node:path'
import { defineConfig } from 'tsup'
export default defineConfig({
entryPoints: [
'src/index.ts',
],
noExternal: ['vue'],
clean: true,
format: ['esm', 'cjs'],
@alexzhang1030
alexzhang1030 / new-log.sql
Last active June 26, 2024 10:54
Debug reactivity
--- Currnet:
--- pauseSheduleStack 是在 resetScheduling 中 console.log(pauseScheduleStack)
--- 看样子是因为引起了递归
---pauseScheduleStack--- 0
---pauseScheduleStack--- 0
@alexzhang1030
alexzhang1030 / capabilities.txt
Created March 10, 2025 02:39 — forked from jlia0/agent loop
Manus tools and prompts
# Manus AI Assistant Capabilities
## Overview
I am an AI assistant designed to help users with a wide range of tasks using various tools and capabilities. This document provides a more detailed overview of what I can do while respecting proprietary information boundaries.
## General Capabilities
### Information Processing
- Answering questions on diverse topics using available information
- Conducting research through web searches and data analysis
@alexzhang1030
alexzhang1030 / index.ts
Created April 17, 2025 02:27
TRPC w/ Query, fullstack chat streaming
// 1. fe
import { experimental_streamedQuery as streamedQuery, useQuery } from '@tanstack/vue-query'
const { data: messagesStreamData, fetchStatus: streamFetchStatus } = useQuery({
queryKey: ['chatting'],
queryFn: streamedQuery({
queryFn: () => {
const machina = new Machina<string>()
$trpc.chat.chat.subscribe({
content: currentConversationData.value!.userAsk,