design32x32bitmapmain.tsx5 matches
28};
2930function generateName(pattern: string): string {
31return pattern.replace(/<(\w+)>/g, (match, p1) => {
32switch (p1) {
189const Pixel = ({ active }) => <div className={`pixel ${active ? "active" : ""}`} />;
190191function App() {
192const [size, setSize] = useState<{ width: number; height: number }>(DEFAULT_SIZE);
193const [pixels, setPixels] = useState<boolean[]>(() =>
431}
432433function client() {
434try {
435const root = createRoot(document.getElementById("root"));
452}
453454async function server(request: Request): Promise<Response> {
455return new Response(
456`
467<div id="root"></div>
468<script>
469window.onerror = function(message, source, lineno, colno, error) {
470console.error("Global error caught:", message, "at", source, ":", lineno, ":", colno);
471console.error("Error object:", error);
zestyJadeReptilemain.tsx1 match
3import process from "node:process";
45export async function serverlessMatrixEchoBot(
6req: express.Request,
7res: express.Response,
capturePostHogEventmain.tsx1 match
1export async function capturePostHogEvent(
2key: string,
3distinct_id: string,
peculiarTanMouseREADME.md1 match
1Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
calculateTransitTimeValmain.tsx9 matches
8import { createRoot } from "https://esm.sh/react-dom/client";
910function App() {
11const [origin, setOrigin] = useState("");
12const [results, setResults] = useState([]);
149}
150151function client() {
152createRoot(document.getElementById("root")).render(<App />);
153}
157}
158159export default async function server(request: Request): Promise<Response> {
160console.log("Received request:", request.url);
161const url = new URL(request.url);
285});
286} catch (error) {
287console.error("Error in server function:", error);
288return new Response(
289JSON.stringify({ error: "An error occurred while calculating travel times", details: error.message }),
315}
316317async function findNearest(origin: string, locations: any[], apiKey: string): Promise<any> {
318console.log(`Finding nearest location among ${locations.length} options`);
319const batchSize = 25; // Google Maps API typically allows up to 25 destinations per request
359}
360361async function getDrivingTime(
362origin: string,
363destination: string,
388}
389390async function getTransitTime(origin: string, destination: string, apiKey: string): Promise<string> {
391const directionsUrl = `https://maps.googleapis.com/maps/api/directions/json?origin=${
392encodeURIComponent(origin)
405}
406407async function getZipCode(address: string, apiKey: string): Promise<string> {
408const geocodeUrl = `https://maps.googleapis.com/maps/api/geocode/json?address=${
409encodeURIComponent(address)
422}
423424function getNextDayOfWeek(date: Date, dayOfWeek: string): Date {
425const days = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
426const targetDay = days.indexOf(dayOfWeek.toLowerCase());
free_open_routermain.tsx7 matches
59}
6061// Factory function to create the appropriate KV instance
62export function createKV(): KV {
63return isValTown ? new ValTownKV() : new DenoDeployKV();
64}
66const kv = createKV();
6768function err(msg): Response {
69return new Response(
70JSON.stringify({
84}
8586function isFreeModel(model: any) {
87if (model.id.endsWith(":free")) {
88return true;
98}
99100function getModelValue(modelId: string): int {
101const preferences = [
102[/70b-versatile/],
132}
133134async function listFreeModels(req: Request) {
135// Get the current timestamp
136const timestamp = Date.now();
227}
228229export default async function(req: Request): Promise<Response> {
230const url = new URL(req.url);
231const pathname = url.pathname;
celinewaitlistmain.tsx1 match
5*/
67async function server(request: Request): Promise<Response> {
8const { blob } = await import("https://esm.town/v/std/blob");
9const KEY = "celinewaitlist";
openapi_playgroundmain.tsx1 match
237return c.html(<App code={code} />);
238});
239function template(code: string) {
240return `import { makeServer } from "https://esm.town/v/stainless_em/openapiPlaygroundServer"\nexport default makeServer(${
241JSON.stringify(YAML.parse(code))
15body: string;
16};
17export async function handle(req: Request) {
18const id = new URL(req.url).hostname.match(/^websandbox-(play_[^\.]+)/)[1];
19const code = await (await blob.get(id)).text();
49}
50}
51export async function inner(serializedRequest: SerializedRequest, code: string): Promise<SerializedResponse> {
52try {
53const req = new Request(serializedRequest.url, {