openaiproxymain.tsx2 matches
1718type User = { id: string; username: string; tier: string };
19export default async function(req: Request): Promise<Response> {
20// Ensure only allowed pathnames are used
21const { pathname, search } = new URL(req.url);
8283// Free users are limited to gpt-4o-mini. Limit pro users to 10 expensive model requests.
84async function limitFreeModel(req: Request, user: User) {
85const input = await req.json();
86let model = "gpt-4o-mini";
sweetPeachEarthwormmain.tsx11 matches
25const PoweredByInfo = "";
2627function Hero({
28prompt,
29setPrompt,
4849<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
50Turn your ideas into fully functional apps in{" "}
51<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
52less than a second
132}
133134function App() {
135const previewRef = React.useRef<HTMLDivElement>(null);
136const [prompt, setPrompt] = useState("");
187});
188189function handleStarterPromptClick(promptItem: typeof prompts[number]) {
190setLoading(true);
191setTimeout(() => handleSubmit(promptItem.prompt), 0);
192}
193194async function handleSubmit(e: React.FormEvent | string) {
195if (typeof e !== "string") {
196e.preventDefault();
243}
244245function handleVersionChange(direction: "back" | "forward") {
246const { currentVersionIndex, versions } = versionHistory;
247if (direction === "back" && currentVersionIndex > 0) {
932);
933934function client() {
935const path = window.location.pathname;
936const root = createRoot(document.getElementById("root")!);
968}
969970function extractCodeFromFence(text: string): string {
971const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
972return htmlMatch ? htmlMatch[1].trim() : text;
973}
974975async function generateCode(prompt: string, currentCode: string) {
976const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
977if (starterPrompt) {
1018}
10191020export default async function cerebras_coder(req: Request): Promise<Response> {
1021// Dynamic import for SQLite to avoid client-side import
1022const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1121<meta property="og:site_name" content="Cerebras Coder">
1122<meta property="og:url" content="https://cerebrascoder.com"/>
1123<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1124<meta property="og:type" content="website">
1125<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
decoratorsExamplemain.tsx4 matches
1function logged() {
2return function(
3target: any,
4context: ClassMethodDecoratorContext,
5) {
6const methodName = String(context.name);
7return function(this: any, ...args: any[]) {
8console.log(`Calling method ${methodName}`);
9return target.call(this, ...args);
19}
2021export default function testDecorators() {
22const instance = new TestClass();
23return instance.greet("Val Town");
boggleSolverTowniemain.tsx5 matches
22}
2324function buildTrie(words: string[]): TrieNode {
25const root = new TrieNode();
26for (const word of words) {
37}
3839function findBoggleWords(board: { x: number; y: number; letter: string }[], wordList: string[]): string[] {
40const trie = buildTrie(wordList);
41const foundWords = new Set<string>();
55];
5657function isValidCell(x: number, y: number): boolean {
58return x >= 0 && x < cols && y >= 0 && y < rows;
59}
6061function dfs(x: number, y: number, node: TrieNode, visited: Set<string>, currentWord: string) {
62// Out of bounds or already visited cell
63const cellKey = `${x},${y}`;
99}
100101export default function boggleSolver(
102board: { x: number; y: number; letter: string }[],
103wordList: string[] = wordListCache || [],
mileiShowGraphmain.tsx3 matches
13} from "https://esm.sh/recharts@2.7.2?deps=react@18.2.0";
1415function App({ tweetData }) {
16const [selectedTweetId, setSelectedTweetId] = useState("1852746483306492004");
17const [filteredData, setFilteredData] = useState([]);
123}
124125function client() {
126const tweetData = JSON.parse(document.getElementById("tweet-data").textContent);
127createRoot(document.getElementById("root")).render(<App tweetData={tweetData} />);
129if (typeof document !== "undefined") { client(); }
130131export default async function server(request: Request): Promise<Response> {
132const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
133
cerebras_codermain.tsx11 matches
26const PoweredByInfo = "";
2728function Hero({
29prompt,
30setPrompt,
4748<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
49Turn your ideas into fully functional apps in{" "}
50<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
51less than a second
121}
122123function App() {
124const previewRef = React.useRef<HTMLDivElement>(null);
125const [prompt, setPrompt] = useState("");
175});
176177function handleStarterPromptClick(promptItem: typeof prompts[number]) {
178setLoading(true);
179setTimeout(() => handleSubmit(promptItem.prompt), 0);
180}
181182async function handleSubmit(e: React.FormEvent | string) {
183if (typeof e !== "string") {
184e.preventDefault();
231}
232233function handleVersionChange(direction: "back" | "forward") {
234const { currentVersionIndex, versions } = versionHistory;
235if (direction === "back" && currentVersionIndex > 0) {
920);
921922function client() {
923const path = window.location.pathname;
924const root = createRoot(document.getElementById("root")!);
956}
957958function extractCodeFromFence(text: string): string {
959const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
960return htmlMatch ? htmlMatch[1].trim() : text;
961}
962963async function generateCode(prompt: string, currentCode: string) {
964const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
965if (starterPrompt) {
1006}
10071008export default async function cerebras_coder(req: Request): Promise<Response> {
1009// Dynamic import for SQLite to avoid client-side import
1010const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1109<meta property="og:site_name" content="Cerebras Coder">
1110<meta property="og:url" content="https://cerebrascoder.com"/>
1111<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1112<meta property="og:type" content="website">
1113<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
cerebras_codermain.tsx11 matches
26const PoweredByInfo = "";
2728function Hero({
29prompt,
30setPrompt,
4748<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
49Turn your ideas into fully functional apps in{" "}
50<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
51less than a second
121}
122123function App() {
124const previewRef = React.useRef<HTMLDivElement>(null);
125const [prompt, setPrompt] = useState("");
175});
176177function handleStarterPromptClick(promptItem: typeof prompts[number]) {
178setLoading(true);
179setTimeout(() => handleSubmit(promptItem.prompt), 0);
180}
181182async function handleSubmit(e: React.FormEvent | string) {
183if (typeof e !== "string") {
184e.preventDefault();
231}
232233function handleVersionChange(direction: "back" | "forward") {
234const { currentVersionIndex, versions } = versionHistory;
235if (direction === "back" && currentVersionIndex > 0) {
920);
921922function client() {
923const path = window.location.pathname;
924const root = createRoot(document.getElementById("root")!);
956}
957958function extractCodeFromFence(text: string): string {
959const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
960return htmlMatch ? htmlMatch[1].trim() : text;
961}
962963async function generateCode(prompt: string, currentCode: string) {
964const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
965if (starterPrompt) {
1006}
10071008export default async function cerebras_coder(req: Request): Promise<Response> {
1009// Dynamic import for SQLite to avoid client-side import
1010const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1109<meta property="og:site_name" content="Cerebras Coder">
1110<meta property="og:url" content="https://cerebrascoder.com"/>
1111<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1112<meta property="og:type" content="website">
1113<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
TaskManagerAppmain.tsx6 matches
2526/** A form to create or edit a single task (used both stand-alone and in a modal). */
27function TaskForm({
28task,
29onSave,
179180/** A table that displays tasks. */
181function TaskList({
182tasks,
183onEditClick,
323}
324325function SettingsOverlay({
326columnWidths,
327onColumnWidthChange,
363}
364365function App() {
366const [tasks, setTasks] = useState<Task[]>([]);
367const [editingTask, setEditingTask] = useState<Task | undefined>(undefined);
597}
598599function client() {
600const rootElement = document.getElementById("root");
601if (rootElement) {
605if (typeof document !== "undefined") { client(); }
606607export default async function server(request: Request): Promise<Response> {
608return new Response(
609`
7const cacheKey = location => "easyAQI_locationID_cache_" + encodeURIComponent(location);
89export async function easyAQI({ location }: {
10location: string;
11}) {
redditAlertREADME.md2 matches
42- Value: Your SERP API key.
4344Without this key, the val will not function correctly.
4546---
58- Key: `mentionsDiscord`
59- Value: Your Discord webhook URL.
60Notifications will be sent using this function:
61```
62await discordWebhook({