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 { getCloudflareAccountId } from '@repo/alchemy-helpers/cloudflare' | |
| import { postgresql, pulumi } from '@repo/pulumi' | |
| import * as planetscale from '@repo/pulumi-planetscale' // added via `pulumi package add terraform-provider planetscale/planetscale` | |
| import { HyperdriveConfig } from '@pulumi/cloudflare' | |
| import { validateResourceName } from '../lib/schema.ts' | |
| import type { CloudflareAccountId } from '@repo/alchemy-helpers/cloudflare' | |
| import type { HyperdriveConfigArgs } from '@pulumi/cloudflare' |
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 { fmt } from 'llm-tools' | |
| import type { Plugin } from '@opencode-ai/plugin' | |
| const PROMPT_SHORTCUTS = { | |
| '#explore': fmt.oneLine(` | |
| Use explore agents to get a better understanding of | |
| relevant systems before you dive into the details yourself. | |
| `), | |
| '#plan': fmt.oneLine(` |
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
| #!/bin/sh | |
| set -eu | |
| # Returns the absolute directory of this script, resolving file-level symlinks. | |
| # Usage: | |
| # script_dir="$(get_script_dir)" || exit 1 | |
| # printf 'script_dir=%s\n' "$script_dir" | |
| get_script_dir() { | |
| # Ensure readlink exists (portable use; no -f). |
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
| # alias to jump to repo root | |
| alias zz='cd $(git rev-parse --show-toplevel)' | |
| # global cache for repo root | |
| typeset -A _ZO_REPO_CACHE | |
| # custom zoxide wrapper to prevent leaving the repo | |
| function z() { | |
| # special cases: use regular zoxide behavior | |
| # "-" = jump to previous dir, $HOME = unlikely to be a git repo |
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 { NonRetryableError } from 'cloudflare:workflows' | |
| import { initWorkflowSentry } from '../helpers/sentry' | |
| import type { WorkflowEvent, WorkflowStep, WorkflowStepConfig } from 'cloudflare:workers' | |
| import type { Toucan } from 'toucan-js' | |
| import type { Bindings } from '../types' | |
| /** Workflow context (similar to Hono context) */ | |
| export class WorkflowContext<Params = unknown> { |
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
| VERSION 0.8 | |
| PROJECT jahands/docker | |
| # Local targets: | |
| tidy: | |
| LOCALLY | |
| RUN go mod tidy | |
| build-local: | |
| LOCALLY |
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 { Client as NotionClient } from '@notionhq/client'; | |
| import formatISO from 'date-fns/formatISO' | |
| import { utcToZonedTime } from 'date-fns-tz' | |
| import { ThrottledQueue, auth } from '@jahands/msc-utils'; | |
| let notion: NotionClient; | |
| function setup(env: Repeat.Env) { | |
| if (!notion) { | |
| notion = new NotionClient({ |
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
| // https://gist.github.com/jahands/c68b4786d1cea696e61714354c1d3019 | |
| import { ThrottledQueue } from '@jahands/msc-utils'; | |
| import PQueue from 'p-queue'; | |
| // ===== SETUP ===== // | |
| // Required ENV vars: | |
| // CLOUDFLARE_ACCOUNT_ID | |
| // CLOUDFLARE_API_TOKEN | |
| // WEBHOOK_KEY |
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
| async function statsGraph(params: Params, request: any, env: Env, ctx: ExecutionContext): Promise<Response> { | |
| const graphKey = 'uuid.rocks/stats/graph.png' | |
| const defaults = { | |
| contentType: 'image/png', | |
| cacheControl: 'public, max-age=1800', | |
| } as const | |
| const r2CacheTime = '2 hours' // itty-time format | |
| // First check edge cache | |
| // @ts-ignore | |
| const cache = caches.default |
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
| Function ConvertTo-WslPath { | |
| Param( | |
| [Parameter(Mandatory = $true, ValueFromPipeline)] | |
| [string]$Path | |
| ) | |
| $p = Get-Item $Path | |
| $wslPath = "/mnt/$($p.PSDrive.Name.ToLower())$($p.FullName.Substring($p.FullName.IndexOf(':')+1).Replace('\','/'))" | |
| $wslPath | |
| } |
NewerOlder