6
7/** This doesnt work well */
8export async function powderNotify(location: string) {
9 const weather = await getWeather(location);
10
17}
18
19export function generateLessonHtml({ email, lesson, title, fillBlank, content, quiz }: GenerateLessonHtmlParams) {
20 const lessonJsx = (
21 <html>
5type SubscriberRow = [emailAddress: string, currentLesson: number];
6
7export default async function sendDailyLessons(interval: Interval) {
8 // No-op if I accidentally click "Run now" to avoid double sending lessons
9 const now = Date.now();
10 const time23hrs57min = (23 * 60 + 57) * 60 * 1000;
11 if (!interval.lastRunAt || now - interval.lastRunAt.getTime() < time23hrs57min) {
12 console.log("Don't manually run this function! It will email all subscribers.");
13 return;
14 }
19 * The current behavior is to reset to lesson 1.
20 */
21export async function upsertStudent({ name, email, token }: UpsertEmailSubscriberParams) {
22 return sqlite.execute({
23 sql: `
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function markLessonComplete(emailAddress: string) {
4 await sqlite.execute({
5 sql: `
8}
9
10export async function sendLesson({ lesson, emailAddress }: SendLessonParams) {
11 await sqlite.execute({
12 sql: `
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function createStudentsTable() {
4 await sqlite.execute(
5 `
2import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
3
4export async function unsubscribe(req: Request) {
5 const searchParams = new URL(req.url).searchParams;
6 const emailAddress = searchParams.get("email");
62 <h2>The basal ganglia</h2>
63 <p>
64 The basal ganglia, which also controls some motor function—both voluntary and unvoluntary, like subconscious eye
65 movements, Cognitive and motor functions can be chunked together in one unit that makes up a learned habit or
66 skill. So you can think of learned habits become automatic, uncontrolled System 1 knowledge.
67
4const notionPage = "https://chetcorcos.notion.site/0e27612403084b2fb4a3166edafd623a";
5
6export default async function(req: Request): Promise<Response> {
7 const notionUrl = new URL(notionPage);
8 const notionDomain = notionUrl.host;
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",