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
| # ... | |
| # nix run .#wasm-packages | |
| apps.wasm-packages = { | |
| type = "app"; | |
| program = toString (pkgs.writeShellScript "wasm-packages" '' | |
| ${wasmPackScript { packageName = "somepkg-wasm"; }}/bin/wasmPackScript | |
| ''); | |
| }; |
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 type { Either } from '@mytunes/utils/effect2' | |
| export type HasTag<T = {}> = { _tag: string } & T | |
| // NOTE implementations using `AnyWorkerCodec` might be unsafe | |
| // export type AnyWorkerCodec = WorkerCodec<AnyIWorkerCodec> | |
| export type AnyWorkerCodec = WorkerCodec<any> | |
| // export type AnyWorkerCodec = WorkerCodec<any, any, any, any, any, any, any, any> | |
| export type AnyIWorkerCodec = IWorkerCodec<any, any, any, any, any, any, any, any> |
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 encodeFilesToBlob = (files: File[]): Promise<Blob> => { | |
| // const formData = new FormData() | |
| // files.forEach((file) => { | |
| // formData.append('files[]', file, file.name) | |
| // }) | |
| // return new Response(formData).blob() | |
| // } |
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
| /** | |
| * Structure: | |
| * First 4 bytes: number of files | |
| * Middle section: Array of file sizes (in bytes) relative to the order of the `files` array | |
| * End section: Array of file name lengths (in bytes) relative to the order of the `files` array | |
| * | |
| * Array of file sizes (in bytes) relative to the order of the `files` array with the first element being the number of files. | |
| * Encoded as a Uint32Array (so each element has to be less than 2^32 ~ 4GB) | |
| * | |
| * e.g. for files = [ |
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
| { lib, stdenv, pkgs ? import <nixpkgs> { } }: | |
| let | |
| packages = { | |
| playwright-chromium = pkgs.callPackage ./playwright-chromium.nix { }; | |
| }; | |
| rev = "1041"; | |
| inherit (pkgs.stdenv.hostPlatform) system; |
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 * 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 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 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 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 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 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 { 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 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 { 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( |