1export async function getPublicKey(handle) {
2 let { publicKey } = await import(`/v/${handle}/publicKey`);
3 return publicKey;
2Gets information about a specific val.
3
4To access private vals, pass your API token as a secret to the function. Read more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token and save it as a secret.
5
6Migrated from folder: Archive/getVal
4 lon = +lon;
5 lat = +lat;
6 function dist(station) {
7 return Math.sqrt(
8 Math.pow(station.lat - lat, 2) + Math.pow(station.lon - lon, 2)
2
3export let getDuckDB = (async () => {
4 async function createWorker(url: string) {
5 const workerScript = await fetch(url);
6 const workerURL = URL.createObjectURL(await workerScript.blob());
1export function githubNormalizedJsonString(payload: object) {
2 // GitHub sends its JSON with an indentation of 2 spaces and a line break at the end
3 const payloadString = JSON.stringify(payload, null, 2) + "\n";
1// Times how long an execution takes
2// usage: @stevekrouse.panphoraDistanceTimed
3export async function timed(f) {
4 const start = Date.now();
5 const res = await f();
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function discordMessages({ botToken, channelId }) {
4 return fetchJSON(
5 `https://discord.com/api/channels/${channelId}/messages`,
1export function proj(ll: Pos2): Pos2 {
2 // Arbitrary.
3 const D2R = Math.PI / 180;
1let { untitled_test_state } = await import("https://esm.town/v/stevekrouse/untitled_test_state");
2
3export function untitled_mutate_test_state(newState) {
4 return (untitled_test_state = newState);
5}
4 );
5 const html = htm.bind(h);
6 function Component() {
7 const [count, setCount] = useState(0);
8 return html`<div class="foo">${count}</div>`;