1export default async function(req: Request): Promise<Response> {
2return Response.json({
3image_url: "https://jon.bo/IMG_9387.png",
testPondiversegetCreations1 match
3import { TABLE_NAME } from "./updateTable";
45export default async function(req: Request): Promise<Response> {
6// First, get the row IDs of all rows that are older than 25 hours old
7const res = await sqlite.execute(`
blob_adminapp.tsx7 matches
10}
1112function Tooltip({ children, content }: TooltipProps) {
13const [isVisible, setIsVisible] = useState(false);
14const tooltipRef = useRef<HTMLDivElement>(null);
49}
5051function formatBytes(bytes: number, decimals = 2) {
52if (bytes === 0) return "0 Bytes";
53const k = 1024;
58}
5960function copyToClipboard(text: string) {
61navigator.clipboard.writeText(text).then(() => {
62console.log("Text copied to clipboard");
66}
6768function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
69const [isOpen, setIsOpen] = useState(false);
70const menuRef = useRef(null);
7374useEffect(() => {
75function handleClickOutside(event) {
76if (menuRef.current && !menuRef.current.contains(event.target)) {
77event.stopPropagation();
155}
156157function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
158const [isLoading, setIsLoading] = useState(false);
159const decodedKey = decodeURIComponent(blob.key);
216}
217218function App({ initialEmail, initialProfile, sourceURL }) {
219const encodeKey = (key: string) => encodeURIComponent(key);
220const decodeKey = (key: string) => decodeURIComponent(key);
testPondiversegetCreation1 match
3import { TABLE_NAME } from "./updateTable";
45export default async function(req: Request): Promise<Response> {
6const url = new URL(req.url);
7const id = url.searchParams.get("id");
untitled-2604new-file-9513.tsx12 matches
3// Fecha: 05 de mayo de 2025
45export default async function handler(req) {
6// Configuración CORS para permitir solicitudes desde cualquier origen
7const headers = {
112113// Función para llamar a la API de OpenAI
114async function callOpenAI(apiKey, prompt, model, temperature, maxTokens) {
115const url = 'https://api.openai.com/v1/chat/completions';
116
171172// Función para llamar a la API de Claude (Anthropic)
173async function callClaude(apiKey, prompt, model, temperature, maxTokens) {
174const url = 'https://api.anthropic.com/v1/messages';
175
237238// Función para renderizar la interfaz de usuario
239function renderUI() {
240return `
241<!DOCTYPE html>
398const tempSlider = document.getElementById('temperature');
399const tempValue = document.getElementById('temperatureValue');
400tempSlider.addEventListener('input', function() {
401tempValue.textContent = tempSlider.value;
402});
404// Cambiar entre pestañas
405const tabs = document.querySelectorAll('.tab');
406tabs.forEach(function(tab) {
407tab.addEventListener('click', function() {
408const tabName = tab.getAttribute('data-tab');
409
410// Desactivar todas las pestañas
411document.querySelectorAll('.tab').forEach(function(t) {
412t.classList.remove('active');
413});
414document.querySelectorAll('.tab-content').forEach(function(c) {
415c.classList.remove('active');
416});
433const modelSelect = document.getElementById('model');
434
435providerSelect.addEventListener('change', function() {
436const provider = providerSelect.value;
437
451});
452
453function addOption(select, value, text) {
454const option = document.createElement('option');
455option.value = value;
463const rawResult = document.getElementById('rawResult');
464
465submitBtn.addEventListener('click', async function() {
466const provider = document.getElementById('provider').value;
467const apiKey = document.getElementById('apiKey').value;
testPondiversedeleteCreation1 match
4import { TABLE_NAME } from "./updateTable";
56export default async function(req: Request): Promise<Response> {
7// body contains:
8// - id (number)
morningmailmain.tsx4 matches
2import { email } from "https://esm.town/v/std/email";
34function links(): string {
5var links = "- [Gisnep](https://gisnep.com)\n";
6links = links + "- [Gin](https://cardgames.io/ginrummy)\n";
10}
1112async function weather(): string {
13var weather = await blob.getJSON(Deno.env.get("WEATHER_BLOB"));
14weather = weather.forecast;
17}
1819async function wikitext(): string {
20const randomArticle = await fetch(
21"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&exintro&explaintext&redirects=1&generator=random&formatversion=2&grnnamespace=0&grnlimit=3",
31}
3233export default async function(interval: Interval) {
34var emailText = "";
35emailText = emailText + await weather();
18const lruCache = new LRUCache(ttlOptions);
1920export default async function(req: Request): Promise<Response> {
21const searchParams = new URL(req.url).searchParams;
22const discussionId = searchParams.get("discussion");
79}
8081async function getDiscussionPosts(discussionId: string): Promise<PostT[]> {
82// Used to get the list of post id's for the discussion.
83const discussionRes = await fetch(`${server}/api/discussions/${discussionId}`);
117118// This takes an array and chunks it.
119function chunkArray<T>(array: T[], chunkSize: number): T[][] {
120const chunks: T[][] = [];
121for (let i = 0; i < array.length; i += chunkSize) {
testOpenAIblah.tx1 match
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
TownieuseAuth.tsx1 match
5const ANTHROPIC_KEY = "anthropic_api_key";
67export function useAuth() {
8const [token, setToken, removeToken] = useLocalStorage(TOKEN_KEY, "");
9const [anthropicApiKey, setAnthropicApiKey, removeAnthropicApiKey] = useLocalStorage(ANTHROPIC_KEY, "");