redditAlertmain.tsx1 match
7const serpApiKey = Deno.env.get("SERP_API_KEY");
89export async function redditAlert({ lastRunAt }: Interval) {
10if (!serpApiKey || !mentionsDiscord) {
11console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");
transaction_challengemain.tsx9 matches
4import { blob } from "https://esm.town/v/std/blob";
56function generateMockTransaction() {
7const types = ["purchase", "transfer", "withdrawal", "deposit"];
8const amounts = [10, 50, 100, 500, 1000];
15}
1617function Leaderboard() {
18const [leaderboard, setLeaderboard] = useState([
19{ username: "AlgoTrader", score: 92 },
115}
116117function App() {
118const [activeTab, setActiveTab] = useState("challenge");
119const [activeLevel, setActiveLevel] = useState(1);
120const [username, setUsername] = useState("");
121const [code, setCode] = useState(`
122// Write a function to approve or deny transactions
123function processTransaction(transaction) {
124// Return true to approve, false to deny
125return transaction.amount < 500;
135try {
136// eslint-disable-next-line no-eval
137processRef.current = new Function("transaction", code + "\nreturn processTransaction(transaction);");
138setIsRunning(true);
139setTransactions([]); // Clear transactions when code is run
337</h2>
338339As an intern at WallexAir, you're tasked with ensuring we meet this obligation. Write a function
340that takes a transaction and returns true if it is a compliant transaction, and false if we should
341reject it.
408}
409410function client() {
411createRoot(document.getElementById("root")).render(<App />);
412}
413if (typeof document !== "undefined") { client(); }
414415export default async function server(request: Request): Promise<Response> {
416return new Response(
417`
getProjectsAsZipsApp.tsx1 match
3import { MessageInput } from "./MessageInput.tsx";
45export function App({ projects }: { projects: any[] }) {
6const [url, setURL] = React.useState("");
7
neighborsolutionsmain.tsx4 matches
88* @return {number} the distance in miles
89*/
90function convertMetersToMiles(meters: number): number {
91return 0.000621371 * meters;
92}
9394// Round a number to the nearest quarter.
95function roundToQuarter(number: number) {
96let remainder = number % 1;
97121* @return {SearchParams | SearchParamsWithPreset} The constructed search parameters.
122*/
123function constructTypesenseParams({
124query,
125lat,
165* @return {Promise<any>} A Promise that resolves to an array of resources matching the search criteria.
166*/
167export async function getResources({
168lat,
169lng,
reactWeatherDashboardmain.tsx4 matches
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function WeatherDashboard() {
6const [location, setLocation] = useState({ latitude: 40.7128, longitude: -74.0060 }); // Default to NYC
7const [weather, setWeather] = useState(null);
2829useEffect(() => {
30async function fetchWeather() {
31try {
32const response = await fetch(
152};
153154function client() {
155createRoot(document.getElementById("root")).render(<WeatherDashboard />);
156}
157if (typeof document !== "undefined") { client(); }
158159export default async function server(request: Request): Promise<Response> {
160return new Response(`
161<html>
reactHonoStarterApp.tsx1 match
2import { useState } from "https://esm.sh/react@18.2.0";
34export function App() {
5const [clicked, setClicked] = useState(0);
6return (
67If you're running code in Val Town, sometimes you want to know
8information about the val that's running. This module has functions for that.
910## Usage
reactHonoStarterApp.tsx1 match
2import { useState } from "https://esm.sh/react@18.2.0";
34export function App() {
5const [clicked, setClicked] = useState(0);
6return (
2import { readFile } from "../file/index.ts";
34export async function serveFile(path: string, metaImportUrl: string): Promise<Response> {
5const text = await readFile(path, metaImportUrl);
6const content_type = getContentType(path);
12}
1314export function getContentType(path: string): string {
15if (path.endsWith(".ts") || path.endsWith(".jsx") || path.endsWith(".tsx")) {
16return "text/javascript";
1import { arenaChannelContents } from "https://esm.town/v/pomcute/arenaChannelContents";
23export default async function questionPractice(interval: Interval) {
4const contents = await arenaChannelContents({ channelId: "asking-the-right-questions-sbkcnb9eank" });
5