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
[tools."http:jaeger"] | |
# single authoritative version for every OS/arch | |
version = "2.8.0" | |
[tools."http:jaeger".platforms] | |
macos-x64 = { url = "https://download.jaegertracing.io/v1.71.0/jaeger-2.8.0-darwin-amd64.tar.gz" } | |
macos-arm64 = { url = "https://download.jaegertracing.io/v1.71.0/jaeger-2.8.0-darwin-arm64.tar.gz" } | |
linux-x64 = { url = "https://download.jaegertracing.io/v1.71.0/jaeger-2.8.0-linux-amd64.tar.gz" } | |
[tasks.start-jaeger] |
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
// ============================================================================ | |
// PACKAGE VERSIONS (2025-07-30) | |
// ============================================================================ | |
// | |
// Dependencies: | |
// - effect: 3.17.3 | |
// - @effect/platform: 0.90.0 | |
// - @effect/rpc: 0.68.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
import { FetchHttpClient, HttpClient, HttpClientRequest } from "@effect/platform"; | |
import { RpcResolver, type RpcRouter } from "@effect/rpc"; | |
import { HttpRpcResolver } from "@effect/rpc-http"; | |
import type { AppRouter, JWTAccessToken, OrgID } from "@phosphor/server"; | |
import { type UseMutationOptions, type UseQueryOptions, useMutation, useQuery } from "@tanstack/react-query"; | |
import { Effect, flow, identity, pipe } from "effect"; | |
import { Option } from "effect"; | |
import type * as EffectRequest from "effect/Request"; | |
import type { FiberFailure } from "effect/Runtime"; | |
import React from "react"; |
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
/** | |
* FNV-1a 32-bit hash – fast, non-cryptographic, browser-safe. | |
* Sufficient for generating repeatable fragment keys. | |
*/ | |
export const fnv1aHash32 = (str: string): string => { | |
let h = 0x811c9dc5; // FNV offset basis | |
for (let i = 0; i < str.length; i++) { | |
h ^= str.charCodeAt(i); | |
h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24); | |
} |
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
export const OrgResource = RBAC.defineResource({ | |
name: dev`Organization`, | |
idSchema: OrgID, | |
permissions: { | |
CreateWorkspace: (its) => its.Member, | |
}, | |
roles: { | |
Admin: true, | |
Member: true, | |
Guest: 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 { DevError, debounce } from "@project/prelude"; | |
export class LoopError extends DevError { | |
constructor( | |
message: string, | |
public readonly debounceMs: number, | |
public readonly maxCount: number, | |
) { | |
super(`${message} (exceeded ${maxCount} calls in ${(debounceMs * 0.001).toFixed(1)}s)`); | |
} |
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
export class MapOrSetDefault<K, T> extends Map<K, T> { | |
#setDefault(key: K): T { | |
const val = this.getDefault(key); | |
this.set(key, val); | |
return val; | |
} | |
constructor(public getDefault: (key: K) => T) { | |
super(); | |
} |
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
export function downloadFileBinary(filename: string, data: Uint8Array, mimeType = "application/octet-stream") { | |
const blob = new Blob([data], { type: mimeType }); | |
const url = URL.createObjectURL(blob); | |
const a = document.createElement("a"); | |
a.href = url; | |
a.download = filename; | |
a.click(); | |
URL.revokeObjectURL(url); | |
} |
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 { useEffect } from "react"; | |
import { listen } from "./zlisten"; | |
/** For when you want to do something without breaking the focus of the active element */ | |
export const useClickByHoverToAvoidChangingFocus = (element: HTMLElement | null | undefined, callback: null | undefined | (() => void)) => { | |
useEffect(() => { | |
if (!element || !callback) return; | |
let openTimeout: (Animation | any)[] = []; | |
const DURATION = 1000; |
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
type Fn<T, U> = (t: T) => U | null | undefined; | |
/** like pipe, but returns early if any of the functions return a nullish value */ | |
export function pipeNonNull<A, B>(a: A, b: Fn<A, B>): B | null | undefined; | |
export function pipeNonNull<A, B, C>(a: A, b: Fn<A, B>, c: Fn<B, C>): C | null | undefined; | |
export function pipeNonNull<A, B, C, D>(a: A, b: Fn<A, B>, c: Fn<B, C>, d: Fn<C, D>): D | null | undefined; | |
export function pipeNonNull<A, B, C, D, E>(a: A, b: Fn<A, B>, c: Fn<B, C>, d: Fn<C, D>, e: Fn<D, E>): E | null | undefined; | |
export function pipeNonNull<A, B, C, D, E, F>( | |
a: A, | |
b: Fn<A, B>, | |
c: Fn<B, C>, |
NewerOlder