Search
val_Ky1DCGTe7O
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_Ky1DCGTe7O(req) {
try {
// Execute the code directly
valle_tmp_66391058371017956900111721083726
@janpaul123
// This val responds with "Hello, world!"
HTTP
// This val responds with "Hello, world!"
export default async function main(req: Request): Promise<Response> {
return new Response("Hello, world!");
gameTool
@Mindsparkai
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function GameTool() {
const [score, setScore] = useState(0);
</div>
function client() {
createRoot(document.getElementById("root")).render(<GameTool />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`
valle_tmp_578893276058611408404753009261645
@janpaul123
// This val will respond with an HTML page saying "Hello, world!" with fun CSS.
HTTP
// This val will respond with an HTML page saying "Hello, world!" with fun CSS.
export default async function main(): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
val_lg7edVgoMt
@dhvanil
An interactive, runnable TypeScript val by dhvanil
Script
export default async function handler(req) {
try {
const result = await (async () => {
function fibonacci() { let a = 0, b = 1; let fibNumbers = []; while (b < 1000) { if (b >= 100) fibNumbers.push(b); let temp = b; b = a + b; a = temp; } return fibNumbers.slice(0, 3);}
fibonacci();
return Response.json({ success: true, result });
val_aBl2zIzBr7
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_aBl2zIzBr7(req) {
try {
// Execute the code directly and capture its result
georgiaTechRegistration
@brownieinmotion
// ported from https://github.com/brownie-in-motion/gt-waitlist-bot
HTTP
const ENDPOINT = "https://oscar.gatech.edu/pls/bprod/bwckschd.p_disp_detail_sched";
const TERM = "202402";
export async function georgiaTechRegistration(request: Request): Promise<Response> {
const course = new URL(request.url).searchParams.get("courseId")?.toString();
if (course === undefined) return Response.json({ error: "missing courseId" });
![hungtd avatar](https://secure.gravatar.com/avatar/ee63589427f3253e1af67b0ca22c106d.jpg?s=200&d=identicon)
myApi
@hungtd
An interactive, runnable TypeScript val by hungtd
Script
export function myApi(name) {
return "hi " + name;
![endingwithali avatar](https://images.clerk.dev/oauth_github/img_2OfDxkjKK1seZnVOfJV4SsRAc43.jpeg)
newendpoint
@endingwithali
An interactive, runnable TypeScript val by endingwithali
Script
export function newendpoint() {
return "hello";
dream_interpreter
@nwcphd
interpret your dream
Cron
export default async function(interval) {
// Sample phrases and words that are likely to appear in dream descriptions
const introPhrases = [
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
testMutateSemantics2
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { TEST_API } from "https://esm.town/v/stevekrouse/TEST_API";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export async function testMutateSemantics2({
stateName,
mutateExpected,
![vawogbemi avatar](https://images.clerk.dev/oauth_github/img_2TXrDk0iTsMgo2T7z93Wn4eqcgK.jpeg)
solanaPayDemo
@vawogbemi
Solana Pay Demo A fork of solana-pay-qrcode-generator
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function Home() {
const [storeName, setStoreName] = useState("");
</div>
function client() {
createRoot(document.getElementById("root")).render(<Home />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(
tapMochaToNode
@barelyhuman
tapMochaToNode A simple codemod to modify existing node tap v16 mocha style tests to node:test runner syntax. It still keeps the tap assertion utils but replaces everything else to use node's runner instead.
Script
run();
async function run() {
if (!import.meta.main) return;
await Deno.writeTextFile(file, tranformed);
export function transform(code: string, { typescript = false } = {}) {
const parserOptions: Partial<recast.Options> = {};
return recast.prettyPrint(ast).code;
function removeMochaGlobal(
path: NodePath,
return true;
function makeBlocksAsync(
path: NodePath,
const fnNode = path.node.arguments[1];
makeFunctionNodeAsync(fnNode, { asserts });
awaitNestedStatements(path, { asserts, builder });
return true;
function makeFunctionNodeAsync(
node: any,
if (
asserts.ArrowFunctionExpression.check(node) ||
asserts.FunctionExpression.check(node)
return;
node.async = true;
function awaitNestedStatements(
path: NodePath,