Search

Results include substring matches and semantically similar vals. Learn more
begoon avatar
slackbot
@begoon
A simple Slack chat bot prototype able to reply to mentions, channel messages containing keywords, add reactions and act on the slash commands.
HTTP
rototype able to reply to mentions, channel messages containing keywords, add reactions and act on the slash commands.
body: JSON.stringify({ channel, text, thread_ts }),
async function reaction(channel: string, timestamp: string, name: string = "thumbsup") {
return await fetchJSON(
"https://slack.com/api/reactions.add",
headers: { "Authorization": `Bearer ${SLACK_BOT_TOKEN}` },
await message(channel, "<@" + event.user + ">: all good!");
console.log("reaction", await reaction(channel, event.ts));
return Response.json({ ok: true });
liamdanielduffy avatar
REACT_DOM_MINIFIED_FINAL
@liamdanielduffy
//this is necessary because I can't store the entire React DOM minified code inside a Val as a string, too long :()
Script
import { REACT_DOM_MINIFIED_PT4 } from "https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT4";
import { REACT_DOM_MINIFIED_PT3 } from "https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT3";
import { REACT_DOM_MINIFIED_PT2 } from "https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT2";
import { REACT_DOM_MINIFIED_PT1 } from "https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT1";
//this is necessary because I can't store the entire React DOM minified code inside a Val as a string, too long :()
export const REACT_DOM_MINIFIED_FINAL = [
REACT_DOM_MINIFIED_PT1,
REACT_DOM_MINIFIED_PT2,
REACT_DOM_MINIFIED_PT3,
REACT_DOM_MINIFIED_PT4,
curtcox avatar
blob_admin
@curtcox
Blob Admin This is a lightweight Blob Admin interface to view and debug your Blob data. Forl this val to install: It uses basic authentication with your Val Town API Token as the password (leave the username field blank). TODO [ ] handle non-textual blobs properly [ ] upload a blob by dragging it in (ondrop dropzone on the whole homepage) [ ] add upload/download buttons [ ] merge edit and view pages [ ] add client side navigation using htmx [ ] use codemirror instead of a textarea for editing text blobs
HTTP (deprecated)
- [ ] merge edit and view pages
- [ ] add client side navigation using htmx
- [ ] use codemirror instead of a textarea for editing text blobs
skyehersh avatar
date_me_docs_table
@skyehersh
@jsxImportSource https://esm.sh/preact
Script
/** @jsxImportSource https://esm.sh/preact */
import { getDocs } from "https://esm.town/v/stevekrouse/getSqliteDateMeDocs";
let linkClass = "text-sky-600 hover:text-sky-500";
stevekrouse avatar
tursoOld
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export let tursoOld = async ({ url, authToken }) => {
// https://cdn.jsdelivr.net/npm/@libsql/client/web
const { createClient } = await import("https://esm.sh/@libsql/client/web");
return createClient({
url,
jxnblk avatar
useCodemirror
@jxnblk
// codemirror esm react hook
Script
// codemirror esm react hook
import { defaultKeymap } from "https://esm.sh/@codemirror/commands";
import { history } from "https://esm.sh/@codemirror/commands";
rectangularSelection,
} from "https://esm.sh/@codemirror/view";
import { useEffect, useRef, useState } from "https://esm.sh/react";
const baseExtensions = [
EditorView.lineWrapping,
keenanzucker avatar
stagingdailyschedule
@keenanzucker
@jsxImportSource npm:react
HTTP (deprecated)
/** @jsxImportSource npm:react **/
import { renderToString } from "npm:react-dom@18/server";
import { addDays } from "npm:date-fns";
.then((data) => data);
// ============= React Components =================
const Schedule = ({ data }) => {
jxnblk avatar
codeIconReact
@jxnblk
@jsxImportSource npm:react
Script
/** @jsxImportSource npm:react */
import React from "npm:react";
export default function CodeIcon(props: React.SVGProps<SVGSVGElement>) {
return (
willthereader avatar
AlgoliaDocumentaion
@willthereader
An interactive, runnable TypeScript val by willthereader
Script
Add InstantSearch configuration
Create a search.js file. It will contain configuration for algoliasearch client and InstantSearch.js UI.
import algoliasearch from 'algoliasearch/lite';
import { getPropertyByPath } from 'instantsearch.js/es/lib/utils';
const searchClient = algoliasearch('L3YFVOR7YL', '7fb55c7d480ef8b1ad09b55bf3d57afd');
const search = instantsearch({
indexName: 'Test_index',
searchClient,
search.addWidgets([
import { searchBox, hits } from 'instantsearch.js/es/widgets';
const searchClient = algoliasearch('L3YFVOR7YL', '7fb55c7d480ef8b1ad09b55bf3d57afd');
const search = instantsearch({
indexName: 'demo_ecommerce',
searchClient,
search.addWidgets([
Copy
const searchClient = algoliasearch('L3YFVOR7YL', '7fb55c7d480ef8b1ad09b55bf3d57afd');
const search = instantsearch({
indexName: 'demo_ecommerce',
searchClient,
search.addWidgets([
yarn create instantsearch-app 'getting-started'
To launch the app, type inside your terminal:
shell
gueejla avatar
helloworld
@gueejla
Hello val town!
HTTP (deprecated)
/** @jsxImportSource npm:react **/
import { renderToString } from "npm:react-dom@18/server";
export default (req: Request) => {
return new Response(
jxnblk avatar
ReactStreamDemo
@jxnblk
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { React, render } from "https://esm.town/v/jxnblk/ReactStream";
function App() {
const [count, setCount] = React.useState<number>(0);
return (
morsczx avatar
linkInBioTemplate
@morsczx
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request) {
return new Response(
stevekrouse avatar
isthegtrainfucked
@stevekrouse
@jsxImportSource https://esm.sh/preact
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/preact */
import { activeGTrainAlerts } from "https://esm.town/v/pbt/gtrainalerts?v=36";
import { render } from "npm:preact-render-to-string";
import Uwuifier from "npm:uwuifier";
export default async function(req: Request) {
alana avatar
myspace
@alana
Create your own Myspace profile, deployed to Val town. https://jdan-myspace.web.val.run Click "..." and select Fork to create your own. From there you can: Customize your own profile Or post on my wall by appending to messages and sending me a pull request
HTTP (deprecated)
"Middletown High School South",
"Middletown, NEW JERSEY",
"President: Computer Club",
start: "2006",
end: "2010",
cephalization avatar
anthropicProxy
@cephalization
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)
Script
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
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