stiffCoffeeLampreyREADME.md1 match
11import { email } from "https://esm.town/v/std/email?v=13";
1213export default async function (interval: Interval) {
14const bookingInfo = await resyBot( {
15slug: 'amaro-bar',
11import { email } from "https://esm.town/v/std/email?v=13";
1213export default async function (interval: Interval) {
14const bookingInfo = await resyBot( {
15slug: 'amaro-bar',
frozenSapphireIguanamain.tsx9 matches
8import { createRoot } from "https://esm.sh/react-dom/client";
910function App() {
11const [origin, setOrigin] = useState("");
12const [results, setResults] = useState([]);
237}
238239function client() {
240createRoot(document.getElementById("root")).render(<App />);
241}
245}
246247export default async function server(request: Request): Promise<Response> {
248console.log("Received request:", request.url);
249const url = new URL(request.url);
373});
374} catch (error) {
375console.error("Error in server function:", error);
376return new Response(JSON.stringify({ error: "An error occurred while calculating travel times", details: error.message }), {
377headers: { "Content-Type": "application/json" },
397}
398399async function findNearest(origin: string, locations: any[], apiKey: string): Promise<any> {
400console.log(`Finding nearest location among ${locations.length} options`);
401const batchSize = 25; // Google Maps API typically allows up to 25 destinations per request
439}
440441async function getDrivingTime(origin: string, destination: string, apiKey: string, arrivalTime?: string, arrivalDay?: string): Promise<string> {
442let directionsUrl = `https://maps.googleapis.com/maps/api/directions/json?origin=${encodeURIComponent(origin)}&destination=${encodeURIComponent(destination)}&mode=driving&key=${apiKey}`;
443
460}
461462async function getTransitTime(origin: string, destination: string, apiKey: string): Promise<string> {
463const directionsUrl = `https://maps.googleapis.com/maps/api/directions/json?origin=${encodeURIComponent(origin)}&destination=${encodeURIComponent(destination)}&mode=transit&key=${apiKey}`;
464475}
476477async function getZipCode(address: string, apiKey: string): Promise<string> {
478const geocodeUrl = `https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(address)}&key=${apiKey}`;
479const response = await fetch(geocodeUrl);
490}
491492function getNextDayOfWeek(date: Date, dayOfWeek: string): Date {
493const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
494const targetDay = days.indexOf(dayOfWeek.toLowerCase());
grievingYellowAspmain.tsx3 matches
6import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
78// Utility functions
9const performSingleRequest = async (url) => {
10const start = performance.now();
46};
4748// Helper function to safely format numbers
49const safeToFixed = (number, decimalPlaces) => {
50return number !== undefined && number !== null
286}
287288export default async function(req: Request): Promise<Response> {
289const stream = await renderToReadableStream(<App />, { bootstrapModules: [import.meta.url] });
290return new Response(stream, { headers: { "content-type": "text/html" } });
checkHackerNewsForPatreonmain.tsx2 matches
9const TABLE_NAME = `${KEY}_notified_stories`;
1011async function initializeDatabase() {
12await sqlite.execute(`
13CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
19}
2021async function checkHackerNewsForPatreon() {
22await initializeDatabase();
23
serveUtilsmain.tsx4 matches
1export function getFunctionComment(fn) {
2try {
3return fn.toString().match(/\/\*\s*(.+)\s*\*\//s)[1];
4} catch (err) {
5console.error(`Failed to get function comment: ${err.message}\n${fn.toString()}`);
6throw err;
7}
8}
910export function serve(fn, contentType = 'text/plain') {
11return (ctx) => {
12return new Response(getFunctionComment(fn), {
13headers: {
14'Content-Type': contentType,
timeZoneCompareToolmain.tsx6 matches
16];
1718// Helper function to group timezones by country
19function groupTimezonesByCountry(timezones) {
20return timezones.reduce((acc, zone) => {
21const [continent, ...rest] = zone.split('/');
62];
6364function TimezoneSelect({ onSelect }) {
65const [selectedZone, setSelectedZone] = useState("");
66const groupedTimezones = useMemo(() => groupTimezonesByCountry(DateTime.ZONE_NAMES || []), []);
101}
102103function App({ initialTime }: { initialTime: string }) {
104const [currentTime, setCurrentTime] = useState(DateTime.now());
105const [userTimezone, setUserTimezone] = useState("");
163}
164165function TimezoneRow({ zone, currentTime }: { zone: string; currentTime: DateTime }) {
166const localTime = currentTime.setZone(zone || 'UTC');
167const offset = localTime.offset / 60;
192}
193194async function server(request: Request): Promise<Response> {
195try {
196// Set CORS headers
1import { email } from "https://esm.town/v/std/email";
23export default async function handler(request: Request) {
4if (request.method !== "POST") {
5return Response.json({ message: "This val responds to POST requests." }, {
add_to_notion_w_aimain.tsx9 matches
35});
3637function createPrompt(title, description, properties) {
38let prompt =
39"You are processing content into a database. Based on the title of the database, its properties, their types and options, and any existing descriptions, infer appropriate values for the fields:\n";
80}
8182function processProperties(jsonObject) {
83const properties = jsonObject.properties;
84const filteredProps = {};
111}
112113async function get_and_save_notion_db_processed_properties(databaseId)
114{
115const response = await notion.databases.retrieve({ database_id: databaseId });
122}
123124async function get_notion_db_info(databaseId) {
125databaseId = databaseId.replaceAll("-", "");
126let db_info = null;
137}
138139async function get_and_save_notion_db_info(databaseId) {
140databaseId = databaseId.replaceAll("-", "");
141let db_info = await get_and_save_notion_db_processed_properties(databaseId);
144}
145146function createZodSchema(filteredProps) {
147const schemaObject = {};
148193}
194195function convertToNotionProperties(responseValues, filteredProps) {
196const notionProperties = {};
197268}
269270async function process_text(dbid, text) {
271const db_info = await get_notion_db_info(dbid);
272const processed_message = await client.chat.completions.create({
283}
284285async function addToNotion(databaseId, text) {
286databaseId = databaseId.replaceAll("-", "");
287const properties = await process_text(databaseId, text);
chatWithCerebrasmain.tsx3 matches
56const MODELS = ["llama3.1-8b", "llama3.1-70b"];
7function App() {
8const [messages, setMessages] = useState<Array<{ role: string; content: string }>>([]);
9const [edits, setEdits] = useState<Array<{ id: number; content: string }>>(
128}
129130function client() {
131createRoot(document.getElementById("root")).render(<App />);
132}
136}
137138async function server(request: Request): Promise<Response> {
139if (request.method === "POST" && new URL(request.url).pathname === "/api/chat") {
140const { messages, model } = await request.json();