This file contains 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
// deno-lint-ignore-file no-explicit-any | |
import { Hono } from "https://deno.land/x/hono@v3.12.0/mod.ts"; | |
import { Context } from "https://deno.land/x/hono@v3.12.0/context.ts"; | |
import * as dejs from "https://deno.land/x/dejs@0.10.3/mod.ts"; | |
// Initialize class routes by instantiating a version of them | |
export function register(...args: any) { | |
args.forEach((C: any) => { | |
console.log("Mounting routes for", C.name); | |
new C(); |
This file contains 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
/** @jsx jsx */ | |
import OpenAI from "https://deno.land/x/openai@v4.20.1/mod.ts"; | |
import { Hono } from "https://deno.land/x/hono@v3.11.6/mod.ts"; | |
import { | |
getCookie, | |
setCookie, | |
} from "https://deno.land/x/hono@v3.11.6/helper.ts"; | |
import { jsx } from "https://deno.land/x/hono@v3.11.6/jsx/index.ts"; | |
// Create OpenAI API client and Hono app |
This file contains 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
{"uuid":"91af22b0-9548-11ee-bd8a-f77d23459a43","page":{"id":216600679,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"$main\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"$main\",\"uuid\",null,\"type\",\"frame\",\"subtype\",\"Frame\",\"namespace\",null,\"resourceName\",null,\"resourceDisplayName\",null,\"template\",[\"^3\",[\"type\",\"main\",\"sticky\",null,\"paddingType\",\"normal\",\"enableFullBleed\",false,\"isHiddenOnDesktop\",false,\"isHiddenOnMobile\",false]],\"style\",[\"^3\",[]],\"position2\",null,\"mobilePosition2\",null,\"mobileAppPosition\",null,\"tabIndex\",null,\"container\",\"\",\"createdAt\",\"~m1701984946485\",\"updatedAt\",\"~m1701984946485\",\"folder\",\"\",\"screen\",null]]],\"codeEditor\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"codeEditor\",\"^4\",\"39a68fb8-220c-4d42-be4b-e9a532d355bb\",\"^5\",\"widget\",\"^6\",\"CustomComponentWidget\",\"^7\",null,\"^8\",null,\"^9\",null,\" |
This file contains 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 kv = await Deno.openKv(); | |
Deno.serve(async (request: Request) => { | |
// Create short links | |
if (request.method == "POST") { | |
const body = await request.text(); | |
const { slug, url } = JSON.parse(body); | |
const result = await kv.set(["links", slug], url); | |
return new Response(JSON.stringify(result)); |
This file contains 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 kv = await Deno.openKv(); | |
export interface Link { | |
slug: string; | |
destination: string; | |
} | |
export async function getLink( | |
slug: string, | |
): Promise<Link | null> { |
This file contains 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
/** @jsx h */ | |
import { serve } from "https://deno.land/std@0.190.0/http/mod.ts"; | |
import html, { h } from "https://deno.land/x/htm@0.2.0/mod.ts"; | |
function Greeting({ name }) { | |
return <h1>Hello, {name}!</h1>; | |
} | |
function handler(_req: Request): Response { | |
return html({ |
This file contains 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
{"uuid":"6d5c93ce-c7fe-11ed-9b8b-53fc17ea022d","page":{"id":140024616,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"query1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"query1\",\"type\",\"datasource\",\"subtype\",\"RESTQuery\",\"namespace\",null,\"resourceName\",\"c6476334-bcd2-4543-9b83-dc7f4bf51db5\",\"resourceDisplayName\",\"Sid's D&D API\",\"template\",[\"^3\",[\"queryRefreshTime\",\"\",\"paginationLimit\",\"\",\"body\",\"\",\"lastReceivedFromResourceAt\",null,\"queryDisabledMessage\",\"\",\"servedFromCache\",false,\"offlineUserQueryInputs\",\"\",\"successMessage\",\"\",\"queryDisabled\",\"\",\"playgroundQuerySaveId\",\"latest\",\"resourceNameOverride\",\"\",\"runWhenModelUpdates\",true,\"paginationPaginationField\",\"\",\"headers\",\"\",\"showFailureToaster\",true,\"paginationEnabled\",false,\"query\",\"monsters?challenge_rating={{numberInput1.value}}\",\"playgroundQueryUuid\",\"\",\"playgroundQueryId\",null,\ |
This file contains 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
{"uuid":"87701b90-92b2-11ed-b072-13fe1ea2c3e2","page":{"id":128353720,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"selectedCharacter\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"selectedCharacter\",\"type\",\"state\",\"subtype\",\"State\",\"namespace\",null,\"resourceName\",null,\"resourceDisplayName\",null,\"template\",[\"^3\",[\"_persistedValueGetter\",null,\"_persistedValueSetter\",null,\"persistValue\",false,\"persistedValueKey\",\"\",\"value\",\"null\"]],\"style\",null,\"position2\",null,\"mobilePosition2\",null,\"mobileAppPosition\",null,\"tabIndex\",null,\"container\",\"\",\"createdAt\",\"~m1673893610009\",\"updatedAt\",\"~m1673896563518\",\"folder\",\"state\",\"screen\",null]]],\"listCharacters\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"listCharacters\",\"^4\",\"datasource\",\"^5\",\"SqlQueryUnified\",\"^6\",null,\"^7\",\"579e96f7-980f-44e8-b2f4-688cd2da3660\",\"^8\",\"retool_db\",\" |
This file contains 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
{"uuid":"23b73fd8-7fa8-11ed-a488-4bc5ba7c4a27","page":{"id":114516001,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"onLoad\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"onLoad\",\"type\",\"datasource\",\"subtype\",\"JavascriptQuery\",\"namespace\",null,\"resourceName\",\"JavascriptQuery\",\"resourceDisplayName\",null,\"template\",[\"^3\",[\"queryRefreshTime\",\"\",\"lastReceivedFromResourceAt\",null,\"queryDisabledMessage\",\"\",\"servedFromCache\",false,\"successMessage\",\"\",\"queryDisabled\",\"\",\"playgroundQuerySaveId\",\"latest\",\"resourceNameOverride\",\"\",\"runWhenModelUpdates\",false,\"showFailureToaster\",true,\"query\",\"let userId = localStorage?.values?.starWarsMovieOrderId;\\n\\nif (!userId) {\\n // If this is a new user, set up an ID and allow the default rankings\\n userId = uuid.v4();\\n localStorage.setValue('starWarsMovieOrderId', userId);\\n}\\n\\nloadPreference.trigger();\\ncommunityPrefer |
NewerOlder