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/image-url.jpg%20%22Optional%20title%22?q=function&page=42&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 22243 results for "function"(735ms)

appJobForm.tsx1 match

@treasure000•Updated 1 day ago
8}
9
10export default function JobForm({ onSubmitSuccess, onCancel }: JobFormProps) {
11 const [formData, setFormData] = useState({
12 title: "",

appJobDetail.tsx1 match

@treasure000•Updated 1 day ago
9}
10
11export default function JobDetail({ job, onBack }: JobDetailProps) {
12 return (
13 <div className="bg-white rounded-lg shadow p-6">

appJobList.tsx1 match

@treasure000•Updated 1 day ago
8}
9
10export default function JobList({ onSelectJob }: JobListProps) {
11 const [jobs, setJobs] = useState<Job[]>([]);
12 const [loading, setLoading] = useState(true);

appqueries.ts6 matches

@treasure000•Updated 1 day ago
24
25// Job queries
26export async function createJob(job: Job): Promise<number> {
27 const result = await sqlite.execute(
28 `INSERT INTO ${JOBS_TABLE} (
46}
47
48export async function getJobs(limit = 50, offset = 0): Promise<Job[]> {
49 const result = await sqlite.execute(
50 `SELECT * FROM ${JOBS_TABLE}
57}
58
59export async function getJobById(id: number): Promise<Job | null> {
60 const result = await sqlite.execute(
61 `SELECT * FROM ${JOBS_TABLE} WHERE id = ?`,
66}
67
68export async function searchJobs(query: string): Promise<Job[]> {
69 const searchTerm = `%${query}%`;
70 const result = await sqlite.execute(
80
81// Chat queries
82export async function createChatMessage(message: ChatMessage): Promise<number> {
83 const result = await sqlite.execute(
84 `INSERT INTO ${CHAT_MESSAGES_TABLE} (
97}
98
99export async function getChatMessages(limit = 100): Promise<ChatMessage[]> {
100 const result = await sqlite.execute(
101 `SELECT * FROM ${CHAT_MESSAGES_TABLE}

appmigrations.ts1 match

@treasure000•Updated 1 day ago
5export const CHAT_MESSAGES_TABLE = "chat_messages_v1";
6
7export async function runMigrations() {
8 // Create jobs table
9 await sqlite.execute(`

tinyfeed-demohttp.ts1 match

@yawnxyz•Updated 1 day ago
1import { tinyfeed } from "./mod.ts";
2
3export default function (req: Request) {
4 return tinyfeed.fetch(req);
5}

tinyfeed-demobuild.ts1 match

@yawnxyz•Updated 1 day ago
1import { tinyfeed } from "./mod.ts";
2
3export default async function (_interval: Interval) {
4 await tinyfeed.build();
5}

tinyfeed-demohttp.ts1 match

@pomdtr•Updated 1 day ago
1import { tinyfeed } from "./mod.ts";
2
3export default function (req: Request) {
4 return tinyfeed.fetch(req);
5}

tinyfeed-demobuild.ts1 match

@pomdtr•Updated 1 day ago
1import { tinyfeed } from "./mod.ts";
2
3export default async function (_interval: Interval) {
4 await tinyfeed.build();
5}

andpindex.tsx3 matches

@yawnxyz•Updated 1 day ago
71 registerScriptReevaluationOnBlur(document, 'echo');
72
73 function sparkbar(max) {
74 return x => {
75 const colorInfo = getColorBucket(x, 0, max);
88 }
89
90 function getColorBucket(value, min, max) {
91 // Create 6 buckets from 0 to 1
92 const normalized = (value - min) / (max - min);
110 }
111
112 async function fetchAndParsePropertyData() {
113 const googleSheetUrl = 'https://docs.google.com/spreadsheets/d/10NYauqngLH1JtaNvBSwPPoEEq66p4lKN00n5lHoQzXA/export?format=csv&gid=2048255928';
114 // const proxyUrl = \`https://api.allorigins.win/raw?url=\${encodeURIComponent(googleSheetUrl)}\`;

getFileEmail4 file matches

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

tuna8 file matches

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