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=7&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 7147 results for "function"(434ms)

pondiversefetchCreations1 match

@elouan•Updated 1 day ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 // First, get the row IDs of all rows that are older than 25 hours old
7 const res = await sqlite.execute(`

pondiverseaddCreation1 match

@elouan•Updated 1 day ago
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - title (string)

valProfilePageindex.tsx1 match

@dcm31•Updated 1 day ago
10}
11
12function initApp() {
13 const root = document.getElementById("root");
14 if (!root) {

valProfilePageApp.tsx2 matches

@dcm31•Updated 1 day ago
4import { HomePage } from "./HomePage.tsx";
5
6export function App() {
7 const [path, setPath] = useState(window.location.pathname);
8
18 }, []);
19
20 // Navigate function for client-side routing
21 const navigate = (to: string) => {
22 window.history.pushState({}, '', to);

valProfilePageValGrid.tsx1 match

@dcm31•Updated 1 day ago
19}
20
21export function ValGrid({ vals }: ValGridProps) {
22 if (!vals || vals.length === 0) {
23 return (

valProfilePageValGridItem.tsx2 matches

@dcm31•Updated 1 day ago
19}
20
21export function ValGridItem({ val }: ValGridItemProps) {
22 const [imgError, setImgError] = useState(false);
23 const [moiConfig, setMoiConfig] = useState<any>(null);
25 // Create a deterministic background color based on val name
26 const getBackgroundColor = () => {
27 // Simple hash function for generating a color
28 let hash = 0;
29 const str = val.name + val.username;

valProfilePageUserProfile.tsx2 matches

@dcm31•Updated 1 day ago
27}
28
29export function UserProfile({ username }: UserProfileProps) {
30 const [loading, setLoading] = useState(true);
31 const [error, setError] = useState<string | null>(null);
37 // Generate a deterministic background color based on username
38 const getProfileColor = () => {
39 // Simple hash function for generating a color
40 let hash = 0;
41 for (let i = 0; i < username.length; i++) {

valProfilePagemoiConfig.tsx3 matches

@dcm31•Updated 1 day ago
15 * Parse YAML frontmatter from a string
16 */
17function parseFrontmatter(content: string): MoiConfig | null {
18 try {
19 // Check if content has frontmatter (starts with ---)
81 * Returns the parsed configuration or null if not found or invalid
82 */
83export async function fetchMoiConfig(baseUrl: string): Promise<MoiConfig | null> {
84 try {
85 // Try to fetch the moi.md file from the project root
102 * Get image URL from moi config or use default
103 */
104export function getProfileImageUrl(
105 username: string,
106 moiConfig: MoiConfig | null,

valProfilePageHomePage.tsx1 match

@dcm31•Updated 1 day ago
6}
7
8export function HomePage({ onNavigate }: HomePageProps) {
9 const [username, setUsername] = useState("");
10

valtownInstagramhome.ts2 matches

@dcm31•Updated 1 day ago
6 * Renders the home page
7 */
8export async function homePage(c: Context): Promise<Response> {
9 const projectInfo = parseProject(import.meta.url);
10
74
75 <script>
76 function searchUser() {
77 const username = document.getElementById('username').value.trim();
78 if (username) {

getFileEmail4 file matches

@shouser•Updated 4 days ago
A helper function to build a file's email

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago