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/?q=function&page=1638&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 18199 results for "function"(3147ms)

powderNotifymain.tsx1 match

@chet•Updated 1 year ago
6
7/** This doesnt work well */
8export async function powderNotify(location: string) {
9 const weather = await getWeather(location);
10

lessonTemplatemain.tsx1 match

@petermillspaugh•Updated 1 year ago
17}
18
19export function generateLessonHtml({ email, lesson, title, fillBlank, content, quiz }: GenerateLessonHtmlParams) {
20 const lessonJsx = (
21 <html>

sendDailyLessonsmain.tsx2 matches

@petermillspaugh•Updated 1 year ago
5type SubscriberRow = [emailAddress: string, currentLesson: number];
6
7export default async function sendDailyLessons(interval: Interval) {
8 // No-op if I accidentally click "Run now" to avoid double sending lessons
9 const now = Date.now();
10 const time23hrs57min = (23 * 60 + 57) * 60 * 1000;
11 if (!interval.lastRunAt || now - interval.lastRunAt.getTime() < time23hrs57min) {
12 console.log("Don't manually run this function! It will email all subscribers.");
13 return;
14 }

upsertStudentmain.tsx1 match

@petermillspaugh•Updated 1 year ago
19 * The current behavior is to reset to lesson 1.
20 */
21export async function upsertStudent({ name, email, token }: UpsertEmailSubscriberParams) {
22 return sqlite.execute({
23 sql: `

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;

getFileEmail4 file matches

@shouser•Updated 1 week 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": "*",