Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=function&page=1676&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 18574 results for "function"(3883ms)

markLessonCompletemain.tsx1 match

@petermillspaugh•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function markLessonComplete(emailAddress: string) {
4 await sqlite.execute({
5 sql: `

sendLessonmain.tsx1 match

@petermillspaugh•Updated 1 year ago
8}
9
10export async function sendLesson({ lesson, emailAddress }: SendLessonParams) {
11 await sqlite.execute({
12 sql: `

createStudentsTablemain.tsx1 match

@petermillspaugh•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function createStudentsTable() {
4 await sqlite.execute(
5 `

unsubscribemain.tsx1 match

@petermillspaugh•Updated 1 year ago
2import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
3
4export async function unsubscribe(req: Request) {
5 const searchParams = new URL(req.url).searchParams;
6 const emailAddress = searchParams.get("email");

yourBrainmain.tsx2 matches

@petermillspaugh•Updated 1 year ago
62 <h2>The basal ganglia</h2>
63 <p>
64 The basal ganglia, which also controls some motor function—both voluntary and unvoluntary, like subconscious eye
65 movements, Cognitive and motor functions can be chunked together in one unit that makes up a learned habit or
66 skill. So you can think of learned habits become automatic, uncontrolled System 1 knowledge.
67

notionSiteProxymain.tsx1 match

@chet•Updated 1 year ago
4const notionPage = "https://chetcorcos.notion.site/0e27612403084b2fb4a3166edafd623a";
5
6export default async function(req: Request): Promise<Response> {
7 const notionUrl = new URL(notionPage);
8 const notionDomain = notionUrl.host;

EmailKeysmain.tsx5 matches

@chet•Updated 1 year ago
3const db = new ValTupleStorage("email");
4
5export async function generateEmailKey() {
6 const key = Math.random().toString().slice(3);
7
17}
18
19export async function listEmailKeys() {
20 const emailKeys = await db.scan();
21 console.log("Email keys:", emailKeys);
22}
23
24export async function expireEmailKey(key: string) {
25 const expires = Date.now() - 1;
26 await db.write({ set: [{ key: [key], value: expires }] });
27}
28
29export async function authenticateEmailKey(key: string) {
30 const result = await db.scan({ gte: [key], lte: [key], limit: 1 });
31 if (result.length === 0) return "Invalid key.";
34}
35
36export async function resetEmailKeys() {
37 await db.destroy();
38}

add_to_notion_w_ai_webpagemain.tsx10 matches

@nerdymomocat•Updated 1 year ago
39});
40
41function createPrompt(title, description, properties) {
42 let prompt =
43 "You are processing content into a database. Based on the title of the database, its properties, their types and options, and any existing descriptions, infer appropriate values for the fields:\n";
84}
85
86function processProperties(jsonObject) {
87 const properties = jsonObject.properties;
88 const filteredProps = {};
115}
116
117async function get_and_save_notion_db_processed_properties(databaseId)
118{
119 const response = await notion.databases.retrieve({ database_id: databaseId });
126}
127
128async function get_notion_db_info(databaseId) {
129 databaseId = databaseId.replaceAll("-", "");
130 let db_info = null;
142}
143
144async function get_and_save_notion_db_info(databaseId) {
145 databaseId = databaseId.replaceAll("-", "");
146 let db_info = await get_and_save_notion_db_processed_properties(databaseId);
149}
150
151function createZodSchema(filteredProps) {
152 const schemaObject = {};
153
198}
199
200function convertToNotionProperties(responseValues, filteredProps) {
201 const notionProperties = {};
202
273}
274
275async function process_text(dbid, text) {
276 const db_info = await get_notion_db_info(dbid);
277 const processed_message = await client.chat.completions.create({
288}
289
290async function addToNotion(databaseId, text) {
291 databaseId = databaseId.replaceAll("-", "");
292 const properties = await process_text(databaseId, text);
301}
302
303export default async function(req: Request) {
304 if (req.method === "POST") {
305 const content = (await req.formData()).get("content");

add_to_notion_w_aimain.tsx9 matches

@nerdymomocat•Updated 1 year ago
35});
36
37function createPrompt(title, description, properties) {
38 let prompt =
39 "You are processing content into a database. Based on the title of the database, its properties, their types and options, and any existing descriptions, infer appropriate values for the fields:\n";
80}
81
82function processProperties(jsonObject) {
83 const properties = jsonObject.properties;
84 const filteredProps = {};
111}
112
113async function get_and_save_notion_db_processed_properties(databaseId)
114{
115 const response = await notion.databases.retrieve({ database_id: databaseId });
122}
123
124async function get_notion_db_info(databaseId) {
125 databaseId = databaseId.replaceAll("-", "");
126 let db_info = null;
137}
138
139async function get_and_save_notion_db_info(databaseId) {
140 databaseId = databaseId.replaceAll("-", "");
141 let db_info = await get_and_save_notion_db_processed_properties(databaseId);
144}
145
146function createZodSchema(filteredProps) {
147 const schemaObject = {};
148
193}
194
195function convertToNotionProperties(responseValues, filteredProps) {
196 const notionProperties = {};
197
268}
269
270async function process_text(dbid, text) {
271 const db_info = await get_notion_db_info(dbid);
272 const processed_message = await client.chat.completions.create({
283}
284
285async function addToNotion(databaseId, text) {
286 databaseId = databaseId.replaceAll("-", "");
287 const properties = await process_text(databaseId, text);

untitled_roseGuanacomain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { html } from "https://esm.town/v/stevekrouse/html";
2
3export default async function(req: Request): Promise<Response> {
4 // return new Response("<h1>Hello FRC!</h1>", { headers: {
5 // "Content-Type": "text/html"

getFileEmail4 file matches

@shouser•Updated 2 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
lost1991
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": "*",