Skip to content

Instantly share code, notes, and snippets.

View mike-marcacci's full-sized avatar

Mike Marcacci mike-marcacci

View GitHub Profile
@mike-marcacci
mike-marcacci / test.sh
Created May 19, 2020 00:22
Querious CA cert bug
printf "\nConnect to mysql...\n\n"
printf "Using this user: root\n"
printf "Using this password: root-password\n"
# Create a temporary mysql instance using docker, letting the OS chose a port.
container=$(docker run -e MYSQL_ROOT_PASSWORD=root-password -d --rm -p 3306 mysql)
# Print the host port used.
printf "Using this port:\n"
docker container port $container
@mike-marcacci
mike-marcacci / stream-ai-uploads.ts
Last active September 23, 2024 18:54
Stream file uploads to google generative AI
import {
FileMetadata,
GoogleAIFileManager,
UploadFileResponse,
} from "@google/generative-ai/server";
// GoogleAIFileManager can't use streams yet, so we need to do it on our own.
// See: https://github.com/google-gemini/generative-ai-js/pull/252
// Note that this is a direct copy of the existing implementation; it would