cephalization
software-er
Likes
3
cephalization
anthropicProxy
Script
https://simonwillison.net/2024/Aug/23/anthropic-dangerous-direct-browser-access/ THIS IS NO LONGER NECESSARY This Val will proxy anthropic HTTP requests from some frontend client, like langchain, so that you can utilize anthropic apis from the browser. Convert it to an HTTP val in order to use it (you may want to setup an ENV var / header to protect the endpoint with a secret key)
4
maxm
bloomingButton
Script
Add a blooming emoji effect when a button is clicked. Import this val as a module and add the bloom-button class to your button. Demo here: https://www.val.town/v/maxm/bloomingButtonDemo /** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request): Promise<Response> {
return new Response(
renderToString(
<>
<link rel="stylesheet" href="https://jenil.github.io/bulmaswatch/simplex/bulmaswatch.min.css" />
<div style={{ textAlign: "center", marginTop: "100px" }}>
<button className="is-success button bloom-button" id="treeButton">Click Me</button>
</div>
<script type="module" src="https://esm.town/v/maxm/bloomingButton" />
</>,
),
{ headers: { "content-type": "text/html" } },
);
}
2