Avatar

rlesser

Product Engineer at https://nomic.ai | Building ways to clear the fog
Joined January 28, 2023
Likes
15
rlesser avatar
sqliteTableExportUtils
@rlesser
Script
SQLite Table Export Utils This allows for a val.town-hosted SQLite table to be exported as: JSON ( Record<string, unknown>[] ) Arrow IPC ( Uint8Array ) TODO: Others? This can then be used by a HTTP endpoint, like so: import { exportSQLiteTable, SQLiteTableExportFormat } from "https://esm.town/v/rlesser/sqliteTableExportUtils"; export default async function(req: Request): Promise<Response> { const tableName = new URL(req.url).searchParams.get("table"); if (!tableName) { return new Response("Table name is required", { status: 400 }); } const format = (new URL(req.url).searchParams.get("format") || "arrowIPC") as SQLiteTableExportFormat; const data = await exportSQLiteTable(tableName, format); if (data instanceof Uint8Array) { return new Response(data, { headers: { "Content-Type": "application/octet-stream" }, }); } else { return Response.json(data); } } TODO Specify limit and offset of export, for pagination Smart assessment of if the export is going to be over the val.town limit of 10MB, adjust to paginated of so. Support other export formats. PRs welcome!
dupontgu avatar
washer_3d
@dupontgu
HTTP
Generates a 3D model of a flat washer, in .stl format. Pass in number parameters for washer "thickness" ("t"), "hole_radius" ("hr"), and "outer_radius" ("r"): https://dupontgu-washer_3d.web.val.run/?t=2&hr=8&r=10
pomdtr avatar
gfm
@pomdtr
Script
Markdown to html (with github styling)
maxm avatar
selfEditingWebsite
@maxm
HTTP
Self Editing Website Visit and edit at: https://maxm-selfeditingwebsite.web.val.run/
fil avatar
beckerBarley
@fil
HTTP
Becker’s Barley trellis SSR chart with Observable Plot This chart is rendered server-side by val.town, using Observable Plot, from data loaded from the GitHub API. For a more complete example, see https://www.val.town/v/fil.earthquakes. For information on this chart, see https://observablehq.com/@observablehq/plot-barley-trellis.
tmcw avatar
big_story_visualization
@tmcw
Express
The Big Story This val, along with @tmcw.big_story , which requests from the New York Times API , and @tmcw.big_stories_ranks , which contains the data, generates a visualization of top stories on the NYTimes homepage. This is here just to ask the question – what happens to cover stories over time? Do they slowly drop down the page, or just get replaced by a fully new lede? So far it doesn't have quite enough data to answer that question. But also, it might be neat because it'll show which kinds of stories make the front page - is it climate, war, politics, or something else? 👉 The Big Story (visualization)
rlesser avatar
Resy_getVenueCalendar
@rlesser
Script
Get a Venue's Calendar on Resy This function fetches the calendar for a given venue on Resy, which gives information on which days the venue is available, sold-out, or closed. Inputs An object containing: venue_id - The Resy venue id, either fetched from the website's network data or from @rlesser_getFavorites (Todo: add venue id from url function) . num_seats - The number of seats you are checking for availability for. Use 2 as a default if you just want to know when the restaurant is closed. Returns A VenueCalendar object, containing: last_calendar_day - A string representing the last day the restaurant has made their calendar available for (normally a few weeks out from today). scheduled - An object containing a list of dates and restaurant statuses. See type below. See other Resy vals I've made.
stevekrouse avatar
whatIsValTown
@stevekrouse
HTTP
An interactive, runnable TypeScript val by stevekrouse
rlesser avatar
Resy_setNotify
@rlesser
Script
An interactive, runnable TypeScript val by rlesser
rlesser avatar
Resy_getFavorites
@rlesser
Script
Get Favorites on Resy This function fetches your favorite restaurants and venues, as specified in your Hit List . Inputs An object containing: authToken - Your authentication token, normally generated from @rlesser.Resy_authenticate . Returns A Favorites object, containing the ids of your favorite venues, defined in the type below. See other Resy vals I've made.
rlesser avatar
Resy_authenticate
@rlesser
Script
Authenticate with Resy This function can be used to generate an authentication token for Resy, which can be used to view favorites, set notifies, or even make reservations. Inputs An AuthParams object containing: email - The email address for your Resy account. Probably best to keep private. password - The password for your Resy account. Definitely keep this private, and place it in a secret . Returns An AuthResponse object containing: id - Your Resy account id. token - Your Resy account token, used to authenticate you in subsequent API calls. See other Resy vals I've made.
alp avatar
confession
@alp
Script
An interactive, runnable TypeScript val by alp
Next