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/?q=function&page=1180&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 22454 results for "function"(1530ms)

vt_blogLayout.tsx1 match

@stevekrouse•Updated 1 month ago
7}
8
9export function Layout({ title, children }: LayoutProps) {
10 return (
11 <html lang="en">

vt_blogvt-blog.md1 match

@stevekrouse•Updated 1 month ago
62```ts
63// Example of how we fetch blog posts
64async function getAllBlogPosts() {
65 // Get local posts from markdown files
66 const localPosts = await getLocalBlogPosts();

vt_blogget-new-posts.ts2 matches

@stevekrouse•Updated 1 month ago
4
5// Get all blog posts from the file system
6export async function getNewPosts(): Promise<BlogPost[]> {
7 const files = await listFiles(import.meta.url);
8 const blogPostFiles = files.filter(
38
39// Get a single blog post by slug
40export async function getBlogPostBySlug(slug: string): Promise<BlogPost | null> {
41 const content = await readFile(`/posts/${slug}.md`, import.meta.url);
42 const { data, content: markdownContent } = matter(content);

vt_blogget-old-posts.ts1 match

@stevekrouse•Updated 1 month ago
4const OLD_BLOG_RSS = "https://val-town-blog.pages.dev/rss.xml";
5// Get blog posts from RSS feed
6export async function getOldPosts(): Promise<BlogPost[]> {
7 const parser = new RssParser();
8 const feed = await parser.parseURL(OLD_BLOG_RSS);

vt_blogget-posts.ts1 match

@stevekrouse•Updated 1 month ago
4
5// Get all blog posts (local + RSS)
6export async function getAllBlogPosts(): Promise<BlogPost[]> {
7 return (await Promise.all([
8 getNewPosts(),

vt_blogproxy.ts1 match

@stevekrouse•Updated 1 month ago
5const OLD_BLOG_URL = "https://val-town-blog.pages.dev/";
6
7export async function proxyHonoRequest(c: any) {
8 const url = new URL(c.req.url);
9

vt_blogHomePage.tsx2 matches

@stevekrouse•Updated 1 month ago
4import { Layout } from "./Layout.tsx";
5
6function formatDate(dateString: string): string {
7 try {
8 const date = new Date(dateString);
16}
17
18export function HomePage({ posts }: { posts: BlogPost[] }) {
19 return (
20 <Layout title="Val Town Blog">

Lagoskitchenmain.tsx5 matches

@Koolprince0•Updated 1 month ago
80];
81
82function FoodMenuItem({ item, onAddToCart }) {
83 return (
84 <div className="menu-item">
104}
105
106function CheckoutForm({ cart, totalPrice, onSubmit }) {
107 const [name, setName] = useState("");
108 const [phone, setPhone] = useState("");
161}
162
163function App() {
164 const [cart, setCart] = useState([]);
165 const [orderPlaced, setOrderPlaced] = useState(false);
257}
258
259function client() {
260 createRoot(document.getElementById("root")).render(<App />);
261}
262if (typeof document !== "undefined") { client(); }
263
264export default async function server(request: Request): Promise<Response> {
265 if (request.method === "POST" && new URL(request.url).pathname === "/submit-order") {
266 try {

vt_blogBlogPost.tsx2 matches

@stevekrouse•Updated 1 month ago
9}
10
11function formatDate(dateString: string): string {
12 try {
13 const date = new Date(dateString);
22}
23
24export function BlogPostComponent({ post, content }: BlogPostProps) {
25 return (
26 <Layout title={`${post.title} - Val Town Blog`}>

vt_blogrender-markdown.ts1 match

@stevekrouse•Updated 1 month ago
9
10// Process markdown content
11export async function processMarkdown(content: string): Promise<string> {
12 const result = await unified()
13 .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.