Search

Results include substring matches and semantically similar vals. Learn more
willthereader avatar
mythBusterGraduationEdition
@willthereader
@jsxImportSource https://esm.sh/preact
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/preact */
export default async function(req: Request) {
return new Response(
render(
<html>
<head>
<title>Year Input</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-50 flex items-center justify-center h-screen">
yawnxyz avatar
instantDbTest
@yawnxyz
// ID for app: wonderful-wombat
Script
// ID for app: wonderful-wombat
const INSTANT_APP_ID = '39d1e341-f09a-4e77-8d5b-d368f65531b2';
const INSTANT_ADMIN_TOKEN = '86de53ab-eddb-4349-aed1-0665e55a74c0';
const db = init({
appId: INSTANT_APP_ID,
adminToken: INSTANT_ADMIN_TOKEN,
db?.transact(
tx?.messages?.[id()]?.update({
text: "banana!"
// // db.subscribeQuery({ todos: {} }, (resp) => {
yawnxyz avatar
limeDeer
@yawnxyz
this is used by a bunch of things as a "ping" so don't archive or delete it lol
Script
this is used by a bunch of things as a "ping" so don't archive or delete it lol
export default async function what() {
console.log("what");
pomdtr avatar
blog_mdx
@pomdtr
@jsxImportSource https://esm.sh/preact
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/preact **/
const css = `
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
@media (max-width: 767px) {
.markdown-body {
stevekrouse avatar
getWeather
@stevekrouse
Get Weather Simple function to get weather data from the free wttr.in service. import { getWeather } from "https://esm.town/v/stevekrouse/getWeather"; let weather = await getWeather("Brooklyn, NY"); console.log(weather.current_condition[0].FeelsLikeF)
Script
## Get Weather
Simple function to get weather data from the free [wttr.in](https://wttr.in/:help) service.
```ts
let weather = await getWeather("Brooklyn, NY");
console.log(weather.current_condition[0].FeelsLikeF)
export async function getWeather(location: string): Promise<WeatherResponse> {
return fetchJSON(`https://wttr.in/${location}?format=j1`);
export interface WeatherResponse {
current_condition: CurrentCondition[];
nearest_area: NearestArea[];
andreterron2 avatar
trpcRouter
@andreterron2
An interactive, runnable TypeScript val by andreterron2
Script
export const trpcRouter = await import("npm:@trpc/server");
pps avatar
sqliteExplorerApp
@pps
fork of @nbbaier/sqliteExplorerApp with my authentication middleware
HTTP (deprecated)
fork of @nbbaier/sqliteExplorerApp with my authentication middleware
/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
EditorSection,
MockTable,
Separator,
Table,
TablesList,
} from "https://esm.town/v/nbbaier/sqliteStudioComponents";
authMiddlewareCookie,
type HonoEnv,
stevekrouse avatar
poembuilder
@stevekrouse
@jsxImportSource npm:hono@3/jsx
HTTP (deprecated)
/** @jsxImportSource npm:hono@3/jsx */
// await sqlite.execute(`
// CREATE TABLE IF NOT EXISTS poemlines2 (
// id INTEGER PRIMARY KEY autoincrement,
// line TEXT,
// safe TEXT
const app = new Hono();
app.get("/", async (c) => {
const poem = await sqlite.execute(`SELECT id, line FROM poemlines2 WHERE safe='SAFE'`);
return c.html(
postpostscript avatar
readmeManager
@postpostscript
@postpostscript/readmeManager: Edit Val Readmes With Persistent Drafts edit this readme Todo: [ ] Upload images [ ] Autosave/save without reloading page [ ] Ctrl+S [ ] Multiple draft versions [ ] Switch to dark codemirror theme which has markdown styling [ ] Allow for checking checkboxes in preview [ ] View with just the preview [ ] Ability to favorite vals on the Home page
HTTP (deprecated)
# @postpostscript/readmeManager: Edit Val Readmes With Persistent Drafts
[edit this readme](https://postpostscript-readmemanager.web.val.run/postpostscript/readmeManager)
![image.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/bd8f6038-e02f-451a-a9d1-38703835a900/public)
![image.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/b31ab6d8-ebd6-4072-dea1-eeb8c42cf400/public)
Todo:
- [ ] Upload images
/** @jsxImportSource https://esm.sh/hono/jsx */
const app = new Hono<HonoEnv>();
app.use(
authMiddlewareCookie({
sethblanchard avatar
MoonPhase
@sethblanchard
@jsxImportSource npm:react
HTTP (deprecated)
/** @jsxImportSource npm:react **/
export default async (req: Request) => {
const html = await fetchText(
"https://www.moongiant.com/phase/today/",
const $ = load(html);
const todayContents = [...$("#today_").contents()].filter(e => e.type === "text" && $(e).text().trim())
.map(e => $(e).text().trim());
const moonIcon = `:${todayContents[0].toLowerCase().replace(" ", "_")}_moon:`;
console.log(moonIcon);
* //This is the way Slack wants it.
nbbaier avatar
tanaSave
@nbbaier
An interactive, runnable TypeScript val by nbbaier
Script
const token = Deno.env.get("tanaInputAPI");
export const tanaSave = async (req: Request) => {
const app = new Hono();
app.get("/save", async c => {
let { text, url } = c.req.query();
const payload: APIPlainNode = {
name: text,
children: [
{ name: "child 1" },
{ type: "field", attributeId: "cwi23sOzRSh8" },
janpaul123 avatar
valle_tmp_02267091431922629935130311039563566
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
const vt = new ValTown({ bearerToken: Deno.env.get("valtown") });
const username = "janpaul123";
const app = new Hono();
const jsxResponse = (jsx) => {
return new Response(renderToString(jsx), { headers: { "Content-Type": "text/html" } });
const systemprompt = `
The conversation below is your recent interaction with the user.
Your entire response should only be TypeScript.
Your response should start with \`\`\`ts and end with \`\`\`.
ccallaway93 avatar
test
@ccallaway93
An interactive, runnable TypeScript val by ccallaway93
Script
export async function test() {
const { default: axios } = await import("npm:axios");
const url = "http://207.244.232.58:8011/api/login";
const message = "testing";
const loginInfo = {
username: "HAZAH",
password: "HAZAHisOP1!",
try {
const response = await axios.post(url, loginInfo);
const data = response.json();
lazyplatypus avatar
chatWithCerebras
@lazyplatypus
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
const MODELS = ["llama3.1-8b", "llama3.1-70b"];
function App() {
const [messages, setMessages] = useState<Array<{ role: string; content: string }>>([]);
const [edits, setEdits] = useState<Array<{ id: number; content: string }>>(
const [input, setInput] = useState("");
const [isLoading, setIsLoading] = useState(false);
const [htmlOutput, setHtmlOutput] = useState("");
const [selectedModel, setSelectedModel] = useState(MODELS[0]);
const messagesEndRef = useRef<HTMLDivElement>(null);
vladimyr avatar
nhttpExample
@vladimyr
An interactive, runnable TypeScript val by vladimyr
HTTP (deprecated)
import nhttp from "npm:nhttp-land@1";
const app = nhttp();
app.get("/", () => "Hello from nhttp");
app.get("/cat", () => ({ name: "cat" }));
export default denoServer(app.handle);