This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div#notebook { | |
font-family: sans-serif; | |
font-size: 13pt; | |
line-height: 170%; | |
color: #303030; | |
-webkit-font-smoothing: antialiased !important; | |
padding-top: 25px !important; | |
} | |
body, | |
div.body { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let context = null; | |
let canvas = null; | |
let video = null; | |
let lastSendTime = 0; | |
const throttleInterval = 1000; // 1 second in milliseconds | |
let throttleTimeout = null; | |
let pendingData = false; | |
htmx.onLoad(elt => { | |
// Find and process the canvas element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, json, glob | |
# Set up | |
api_key = ... | |
GPT_MODEL = "gpt-4-1106-preview" | |
# Read the wordlist and solution from a file | |
def get_words(idx=0): | |
files = sorted(glob.glob("connections_data/*.json")) | |
f = open(files[idx]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fasthtml.all import * | |
import anthropic, base64 | |
client = anthropic.Anthropic( | |
api_key="your_key_here", | |
) | |
canvas_js = """ | |
const canvas = document.getElementById('drawingCanvas'); | |
const context = canvas.getContext('2d'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fasthtml.all import * | |
import anthropic, base64, time | |
client = anthropic.Anthropic( | |
api_key="your_key_here", | |
) | |
canvas_js = """ | |
const canvas = document.getElementById('drawingCanvas'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from starlette.responses import FileResponse, RedirectResponse | |
from fastcore.utils import * | |
from fastcore.xml import * | |
from fasthtml import * | |
from sqlite_utils import Database | |
from fastlite import * | |
from fastlite.kw import * | |
db = Database('todos.db') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, json, uuid | |
from starlette.responses import FileResponse, RedirectResponse | |
from fastcore.utils import * | |
from fastcore.xml import * | |
from fasthtml import * | |
from oauthlib.oauth2 import WebApplicationClient | |
# Secrets + URLs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the required modules | |
import sounddevice as sd # For accessing the microphone | |
import pynput # For sending keypresses | |
import numpy as np # For numerical calculations | |
import time as tm # For measuring time | |
# Define a function that checks the loudness of the sound input | |
def check_loudness(indata, outdata, frames, time, status): | |
global prev_state, last_trigger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import trafilatura | |
import feedparser | |
import requests | |
from bs4 import BeautifulSoup | |
from feedgenerator import DefaultFeed, Enclosure | |
API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-cnn" | |
headers = {"Authorization": "Bearer HF_TOKEN"} |