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=648&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 10842 results for "function"(432ms)

GitHubSynccommit-files2 matches

@ka12m•Updated 1 month ago
18
19/**
20 * General use function to commit files to GitHub
21 */
22export async function commitFiles({
23 token,
24 owner,

ExpenseTrackerExpense5 matches

@AryanChau0310•Updated 1 month ago
12}
13
14function App() {
15 const [expenses, setExpenses] = useState<Expense[]>([]);
16 const [description, setDescription] = useState("");
23 }, []);
24
25 // Function to fetch expenses from server
26 const fetchExpenses = async () => {
27 try {
34 };
35
36 // Function to add a new expense
37 const addExpense = async (e: React.FormEvent) => {
38 e.preventDefault();
132}
133
134function client() {
135 createRoot(document.getElementById("root")).render(<App />);
136}
137if (typeof document !== "undefined") { client(); }
138
139export default async function server(request: Request): Promise<Response> {
140 // Dynamic import of SQLite to avoid browser-side errors
141 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

flourishingGrayXerinaemain.tsx2 matches

@ViolinMimo•Updated 1 month ago
1import { getWeather } from "https://esm.town/v/stevekrouse/getWeather";
2
3export default async function(interval: Interval) {
4 let weather = await getWeather("Nairobi, Kenya");
5 console.log(weather.current_condition[0].FeelsLikeF);
7import { getWeather } from "https://esm.town/v/stevekrouse/getWeather";
8
9export default async function (interval: Interval) {
10 let weather = await getWeather("Nairobi, Kenya");
11 let feelsLike = weather.current_condition[0].FeelsLikeF;

Nairobimain.tsx1 match

@ViolinMimo•Updated 1 month ago
1import { getWeather } from "https://esm.town/v/stevekrouse/getWeather";
2export default async function (interval: Interval) {
3 let weather = await getWeather("Brooklyn, NY");
4 console.log(weather.current_condition[0].FeelsLikeF);

Weathermain.tsx1 match

@ViolinMimo•Updated 1 month ago
1export default async function (interval: Interval) {
2
3}

determinedBrownOcelotmain.tsx3 matches

@Awash•Updated 1 month ago
12}
13
14function App() {
15 const [activities, setActivities] = useState<ClosingActivity[]>([]);
16 const [newActivity, setNewActivity] = useState<Partial<ClosingActivity>>({
134}
135
136function client() {
137 createRoot(document.getElementById("root")).render(<App />);
138}
139if (typeof document !== "undefined") { client(); }
140
141export default async function server(request: Request): Promise<Response> {
142 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
143 const KEY = "determinedBrownOcelot";

delightfulHarlequinSilverfishmain.tsx3 matches

@YoungPapi•Updated 1 month ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [assignments, setAssignments] = useState([]);
7 const [messages, setMessages] = useState([]);
279};
280
281function client() {
282 createRoot(document.getElementById("root")).render(<App />);
283}
284if (typeof document !== "undefined") { client(); }
285
286export default async function server(request: Request): Promise<Response> {
287 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
288 const { blob } = await import("https://esm.town/v/std/blob");

twitterAlertREADME.md2 matches

@Danielmicah1114•Updated 1 month ago
46- Key: `mentionsDiscord`
47- Value: Your Discord webhook URL.
48Notifications will be sent using this function:
49
50```ts
63
64- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

twitterAlertmain.tsx1 match

@Danielmicah1114•Updated 1 month ago
12const isProd = false;
13
14export async function twitterAlert({ lastRunAt }: Interval) {
15 // If isProd, search for tweets since that last time this interval ran
16 // if not, search for tweets since 48 hours ago for testing
BlossomComptTech_WebsiteBlog

BlossomComptTech_WebsiteBlogHomepage2 matches

@Danielmicah1114•Updated 1 month ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}
9import Contact from "./Contact";
10
11export default function App() {
12 return (
13 <Router>

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago