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=12&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 24448 results for "function"(474ms)

todoqueries.ts1 match

@wolf•Updated 11 hours ago
3const TABLE_NAME = "todos_v1";
4
5export async function createTodoTable() {
6 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
7 id INTEGER PRIMARY KEY AUTOINCREMENT,

todomigrations.ts1 match

@wolf•Updated 11 hours ago
3const TABLE_NAME = "todos_v1";
4
5export async function createTodoTable() {
6 await sqlite.execute(`CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
7 id INTEGER PRIMARY KEY AUTOINCREMENT,

blogREADME.md1 match

@charmaine•Updated 11 hours ago
45 - **`rss.ts`**: RSS feed generation
46 - **`favicon.ts`** & **`og-image.ts`**: Asset routes
47- **`/utils/`**: Utility functions for post processing, caching, etc.
48- **`/posts/`**: Markdown files for blog posts
49- **`/styles/`**: CSS styling

blogHead.tsx1 match

@charmaine•Updated 11 hours ago
8const HLJS_DARK_CSS_URL = "https://cdn.jsdelivr.net/npm/highlight.js@11.8.0/styles/base16/solar-flare.css";
9
10export default function Head({ title, post }: {
11 title: string;
12 post?: BlogPost;

blogLayout.tsx1 match

@charmaine•Updated 11 hours ago
15}
16
17export function Layout({ title, post, children }: LayoutProps) {
18 return (
19 <html lang="en">

blogThemeToggle.tsx7 matches

@charmaine•Updated 11 hours ago
2import React from "https://esm.sh/react@18.2.0";
3
4export default function ThemeToggle() {
5 return (
6 <>
15 <script dangerouslySetInnerHTML={{
16 __html: `
17 (function() {
18 // Get saved theme or default to system preference
19 const savedTheme = localStorage.getItem('theme');
25
26 // Update icon
27 function updateIcon(theme) {
28 const icon = document.getElementById('theme-icon');
29 if (icon) {
34 updateIcon(currentTheme);
35
36 // Toggle function
37 function toggleTheme() {
38 const current = document.documentElement.getAttribute('data-theme');
39 const newTheme = current === 'dark' ? 'light' : 'dark';
45
46 // Add click listener when DOM is ready
47 document.addEventListener('DOMContentLoaded', function() {
48 const toggle = document.getElementById('theme-toggle');
49 if (toggle) {
53
54 // Listen for system theme changes
55 window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function(e) {
56 if (!localStorage.getItem('theme')) {
57 const newTheme = e.matches ? 'dark' : 'light';

blogindex.css2 matches

@charmaine•Updated 11 hours ago
330 border-radius: 9999px;
331 transition-property: color, background-color;
332 transition-timing-function: ease-in-out;
333 transition-duration: 200ms;
334}
442 justify-content: center;
443 transition-property: color, background-color;
444 transition-timing-function: ease-in-out;
445 transition-duration: 200ms;
446 font-size: 18px;

blogutil.tsx2 matches

@charmaine•Updated 11 hours ago
1export function formatDate(dateString: string): string {
2 try {
3 const date = new Date(dateString);
12}
13
14export function dayOfWeek(dateString: string): string {
15 try {
16 return new Date(dateString).toLocaleDateString("en-US", {

blogSocialLinks.tsx1 match

@charmaine•Updated 11 hours ago
2import { BlueskyIcon, DiscordIcon, GitHubIcon, RSSIcon, TwitterIcon } from "./icons.tsx";
3
4export default function SocialLinks() {
5 return (
6 <div className="social-links">

blogrender-markdown.ts1 match

@charmaine•Updated 11 hours ago
10
11// Process markdown content
12export async function processMarkdown(content: string): Promise<string> {
13 const result = await unified()
14 .use(remarkParse)

getFileEmail4 file matches

@shouser•Updated 1 month 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.