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/$1?q=function&page=31&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 29089 results for "function"(771ms)

ValTownValdemo.ts1 match

@wolf•Updated 23 hours ago
5 .withFile(
6 "src/index.ts",
7 `export function main() { console.log("Hello, ValTown!"); }`,
8 "script",
9 )

eschooldataClonemain.tsx3 matches

@AnimalActivitiesOfUlster•Updated 23 hours ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [view, setView] = useState("students");
7 const [students, setStudents] = useState([]);
428}
429
430function client() {
431 createRoot(document.getElementById("root")).render(<App />);
432}
433if (typeof document !== "undefined") { client(); }
434
435export default async function server(request: Request): Promise<Response> {
436 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
437 const KEY = "eschooldataClone";

parquetbranch-count-analysis.html2 matches

@maxm•Updated 23 hours ago
74 import * as duckdb from "https://esm.sh/@duckdb/duckdb-wasm";
75
76 async function initDuckDB() {
77 try {
78 const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();
104 }
105
106 async function countBranches() {
107 document.getElementById("loading").style.display = "block";
108 document.getElementById("count-display").style.display = "none";

openHeartProtocolGET.tsx1 match

@charmaine•Updated 23 hours ago
1// Receive emojis!
2
3export default async function send() {
4 const urls = [
5 "https://openheart.val.run/charmaineklee.com/OpenHeart",

parquetuser-count-analysis.html1 match

@maxm•Updated 23 hours ago
58 import * as duckdb from "https://esm.sh/@duckdb/duckdb-wasm";
59
60 async function initDuckDB() {
61 try {
62 const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();

parquetuser-analytics-dashboard.html13 matches

@maxm•Updated 23 hours ago
210
211 // Initialize DuckDB
212 async function initDuckDB() {
213 const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();
214 const bundle = await duckdb.selectBundle(JSDELIVR_BUNDLES);
238
239 // Initialize the dashboard
240 async function initDashboard() {
241 try {
242 conn = await initDuckDB();
253 document.getElementById("timeRange").addEventListener(
254 "change",
255 function () {
256 timeRange = this.value;
257 currentPage = 1;
263 document.getElementById("tierFilter").addEventListener(
264 "change",
265 function () {
266 tierFilter = this.value;
267 currentPage = 1;
272 document.getElementById("prevPage").addEventListener(
273 "click",
274 function () {
275 if (currentPage > 1) {
276 currentPage--;
282 document.getElementById("nextPage").addEventListener(
283 "click",
284 function () {
285 if (currentPage * pageSize < totalUsers) {
286 currentPage++;
298
299 // Load user table with pagination
300 async function loadUserTable() {
301 try {
302 document.getElementById("tableLoading").style.display =
384
385 // Load user growth chart
386 async function loadUserGrowthChart() {
387 try {
388 document.getElementById("userGrowthLoading").style.display =
518
519 // Load user tiers chart
520 async function loadUserTiersChart() {
521 try {
522 document.getElementById("userTiersLoading").style.display =
591
592 // Load theme preferences chart
593 async function loadThemeChart() {
594 try {
595 document.getElementById("themeLoading").style.display =
663
664 // Load copilot usage chart
665 async function loadCopilotChart() {
666 try {
667 document.getElementById("copilotLoading").style.display =
737
738 // Load referral sources chart
739 async function loadReferralChart() {
740 try {
741 document.getElementById("referralLoading").style.display =
816
817 // Populate tier filter options
818 async function populateTierOptions() {
819 try {
820 const result = await conn.query(`

Teamcontrollers.ts6 matches

@glance•Updated 23 hours ago
10const vt = new ValTown();
11
12export async function getValsForUser(id: string) {
13 try {
14 const vals = await vt.vals.list({ user_id: id });
20}
21
22export async function getDatabasePageIds() {
23 try {
24 const response = await notion.databases.query({
31}
32
33export async function getTeam() {
34 try {
35 const response = await notion.databases.query({
55}
56
57export async function getValTownUser(username: string) {
58 try {
59 return await vt.alias.username.retrieve(username);
63}
64
65export async function getNotionPage(id: string) {
66 try {
67 return await notion.pages.retrieve({
73}
74
75export async function setNotionPage(id: string, data: any) {
76 // bio might be empty (optional field)
77 const bio = data.bio
jsx

jsxdemo.tsx3 matches

@jxnblk•Updated 23 hours ago
3import { renderToString } from "https://esm.sh/react-dom@19/server";
4
5function App () {
6 return (
7 <html>
22 transitionProperty: "background-color, color",
23 transitionDuration: "1s",
24 transitionTimingFunction: "ease-in-out",
25 "&:hover": {
26 backgroundColor: "magenta",
45}
46
47export default async function (req: Request): Promise<Response> {
48 const html = renderToString(<App />);
49 return new Response(html, {
tuna

tunaatomic.tsx2 matches

@jxnblk•Updated 23 hours ago
11const MEDIA_RE = /^@media/;
12
13function createRule(obj, parentKey) {
14 const rules = [];
15 const classNames = [];
54
55
56export function atomic(obj: CSSProperties): TunaResult {
57 const result = new TunaResult();
58 const rules = [];

sqwnietable-info.tsx1 match

@tallesjp•Updated 23 hours ago
20});
21
22function isValidTableName(name: string) {
23 return /^[a-zA-Z0-9_]+$/.test(name);
24}
tuna

tuna9 file matches

@jxnblk•Updated 23 hours ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.