Skip to content

Instantly share code, notes, and snippets.

View tim-smart's full-sized avatar

Tim tim-smart

View GitHub Profile
import * as Http from "@effect/platform/HttpClient"
import { Schema } from "@effect/schema"
import { Array, Config, Context, Data, Effect, Layer, flow } from "effect"
import { Inngest as Inngest_ } from "inngest"
class InngestRun extends Schema.Class<InngestRun>("InngestRun")({
run_id: Schema.String,
status: Schema.Literal("Running", "Completed", "Failed", "Cancelled"),
}) {
static decodeArray = Http.response.schemaBodyJsonScoped(
import * as Http from "@effect/platform/HttpClient"
import { Context, Effect, Layer, pipe } from "effect"
const headers = {
Accept:
"application/graphql-response+json; charset=utf-8, application/json; charset=utf-8",
"Content-Type": "application/json",
}
export class GraphQLClient extends Context.Tag("graphql-codegen/GraphQLClient")<
import type { Duration, Scope } from "effect"
import { Effect, SynchronizedRef } from "effect"
export const make = (limit: number, window: Duration.DurationInput): Effect.Effect<
<A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>,
never,
Scope.Scope
> =>
Effect.gen(function*(_) {
const scope = yield* _(Effect.scope)
@tim-smart
tim-smart / ctags definitions for Javascript
Created October 2, 2009 00:07
CTags Definitions for Javascript
--langdef=js
--langmap=js:.js
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\5/,array/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^"]'[^']*/\5/,string/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*(true|false)/\5/,boolean/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[0-9]+/\5/,number/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*.+([,;=]|$)/\5/,variable/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*[ \t]*([,;]|$)/\5/,variable/
import { Schema, TreeFormatter } from "@effect/schema"
import {
Cause,
Context,
Data,
Effect,
Either,
Layer,
Option,
PrimaryKey,
import * as Context from "effect/Context"
import * as Effect from "effect/Effect"
import * as Exit from "effect/Exit"
import * as Layer from "effect/Layer"
import * as Runtime from "effect/Runtime"
import * as Scope from "effect/Scope"
export interface RuntimeClass<R> extends AsyncDisposable {
readonly close: () => Promise<void>
import {
Chunk,
Deferred,
Duration,
Effect,
Queue,
Ref,
Request,
RequestResolver,
} from "effect"
import { httpApp, response, router } from "@effect-http/core"
import { decodeParams } from "@effect-http/core/schema"
import { serve } from "@effect-http/node"
import { pipe } from "@effect/data/Function"
import * as Effect from "@effect/io/Effect"
import * as Schema from "@effect/schema/Schema"
import * as Http from "http"
const app = pipe(
router
node_modules
pnpm-lock.yaml
*.json