This file contains 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
{ lib, stdenv, pkgs ? import <nixpkgs> { } }: | |
let | |
packages = { | |
playwright-chromium = pkgs.callPackage ./playwright-chromium.nix { }; | |
}; | |
rev = "1041"; | |
inherit (pkgs.stdenv.hostPlatform) system; |
This file contains 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 * as msgpack from 'msgpackr' | |
import { OT, pipe, T, Tagged } from './index.js' | |
export const fetchHead = (url: string | URL, headers?: HeadersInit): T.Effect<OT.HasTracer, FetchHeadError, Response> => | |
pipe( | |
T.tryCatchPromise( | |
() => fetch(url as any, { method: 'head', headers }), | |
(error) => new FetchHeadError({ url, error }), | |
), |
This file contains 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 from 'react' | |
const PR = Math.round(window.devicePixelRatio || 1) | |
const FRAME_BAR_WIDTH = 2 | |
export type FPSMeterProps = { | |
width?: number | |
height?: number | |
resolutionInMs?: number |
This file contains 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 from 'react' | |
const PR = Math.round(window.devicePixelRatio || 1) | |
const FRAME_BAR_WIDTH = 2 | |
export type FPSMeterProps = { | |
width?: number | |
height?: number | |
resolutionInMs?: number |
This file contains 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 { type Page, expect, test } from '@playwright/test' | |
test.beforeEach(async ({ page }) => { | |
await page.goto('https://demo.playwright.dev/todomvc') | |
}) | |
const TODO_ITEMS = ['buy some cheese', 'feed the cat', 'book a doctors appointment'] | |
test.describe('New Todo', () => { | |
test('should allow me to add todo items', async ({ page }) => { |
This file contains 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 { Cause, Chunk, Effect as T, Exit as Ex, Managed as M, Option as O, pipe, Queue as Q } from '@effect-ts/core' | |
import * as S from '@effect-ts/core/Effect/Experimental/Stream' | |
import * as CH from '@effect-ts/core/Effect/Experimental/Stream/Channel' | |
export const bufferUpTo = | |
(n: number) => | |
<R, E, A>(stream: S.Stream<R, E, A>) => { | |
const queue = toQueueOfElements_(stream, n) | |
return new S.Stream( |
This file contains 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 { Effect as T, pipe } from '@effect-ts/core' | |
/** Sleeps the specified duration depending on whether the document is hidden or not */ | |
export const sleepBackgroundForegroud = ({ | |
durationHiddenMs, | |
durationVisibleMs, | |
}: { | |
durationHiddenMs: number | |
durationVisibleMs: number | |
}) => { |
This file contains 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 type { Effect as T } from '@effect-ts/core' | |
import { pipe } from '@effect-ts/core' | |
import * as STM from '@effect-ts/core/Effect/Transactional/STM' | |
import * as TRef from '@effect-ts/core/Effect/Transactional/TRef' | |
export * from '@effect-ts/core/Effect/Transactional/STM' | |
export class Gate { | |
constructor(readonly ref: TRef.TRef<boolean>) {} |
This file contains 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
{ rustPlatform | |
, fetchCrate | |
, fetchFromGitHub | |
, lib | |
, stdenv | |
, darwin | |
}: | |
let | |
pname = "tauri-cli"; | |
# https://crates.io/crates/tauri-cli |
This file contains 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 { M, OT, pipe, T } from '@mytunes/utils/effect' | |
import { provideOtelTracer } from '../utils/tracer.js' | |
import { makeWorkerPool } from './worker-pool.js' | |
export const startWorkerPool = () => | |
pipe(startWorkerPool_, OT.withSpan('worker-pool'), provideOtelTracer(), T.runPromise) | |
export const startWorkerPool_ = T.gen(function* ($) { |