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
/** | |
* Utility functions for creating `PromiseSettledResult` instances. | |
* | |
* Provides methods to construct fulfilled and rejected promise results, | |
* ensuring they resolve asynchronously. | |
*/ | |
const PromiseSettledResult = { | |
/** | |
* Creates a fulfilled `PromiseSettledResult`. | |
* |
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 { Data } from 'effect'; | |
import type { StandardSchemaV1 } from '@standard-schema/spec'; | |
import { type ResultAsync, errAsync, okAsync } from 'neverthrow'; | |
export class ParseError extends Data.TaggedError('ParseError')<{ | |
response: Response; | |
issues: ReadonlyArray<StandardSchemaV1.Issue>; | |
}> {} | |
export class UnexpectedError extends Data.TaggedError('UnexpectedError')<{ |
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
# glitch_eventsub.gleam | |
websocket_message.NotificationMessage(metadata, payload) -> { | |
// process.send(state.websocket_message_mailbox, message) | |
io.println("") | |
io.println("eventsub client - notification message") | |
io.debug(payload) | |
io.println("") | |
let assert Ok(subject) = |
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 mockFromArbitrary<T>(arbitrary: Arbitrary<T>): T { | |
return fc.sample(arbitrary, 1)[0]; | |
} | |
export function mockArrayFromArbitrary<T>( | |
arbitrary: Arbitrary<T>, | |
count?: number, | |
): T[] { | |
return fc.sample(arbitrary, count); | |
} |
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
return { | |
{ | |
"rcarriga/nvim-notify", | |
keys = { | |
{ | |
"<leader>un", | |
function() | |
require("notify").dismiss({ silent = true, pending = true }) | |
end, | |
desc = "Dismiss All Notifications", |
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
// Your module (i.e. file is for providing and working with one main type) | |
export type FooBar = { | |
foo: string; | |
bar: number; | |
then: (fn: (foobar: FooBar) => FooBar) => FooBar; | |
map: <T>(fn: (foobar: FooBar) => T) => T; | |
}; | |
function make({ foo = "", bar = 0 }: Readonly<{ foo?: string; bar?: number }>) { | |
const foobar: FooBar = { |
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 * as $io from "../gleam_stdlib/gleam/io.d.mts"; | |
import type * as _ from "./gleam.d.mts"; | |
export class User extends _.CustomType { | |
constructor(id: string, username: string, role: Role$); | |
id: string; | |
username: string; | |
role: Role$; | |
} |
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
{ | |
description = "Nix flake for a simple Node and TypeScript DevShell"; | |
inputs = { | |
flake-parts.url = "github:hercules-ci/flake-parts"; | |
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | |
}; | |
outputs = inputs @ {flake-parts, ...}: | |
flake-parts.lib.mkFlake {inherit inputs;} { |
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
return { | |
{ | |
"mfussenegger/nvim-dap", | |
-- lazy = true, | |
dependencies = { | |
{ | |
"rcarriga/nvim-dap-ui", | |
config = function() | |
require("dapui").setup() | |
end, |
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
module Color = struct | |
type t = Red | Green | Blue | |
let to_string = function Red -> "red" | Green -> "green" | Blue -> "blue" | |
let of_json json = | |
Json.Decode.( | |
field "kind" string json |> function | |
| "red" -> Red | |
| "green" -> Green |
NewerOlder