Search
vimarkdown
@jxnblk
vimarkdown Try it now A VIM-mode markdown editor built with Val Town . Features Write markdown in the browser with VIM keybindings Minimal, focused UI Saves to localStorage Multiple color modes Markdown -> HTML preview (⌘+P) NOT mobile-friendly Fork this editor on Val Town to make it your own Inspired by iA Writer
Made by Jxnblk TODO [ ] Add syntax highlighting to frontmatter block [ ] Support multiple fonts
HTTP
/** @jsxImportSource https://esm.sh/react */
import { ViewUpdate } from "https://esm.sh/@codemirror/view";
import graymatter from "https://esm.sh/gray-matter";
import { useEffect, useMemo, useState } from "https://esm.sh/react";
import { GoogleFonts } from "https://esm.town/v/jxnblk/reactGoogleFonts";
// preview
import ReactMarkdown from "https://esm.sh/react-markdown@9";
import rehypeSanitize from "https://esm.sh/rehype-sanitize@6";
// vals
import { render } from "https://esm.town/v/jxnblk/ReactStream";
import { EditorView, Prec, useCodemirror } from "https://esm.town/v/jxnblk/useCodemirrorVimMD";
console.log("vim-mode-change", e);
const handleKeyDown = (e: React.KeyboardEvent) => {
// check for insert mode?
</pre>
<ReactMarkdown
children={content}
notUberRides
@vawogbemi
@jsxImportSource https://esm.sh/react@18.2.0
Script
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import { init } from "https://esm.sh/@instantdb/react?deps=react@18.2.0";
import { IconCar, IconCarFilled } from "https://esm.sh/@tabler/icons-react?deps=react@18.2.0";
import { useNavigate } from "https://esm.sh/react-router-dom?deps=react@18.2.0";
import React from "https://esm.sh/react@18.2.0";
import { INSTANTDB_APP_ID } from "https://esm.town/v/vawogbemi/notUberConsts";
valTownSearch
@pomdtr
Val Town Search Search for vals using the Github API. Either use the provided UI, or the query param: https://val-town-search.pomdtr.me/search?q=fetchJSON How does it work ? I've wrote about it! Todos [x] Embed the results in the UI [x] Refresh the vals on a cron using a github action [ ] Improve layout on small screens [ ] Support json Accept header [ ] Add pagination params [ ] Allow to filter by authors
HTTP
/** @jsxImportSource npm:preact **/
import codeOnValTown from "https://esm.town/v/andreterron/codeOnValTown?v=50";
import { render } from "npm:preact-render-to-string";
const githubQuery = (query: string) => encodeURIComponent(`${query} repo:pomdtr/val-town-mirror path:vals/`);
async function handler(req: Request) {
ChatGPTTextDefinitionUserscript
@xsec
// @name Improved ChatGPT Text Definition
Script
const contentElement = document.querySelector(".p-body-inner");
if (!contentElement) return { width: window.innerWidth, height: window.innerHeight };
const contentRect = contentElement.getBoundingClientRect();
const availableWidth = window.innerWidth - contentRect.right;
const availableHeight = window.innerHeight;
val_town_client
@stevekrouse
* Create a Valtown API client
* @param options - Valtown API client options
* @param options.baseUrl - API base URL
* @param options.token - API token (if null, no token will be used, if undefined, the token from the environment variable "valtown" will be used)
Script
import { paths } from "https://esm.town/v/pomdtr/openapi_schema";
import createClient2 from "npm:openapi-fetch";
* Create a Valtown API client
* @param options - Valtown API client options
* @param options.baseUrl - API base URL
* @param options.token - API token (if null, no token will be used, if undefined, the token from the environment variable "valtown" will be used)
export default function createClient(options: {
baseUrl?: string;
token?: string | null | undefined;
return createClient2<paths>({
baseUrl: options?.baseUrl ?? "https://api.val.town",
ilyBday
@emilycoe
@jsxImportSource https://esm.sh/preact
HTTP
/** @jsxImportSource https://esm.sh/preact */
import { render } from "npm:preact-render-to-string";
export default async function(req: Request) {
return new Response(
ardentVioletSwordfish
@rahul97
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import React, { useState, useEffect, useCallback } from "https://esm.sh/react@18.2.0";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
// Difficulty configurations
</div>
function client() {
createRoot(document.getElementById("root")).render(<SnakeGame />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
bookmark
@ramkarthik
A minimal bookmarking tool This allows you to bookmark links and view them later. Completely powered by ValTown and SQLite. To set this up for yourself Fork the val From your ValTown settings page, add an environment variable named bookmarks_client_id and give it a value (you will be using this for saving) Add another environment variable named bookmarks_client_secret and give it a value (you will also be using this for saving) At first, the "bookmarks" table will not exist, so we need to save an article first, which will create the "bookmarks" table To do this, add a bookmarklet to your browser with this value (replace BOOKMARKS-CLIENT-ID and BOOKMARKS-CLIENT-SECRET with the values you added to the environment variables, and replace BOOKMARKS-URL with your VAL's URL): javascript:void(open('BOOKMARKS-URL/save?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title)+'&id=BOOKMARKS-CLIENT-ID&secret=BOOKMARKS-CLIENT-SECRET', 'Bookmark a link', 'width=400,height=450')) Click this bookmarklet to bookmark the URL of the current active tab Go to your VAL URL homepage to see the bookmark Demo Here are my bookmarks:
https://ramkarthik-bookmark.web.val.run/ Note Make sure you don't share bookmarks_client_id and bookmarks_client_secret . It is used for authentication before saving a bookmark.
HTTP
1. Fork the val
2. From your ValTown settings page, add an environment variable named `bookmarks_client_id` and give it a value (you will be using this for saving)
3. Add another environment variable named `bookmarks_client_secret` and give it a value (you will also be using this for saving)
4. At first, the "bookmarks" table will not exist, so we need to save an article first, which will create the "bookmarks" table
5. To do this, add a bookmarklet to your browser with this value (replace `BOOKMARKS-CLIENT-ID` and `BOOKMARKS-CLIENT-SECRET` with the values you added to the environment variables, and replace `BOOKMARKS-URL` with your VAL's URL):
javascript:void(open('BOOKMARKS-URL/save?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title)+'&id=BOOKMARKS-CLIENT-ID&secret=BOOKMARKS-CLIENT-SECRET', 'Bookmark a link', 'width=400,height=450'))
6. Click this bookmarklet to bookmark the URL of the current active tab
### Note
Make sure you don't share `bookmarks_client_id` and `bookmarks_client_secret`. It is used for authentication before saving a bookmark.
return c.text("Authentication details (ID/Secret) missing!");
if (id != Deno.env.get("bookmarks_client_id") || secret != Deno.env.get("bookmarks_client_secret")) {
return c.text("Unauthorized!");
agWebsiteStatus
@ag_grid
AG Website Uptime Status Page This is the status page for the data generated by this uptime cron: @ag_grid/isAgWebsiteDown
HTTP
/** @jsxImportSource https://esm.sh/react */
import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
import { html } from "https://esm.town/v/stevekrouse/html";
import { SparklineSVG } from "https://esm.town/v/stevekrouse/sparklineSVGReact";
import { renderToString } from "npm:react-dom/server";
function StatusRow({ rows }) {
cohostSanitize
@easrng
// list pulled from dompurify
Script
attributes: {
"*": ["style"],
tagNames: ["video", "audio", "aside"], // consistency with current rules,
additionalVisitor(hast) {
visit(hast, "element", (node, index, parent) => {
attributes: {
"*": ["style"],
tagNames: ["video", "audio", "aside"], // consistency with current rules,
additionalVisitor(hast) {
// run the previous age's visitor first
BlogChatbotServer
@weaverwhale
// This approach will create a chatbot using OpenAI's SDK with access to a blog's content stored in a JSON.
HTTP
// This approach will create a chatbot using OpenAI's SDK with access to a blog's content stored in a JSON.
// We'll use Hono for routing, OpenAI for the chatbot, and stream the responses to the client.
// The blog content will be stored as JSON and used as a tool in the chatbot's chain.
import { Hono } from "https://esm.sh/hono";
html
@neverstew
@jsxImportSource npm:preact
Script
/** @jsxImportSource npm:preact */
import type { VNode } from "npm:preact";
import { render } from "npm:preact-render-to-string";
export const html = (html: VNode) =>
superFuchsiaTern
@serkanokur
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react **/
import { renderToString } from "https://esm.sh/react-dom@18/server";
export default (req: Request) => {
return new Response(
forbetHeader
@nmsilva
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react */
const ForbetHeader = () => {
return (
FanficSearcherWebsite
@willthereader
// first stable version is 9 and the link is https://www.val.town/v/willthereader/FanficSearcherWebsite?v=9
HTTP
<script>
console.log("Initializing Algolia search with App ID:", "${appId}");
const searchClient = algoliasearch("${appId}", "${apiKey}");
const search = instantsearch({
indexName: "NewGameNewLife",
searchClient,
debug: true,
search.addWidgets([