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=55&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 29322 results for "function"(2829ms)

EEPPortalnewsArticle.tsx6 matches

@solomonferedeUpdated 2 days ago
388);
389// Main Component for the News Article (Contents) Tab
390export function NewsArticleTab({ user }: { user: CurrentUser | null }) {
391 const [articles, setArticles] = useState<Article[]>([]);
392 const [title, setTitle] = useState("");
580 }
581 };
582 // Function to open the edit modal - Similar pattern to MediaMonitoringTab
583 const handleEditClick = (article: Article) => {
584 setEditFormData({
598 setEditModalError(""); // Clear modal-specific error
599 };
600 // Function to close the edit modal - Similar pattern to MediaMonitoringTab
601 const handleCloseEditModal = () => {
602 setIsEditModalOpen(false);
615 setEditModalError(""); // Clear modal-specific error on close
616 };
617 // Function to handle changes in the edit modal form - Similar pattern to MediaMonitoringTab
618 const handleEditFormChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
619 const { name, value } = e.target;
623 }));
624 };
625 // Function to save the edited entry
626 const handleSaveEdit = async () => {
627 // Validate required fields from editFormData
682 }
683 };
684 // Function to clear all filters
685 const clearFilters = () => {
686 setTitleFilter("");

EEPPortalfeeds.tsx2 matches

@solomonferedeUpdated 2 days ago
138 color: BRAND_COLORS.darkGreen,
139 marginBottom: "10px",
140 cursor: "pointer", // Added for toggle functionality
141 },
142 commentItem: {
247}
248
249export function FeedsTab(
250 { user, onNavigateToNewsArticleTab }: { user: CurrentUser | null; onNavigateToNewsArticleTab: () => void },
251) {

MindfulMilescada_hora.ts2 matches

@profMoishUpdated 2 days ago
1function sendNotification() {
2 const TOKEN = process.env.TELEGRAM_BOT_TOKEN;
3 const CHAT_ID = 1825527066;
26 * Главная функция cron-триггера
27 */
28export default async function() {
29 sendNotification();
30}

ValTownValdemo.ts1 match

@wolfUpdated 2 days ago
5 .withFile(
6 "src/index.ts",
7 `export function main() { console.log("Hello, ValTown!"); }`,
8 "script",
9 )
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

@maxmUpdated 2 days 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

@charmaineUpdated 2 days 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

@maxmUpdated 2 days 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

@maxmUpdated 2 days 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

@glanceUpdated 2 days 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
tuna

tuna9 file matches

@jxnblkUpdated 2 days ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouserUpdated 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.