70};
71
72function createArrayOfLength(length: number): number[] {
73 return Array.from(Array(length === 0 ? 1 : length), (_, i) => i);
74}
79 * noise range to fit the 0 to 1 scale we need.
80 */
81function getColorByNoise(colors: string[], noise: number) {
82 return colors[Math.floor(((noise + 1) / 2) * colors.length)];
83}
2import { form } from "https://esm.town/v/curtcox/command_processor_test_form";
3
4async function process(command: string): Promise<string> {
5 const result = await command_processor(command);
6 return result.output.content;
7}
8
9export default async function(req: Request): Promise<Response> {
10 return form(req, process);
11}
8import { useState } from "https://esm.sh/react@18.2.0";
9
10export function App() {
11 const [ count, setCount ] = useState(0)
12 return (
1export default function({ component, sourceURL, head }: { component: Function; sourceURL: string; head?: string }) {
2 return new Response(
3 `<html>
7import { ObjectInspector } from "https://esm.sh/react-inspector";
8
9async function fetchGgufMetadata(url: string) {
10 const { metadata, tensorInfos } = await gguf(url);
11 return { metadata, tensorInfos };
12}
13
14function Counter() {
15 const [counter, setCounter] = React.useState(0);
16
26}
27
28export function App() {
29 return (
30 <>
5import OpenAI from "npm:openai";
6
7export default async function semanticSearchPublicVals(query) {
8 const sqlite = createClient({
9 url: "libsql://valsembeddings-jpvaltown.turso.io",
29import { email } from "https://esm.town/v/std/email?v=12";
30
31export default async function(interval: Interval) {
32 const dynamiclandWebsiteHash = await blob.getJSON("dynamiclandWebsiteHash");
33 const newHash = await getHashForUrl("https://dynamicland.org/");
90const ideasKey = "game-ideas";
91
92async function getIdeas(): Promise<Idea[]> {
93 let ideas = await blob.getJSON(ideasKey) as Idea[];
94 if (ideas == null) ideas = [];
96}
97
98async function setIdeas(ideas: Idea[]): Promise<void> {
99 await blob.setJSON(ideasKey, ideas);
100}
101
102function getRandomElement<T>(array: T[]): T {
103 const randomIndex = Math.floor(Math.random() * array.length);
104 return array[randomIndex];
1export function extractHttpEndpoint(url: string | URL) {
2 const { pathname } = new URL(url);
3 const [author, filename] = pathname.split("/").slice(-2);
1export function formatResume(resumeDetails) {
2 function applyFormatting(text) {
3 if (typeof text === 'string') {
4 return text
9 }
10
11 function preprocessResumeDetails(details) {
12 if (Array.isArray(details)) {
13 return details.map(item => preprocessResumeDetails(item));
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.