๐
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 { Context, DateTime, Effect, Schema, PubSub } from "effect"; | |
| export const OrderId = Schema.String.pipe(Schema.brand("OrderId")); | |
| export type OrderId = typeof OrderId.Type; | |
| export class Order extends Schema.Class<Order>("Order")({ | |
| id: OrderId, | |
| }) {} | |
| export class OrderPlacedEvent extends Schema.Class<OrderPlacedEvent>( |
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 { Config, Context, Effect, Option, Schedule, Schema } from "effect"; | |
| import { Resend } from "resend"; | |
| import { EmailRepo } from "../../modules/email/repo"; | |
| import { HashId } from "../hashId"; | |
| import { EmailAddress, Event, OneTimeCode, User } from "@eventmind/domain"; | |
| import type { Mjml2HtmlOptions } from "mjml-react"; | |
| import { EventRepo } from "../../modules/event/repo"; | |
| import { UserRepo } from "../../modules/user/repo"; | |
| import * as EventCancelledEmail from "./emails/eventCancelled"; |
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 { Schema } from "@effect/schema"; | |
| import { Context, Effect, Option } from "effect"; | |
| import Hashids from 'hashids'; | |
| // const hashids = new Hashids() | |
| /** | |
| * Configuration for `hashids`. Default is `new Hashids()`. | |
| * | |
| * @since 1.0.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 { ArrayFormatter, Schema } from "@effect/schema"; | |
| import { ValidationError } from "@tanstack/react-form"; | |
| import { Effect, Either, Exit, ManagedRuntime, Layer } from "effect"; | |
| export const createValidator = <R, E>(layer: Layer.Layer<R, E, never>) => { | |
| const runtime = ManagedRuntime.make(layer); | |
| return { | |
| effectValidator: () => ({ | |
| validate( |
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
| it("optionalTextProp", (ctx) => { | |
| const schema = Schema.Struct({ | |
| text: SchemaUtils.optionalTextProp(Schema.String) | |
| }); | |
| const decode = Schema.decodeSync(schema); | |
| const encode = Schema.encodeSync(schema); | |
| ctx.expect(decode({})).toEqual({ text: Option.none() }); | |
| ctx.expect(decode({ text: "" })).toEqual({ text: Option.none() }); | |
| ctx.expect(decode({ text: " " })).toEqual({ text: Option.none() }); |
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 { ParseResult, Schema } from "@effect/schema"; | |
| import YAML from "yaml"; | |
| export const parseYaml = <I, A extends string>(self: Schema.Schema<I, A>) => | |
| Schema.transformOrFail( | |
| self, | |
| Schema.unknown, | |
| (s, _, ast) => { | |
| try { | |
| return ParseResult.success<unknown>(YAML.parse(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
| [ | |
| { | |
| "id": "theme:pd-dark", | |
| "name": "ProjectDiscovery Dark Theme", | |
| "highlights": { | |
| "background": "#27272A", | |
| "text": "#71717A", | |
| "variable": "#FFF", | |
| "variable2": "white", | |
| "variable3": "white", |
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
| interface DOB { | |
| dob: Date; | |
| } | |
| const age = (dob: DOB) => 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
| const colors = require("tailwindcss/colors"); | |
| module.exports = { | |
| theme: { | |
| spacing: { | |
| sm: "1rem", | |
| md: "2rem", | |
| lg: "4rem", | |
| xl: "8rem", | |
| }, |
NewerOlder