dailyStandupBotmain.tsx1 match
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
23export default async function() {
4discordWebhook({
5url: Deno.env.get("engDiscord"),
pretendingToBeRunmain.tsx4 matches
1export default async function(req: Request): Promise<Response> {
2// Fork and enable me if you'd like, I did not want to expose my private vals.
3return new Response("disabled", { status: 500 });
13});
14}
15if (typeof resp.value !== "function") {
16return Response.json({
17error: { message: "The first export of this val is not a function and cannot be run with args" },
18}, {});
19}
22}
2324function getMainExport(
25mod: any,
26): { ok: true; value: any } | { ok: false; error: Error } {
1export default async function distance(req) {
2const searchParams = new URL(req.url).searchParams;
3const destinationA = encodeURIComponent(String(searchParams.get("a")).trim());
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
34export async function aqi(interval: Interval) {
5const location = "Brooklyn NY 11206"; // <-- change to place, city, or zip code
6const data = await easyAQI({ location });
1export default function(a: number, b: number) {
2return a + b;
3}
sillifierSlangifiermain.tsx3 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function App() {
7const [htmlInput, setHtmlInput] = useState("<h1>Hello, World!</h1>"); const [silliness, setSilliness] = useState(0);
8const [slang, setSlang] = useState(0);
90}
9192function client() {
93createRoot(document.getElementById("root")).render(<App />);
94}
98}
99100async function server(request: Request): Promise<Response> {
101if (request.method === "POST" && new URL(request.url).pathname === "/api/modify") {
102const { html, silliness, slang } = await request.json();
leadership_styles_inventorymain.tsx4 matches
41];
4243function shuffleArray(array) {
44const shuffled = [...array];
45for (let i = shuffled.length - 1; i > 0; i--) {
50}
5152function App() {
53const [questions, setQuestions] = useState([]);
54const [currentQuestion, setCurrentQuestion] = useState(0);
222}
223224function client() {
225createRoot(document.getElementById("root")).render(<App />);
226}
230}
231232export default async function server(request: Request): Promise<Response> {
233return new Response(`
234<html>
dailyScheduleTrackermain.tsx4 matches
236};
237238function AnalogueScheduleClock({
239schedule = defaultSchedule,
240todoList = defaultTodoList,
340}
341342function App() {
343return <AnalogueScheduleClock />;
344}
345346function client() {
347const rootElement = document.getElementById("root");
348if (rootElement) {
357}
358359export default async function server(request: Request): Promise<Response> {
360return new Response(
361`
transformEvalCodemain.tsx9 matches
2import ts from "npm:typescript";
34function createSourceFile(code: string) {
5return ts.createSourceFile(
6"index.tsx",
11}
1213function getInterestingChildren(node: ts.Node) {
14const children: ts.Node[] = [];
15node.forEachChild((c) => {
2021// From https://github.com/microsoft/TypeScript/blob/b3770e78527a379d2345412bbab5acc0bafe0090/src/compiler/utilitiesPublic.ts#L2313
22function isDeclarationStatementKind(kind: ts.SyntaxKind) {
23return (
24kind === ts.SyntaxKind.FunctionDeclaration
25|| kind === ts.SyntaxKind.MissingDeclaration
26|| kind === ts.SyntaxKind.ClassDeclaration
39// Returns true if `node` is a ECMAScript StatementListItem, otherwise false.
40// See §14.2 Block (https://tc39.es/ecma262/#sec-block) in the spec.
41function isESStatementListItem(node: ts.Node) {
42/*
43Some notes about the differences between the ECMAScript spec and what the
52return (
53(ts.isStatement(node) && !isDeclarationStatementKind(node.kind))
54|| ts.isFunctionDeclaration(node)
55|| ts.isVariableDeclaration(node)
56|| ts.isClassDeclaration(node)
58}
5960function hasModifier(node: ts.Node, kw: ts.SyntaxKind) {
61if (ts.canHaveModifiers(node)) {
62const modifiers = ts.getModifiers(node) ?? [];
68const { ExportKeyword, DeclareKeyword } = ts.SyntaxKind;
6970export function transform(code: string): string {
71const sourceFile = createSourceFile(code);
72const moduleItems = getInterestingChildren(sourceFile);
103if (ts.isVariableStatement(item)) {
104convertedCode.appendLeft(item.getStart(), "export ");
105} else if (ts.isFunctionDeclaration(item) || ts.isClassDeclaration(item)) {
106convertedCode.appendLeft(item.getStart(), "export ");
107} else if (ts.isExpressionStatement(item)) {
routineTrackerAppmain.tsx5 matches
21];
2223// Simple hash function for the password
24const simpleHash = (str) => {
25let hash = 0;
130};
131132function App() {
133const [completedTasks, setCompletedTasks] = useState([]);
134const [timerStates, setTimerStates] = useState(routineTasks.map(task => ({
149};
150151function fire(particleRatio, opts) {
152confetti({
153...defaults,
363}
364365function client() {
366createRoot(document.getElementById("root")).render(<App />);
367}
368if (typeof document !== "undefined") { client(); }
369370async function server(request: Request): Promise<Response> {
371return new Response(
372`