This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function backupCurrentRoom() { | |
| // --- find db --- | |
| const dbs = await indexedDB.databases(); | |
| const dbEntry = dbs.find(db => db.name.includes(':org_')) | |
| ?? dbs.find(db => db.name.startsWith('openrouter:playground:')); | |
| if (!dbEntry) { | |
| console.error('No OpenRouter database found. Make sure you are on openrouter.ai'); | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function fullBackup() { | |
| // --- find db --- | |
| const dbs = await indexedDB.databases(); | |
| const dbEntry = dbs.find(db => db.name.includes(':org_')) | |
| ?? dbs.find(db => db.name.startsWith('openrouter:playground:')); | |
| if (!dbEntry) { | |
| console.error('No OpenRouter database found. Make sure you are on openrouter.ai'); | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (async function backup(){const sanitizeFilename=s=>s.replace(/[/\\?%*:|"<>]/g,'-');const sleep=ms=>new Promise(r=>setTimeout(r,ms));const BINARY_EXTENSIONS=new Set(['png','jpg','jpeg','gif','webp','svg','ico','pdf','zip','tar','gz','wasm','ttf','woff','woff2']);function getOrgUuid(){const orgUuid=document.cookie.match(/lastActiveOrg=([^;]+)/)?.[1];if(!orgUuid){throw new Error('No orgUuid found in cookies')}return orgUuid}function getConversationFromReactFiber(){const msgEl=document.querySelector('[data-testid="user-message"]');if(!msgEl){throw new Error('No user-message element found in DOM')}const fiberKey=Object.keys(msgEl).find(k=>k.startsWith('__reactFiber'));let fiber=msgEl[fiberKey];for(let depth=0;fiber&&depth<100;fiber=fiber.return,depth+=1){if(fiber.memoizedProps?.conversation?.chat_messages){return fiber.memoizedProps.conversation}}throw new Error('conversation not found in React fiber tree')}async function fetchFileAsEmbeddable(url,filename){const ext=filename.split('.').pop().toLowerCase();const i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Define variables | |
| store_dir="/nix/store" | |
| gcroots_dir="/nix/var/nix/gcroots" | |
| action="$1" | |
| flake_dir="$2" | |
| flake_path="$flake_dir/flake.nix" |