Skip to content

Instantly share code, notes, and snippets.

View unnoq's full-sized avatar

unnoq

View GitHub Profile
@unnoq
unnoq / highlight.ts
Last active May 31, 2024 09:55
tiptap
import { clone } from 'radash';
import type { JSONContent } from '@tiptap/core';
export function highlightContent(content: JSONContent[], words: string[]) {
let i = 0;
const result: JSONContent[] = [];
while (i < content.length) {
const child = content[i]!;
@unnoq
unnoq / server.ts
Last active June 15, 2024 07:50
better-fetch
import { honoRouter } from '@api-node/lib/hono';
import { zValidator } from '@hono/zod-validator';
import { Dispatcher, ProxyAgent } from 'undici';
import { z } from 'zod';
export const betterFetchRouter = honoRouter.all(
'/',
zValidator(
'header',
z.object({
@unnoq
unnoq / index.ts
Created June 17, 2024 02:00
zyte
‎‎​