Avatar

nbbaier

Valin' up a storm
Joined January 12, 2023
Public vals
140
nbbaier avatar
mdConvert
@nbbaier
HTTP
mdConvert Inspired by markdown.rest . Converts markdown (plain text or base64 encoded) to HTML (plain text or base64 encoded)
nbbaier avatar
moccasinRodent
@nbbaier
Script
An interactive, runnable TypeScript val by nbbaier
nbbaier avatar
declarativeMigrations
@nbbaier
Script
The beginnings of a val town implementation of the approach to declarative sqlite migrations laid out in this post: Simple declarative schema migration for SQLite
nbbaier avatar
valToGH_dev2
@nbbaier
Script
valToGH A utility function for programmatically updating a GitHub repository with code retrieved from a Val. NOTE : This function currently does not change the contents of a file if it is already present. I will however be adding that functionality. Usage import { valToGH } from 'https://esm.town/v/nbbaier/valToGH'; const repo = "yourGitHubUser/yourRepo"; const val = "valUser/valName"; // or vals = ["valUser/valName1","valUser/valName2", ...] const ghToken = Deno.env.get("yourGitHubToken"); const result = await valToGH(repo, val, ghToken); console.log(result); Parameters repo : The GitHub repository in the format {user}/{repo} . val : A single repository in the format {user}/{val} . ghToken : Your GitHub token for authentication (must have write permission to the target repo) Options branch : Optional target branch. Default is main . prefix : Optional directory path prefix for each file. message : Optional commit message. Default is the current date and time in the format yyyy-MM-dd T HH:mm:ss UTC . ts : Optional flag to use a .ts extension for the committed file instead of the default .tsx .
nbbaier avatar
vt_backup_endpoint
@nbbaier
HTTP
An interactive, runnable TypeScript val by nbbaier
nbbaier avatar
shadcnButton
@nbbaier
Script
@jsxImportSource https://esm.sh/react
nbbaier avatar
react_client
@nbbaier
Script
// JSX can be used in the client val thanks to this magic comment
nbbaier avatar
modifyIframeResponse
@nbbaier
Script
Prevents your http vals from being viewed inside iframes. If it's a valtown iframe, a helpful message is displayed. Usage: import modifyIframeResponse from "https://esm.town/v/nbbaier/modifyIframeResponse"; export default modifyIframeResponse(async (req: Rquest): Promise<Response> => { return Response.json({ ok: true }) });
nbbaier avatar
sqlite_explorer
@nbbaier
HTTP
An interactive, runnable TypeScript val by nbbaier
nbbaier avatar
iframeHandler
@nbbaier
Script
An interactive, runnable TypeScript val by nbbaier
nbbaier avatar
sqliteExplorerApp_DEV
@nbbaier
HTTP
SQLite Explorer (Dev Branch) View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal . This is now more an SPA, with tables, queries and results showing up on the same page. Install Install the latest stable version (v66) by forking this val: Authentication Login to your SQLite Explorer with password authentication with your Val Town API Token as the password. Todos / Plans [ ] improve error handling [ ] improve table formatting [ ] sticky table headers [x] add codemirror [ ] add loading indication to the run button (initial version shipped) [ ] add ability to favorite queries [ ] add saving of last query run for a table (started) [ ] add visible output for non-query statements [ ] add schema viewing [ ] add refresh to table list sidebar after CREATE/DROP/ALTER statements [ ] add automatic execution of initial select query on double click [x] add views to the sidebar [ ] add triggers to sidebar [ ] add upload from SQL, CSV and JSON [ ] add ability to connect to a non-val town Turso database [x] fix wonky sidebar separator height problem (thanks to @stevekrouse) [x] make result tables scrollable [x] add export to CSV, and JSON (CSV and JSON helper functions written in this val . Thanks to @pomdtr for merging the initial version!) [x] add listener for cmd+enter to submit query
nbbaier avatar
react_example_server
@nbbaier
HTTP
// The server response includes a script referencing the client val
nbbaier avatar
codemirror_demo
@nbbaier
HTTP
An interactive, runnable TypeScript val by nbbaier
nbbaier avatar
fetchAndStoreOpenAiUsage2
@nbbaier
Cron
An interactive, runnable TypeScript val by nbbaier
nbbaier avatar
gptTag
@nbbaier
Script
// a test comment for vt-backup
nbbaier avatar
kysely_valgen_POC
@nbbaier
Script
An interactive, runnable TypeScript val by nbbaier