1export function myApi(name) {
2 return "hi " + name;
3}
1import process from "node:process";
2
3export async function createIssue(issue_data) {
4 const { Octokit } = await import("npm:@octokit/core");
5 const octokit = new Octokit({
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
4
5export async function hnFollowPollJob({ lastRunAt }) {
6 let posts = await hnLatestPosts({
7 authors: hackerNewsAuthors,
1export function dotProduct(vec1: number[], vec2: number[]): number {
2 let sum = 0;
3 for (let i = 0; i < vec1.length; i++) {
1import { extractValArgs } from "https://esm.town/v/sdan/extractValArgs";
2
3export async function functionZilla(fnc: string) {
4 let args = await extractValArgs(fnc);
5 console.log(args);
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();
26 }
27 console.log(
28 `average e2e user function time: ${
29 (userFuncTimes.reduce((a, b) => a + b, 0) / count).toFixed(0)
30 }ms (fastest was ${
1export function add(...args) {
2 return args.reduce((a, b) => a + b, 0);
3}
3import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
4
5export async function dm(message, auth) {
6 let { handle, error } = await verifyAPIAuth(auth);
7 if (!handle)
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.