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=102&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 20865 results for "function"(779ms)

untitled-9291About.tsx1 match

@maria26Updated 3 days ago
44 <h3 className="text-2xl font-semibold text-gray-800 mb-4">Our Story</h3>
45 <p className="text-gray-600 mb-4">
46 Founded in 2010, IDES INTERIOR began with a simple mission: to create beautiful, functional spaces that enhance people's lives. Over the years, we've grown from a small studio to a full-service interior design firm serving clients across the country.
47 </p>
48 <p className="text-gray-600 mb-4">

untitled-9291Portfolio.tsx1 match

@maria26Updated 3 days ago
18 title: "Modern Minimalist Apartment",
19 category: "residential",
20 description: "A clean, minimalist design focusing on functionality and open space.",
21 emoji: "🏙️"
22 },

untitled-9291Services.tsx3 matches

@maria26Updated 3 days ago
21 icon: "🏠",
22 title: "Residential Design",
23 description: "Transform your home into a personalized sanctuary that reflects your unique style and meets your functional needs."
24 },
25 {
31 icon: "🛋️",
32 title: "Furniture Selection",
33 description: "Find the perfect furniture pieces that balance aesthetics, comfort, and functionality for your space."
34 },
35 {
41 icon: "📐",
42 title: "Space Planning",
43 description: "Optimize your floor plan to maximize functionality, flow, and spatial efficiency in any environment."
44 },
45 {

reactHonoStarterApp.tsx1 match

@niceandneatUpdated 3 days ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
5 const [clicked, setClicked] = useState(0);
6 return (

untitled-3483README.md2 matches

@Satheesh_25Updated 3 days ago
6
7- `migrations.ts` - Database schema setup and seed data
8- `queries.ts` - Functions for querying the database
9
10## Database Schema
39```
40
41## Query Functions
42
43- `getCategories()` - Get all product categories

untitled-3483README.md2 matches

@Satheesh_25Updated 3 days ago
5## Files
6
7- `types.ts` - TypeScript interfaces and utility functions used by both frontend and backend
8
9## Shared Types
13- `CartItem` - Shopping cart item structure
14
15## Utility Functions
16
17- `formatPrice` - Format a number as a currency string

untitled-3483README.md1 match

@Satheesh_25Updated 3 days ago
13- Client-side rendering of different pages
14- Shopping cart with local storage persistence
15- Product search functionality
16- Contact form
17

untitled-3483index.js20 matches

@Satheesh_25Updated 3 days ago
4const initialData = window.__INITIAL_DATA__ || {};
5
6// Cart functionality
7let cart = JSON.parse(localStorage.getItem('toystore_cart') || '[]');
8
9function saveCart() {
10 localStorage.setItem('toystore_cart', JSON.stringify(cart));
11 updateCartCount();
12}
13
14function updateCartCount() {
15 const cartCount = document.getElementById('cart-count');
16 if (cartCount) {
21}
22
23function addToCart(product, quantity = 1) {
24 const existingItem = cart.find(item => item.product.id === product.id);
25
43}
44
45function removeFromCart(productId) {
46 cart = cart.filter(item => item.product.id !== productId);
47 saveCart();
49}
50
51function updateQuantity(productId, quantity) {
52 const item = cart.find(item => item.product.id === productId);
53 if (item) {
59
60// Page rendering
61function renderHeader() {
62 return `
63 <header class="bg-blue-600 text-white shadow-md">
106}
107
108function renderFooter() {
109 return `
110 <footer class="bg-gray-800 text-white py-8 mt-auto">
139}
140
141function renderProductCard(product) {
142 return `
143 <div class="product-card bg-white rounded-lg overflow-hidden shadow-md hover:shadow-xl">
165}
166
167function renderHomePage() {
168 const featuredProducts = initialData.featuredProducts || [];
169
239}
240
241function renderProductPage() {
242 const product = initialData.product;
243
317}
318
319function renderCategoryPage() {
320 const category = initialData.category;
321 const products = initialData.products || [];
353}
354
355function renderCartPage() {
356 return `
357 <div class="container mx-auto px-4 py-8">
442}
443
444function renderContactPage() {
445 return `
446 <div class="container mx-auto px-4 py-8">
535}
536
537function renderSearchResults(products) {
538 return `
539 <div class="container mx-auto px-4 py-8">
557}
558
559// Main render function
560function renderPage() {
561 const app = document.getElementById('app');
562 let content = '';
599
600// Set up event listeners for interactive elements
601function setupEventListeners() {
602 // Product quantity buttons on product page
603 const quantityInput = document.getElementById('product-quantity');
695}
696
697// Search function
698window.searchProducts = async function(query) {
699 if (!query || query.trim() === '') return;
700

ddddashboardController.ts1 match

@DhanuUpdated 3 days ago
6
7// Get dashboard statistics
8export async function getDashboardStats(agentId?: number): Promise<DashboardStats> {
9 try {
10 // Base query for counting properties

dddpropertyController.ts9 matches

@DhanuUpdated 3 days ago
11import { PROPERTIES_TABLE, USERS_TABLE } from "../database/schema.ts";
12
13// Helper function to build property object from database row
14export function buildPropertyFromRow(row: any): Property {
15 return {
16 id: row.id,
43
44// Get all properties with pagination and filtering
45export async function getProperties(
46 page: number = 1,
47 limit: number = 10,
166
167// Get property by ID
168export async function getPropertyById(id: number): Promise<Property | null> {
169 try {
170 const query = `
205
206// Create new property
207export async function createProperty(propertyData: Omit<Property, "id" | "createdAt" | "updatedAt">, userId: number): Promise<Property | null> {
208 try {
209 const now = new Date().toISOString();
253
254// Update property
255export async function updateProperty(
256 id: number,
257 propertyData: Partial<Property>,
402
403// Delete property
404export async function deleteProperty(
405 id: number,
406 userId: number,
433
434// Get featured properties (for homepage)
435export async function getFeaturedProperties(limit: number = 6): Promise<Property[]> {
436 try {
437 const query = `
475
476// Get properties by agent
477export async function getPropertiesByAgent(agentId: number): Promise<Property[]> {
478 try {
479 const query = `

getFileEmail4 file matches

@shouserUpdated 3 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkUpdated 4 weeks 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.