This file contains hidden or 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 { writeFile } from 'node:fs/promises' | |
import { dump } from 'js-yaml' | |
const getSuggestions = async function (query) { | |
// https://stackoverflow.com/questions/11275365/youtube-api-search-auto-complete | |
const endpoint = 'https://clients1.google.com/complete/search?client=youtube&gs_ri=youtube&ds=yt' | |
const url = new URL(endpoint) | |
url.searchParams.set('q', query) | |
const response = await fetch(url) | |
if (response.ok) { |
This file contains hidden or 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
library(magrittr) | |
# Frequencies tested in tone audiograms | |
audiogram_frequencies <- c(0.125, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 6, 8) | |
# Simulate hearing loss data in wide format | |
sample_df <- data.frame( | |
frequency = audiogram_frequencies, | |
air_right = sample(40:70, size = 11), | |
air_left = sample(50:90, size = 11), | |
bone_right = sample(0:30, size = 11), |