Skip to content

Instantly share code, notes, and snippets.

View thebwt's full-sized avatar

Brandon Tomlinson thebwt

  • Easypost
  • Houston Tx.
View GitHub Profile
@thebwt
thebwt / main.py
Created October 4, 2023 03:31
Whisper middleware api
from fastapi import FastAPI, File, UploadFile
from fastapi.middleware.cors import CORSMiddleware
import requests
import openai
import tempfile
app = FastAPI()
app.add_middleware(
CORSMiddleware,
@thebwt
thebwt / stop-detection.js
Created October 4, 2023 03:29
foundry macro with stop detection
// Function to record audio and return as Blob
async function recordAudio() {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
const mediaRecorder = new MediaRecorder(stream);
const audioChunks = [];
let audioContext = new AudioContext();
let analyser = audioContext.createAnalyser();
let source = audioContext.createMediaStreamSource(stream);
source.connect(analyser);
@thebwt
thebwt / gist:71c15f8d463651fa50deaff41f233ca7
Created September 25, 2023 15:21
Elevenlabs Foundry - Conversation HUD integration
// Check if a token is selected
let selectedActor = game.actors.get(canvas.tokens.controlled[0]?.actor?.id);
if (!selectedActor) {
ui.notifications.warn("You must select a token first.");
return;
}
// Fetch the voice name from the custom flag, or prompt for a new one if not set
let voiceName = selectedActor.getFlag("world", "voiceName");
if (!voiceName) {
@thebwt
thebwt / gist:b5c662c52a26081f2dc4c9032bbfdb5f
Created September 25, 2023 15:19
Elevenlabs foundry - voice actor storage and retrieval
// Check if a token is selected
let selectedActor = game.actors.get(canvas.tokens.controlled[0]?.actor?.id);
if (!selectedActor) {
ui.notifications.warn("You must select a token first.");
return;
}
// Fetch the voice name from the custom flag, or prompt for a new one if not set
let voiceName = selectedActor.getFlag("world", "voiceName");
if (!voiceName) {

Ingredients:

  • 1 lb boneless, skinless chicken breast, cubed
  • 1 tbsp olive oil
  • 1 onion, chopped
  • 2 cloves garlic, minced
  • 2 cups chicken broth
  • 1 cup frozen peas
  • 1 cup frozen corn
  • 1 cup chopped carrots
  • 1/2 cup all-purpose flour
@thebwt
thebwt / import.js
Last active March 19, 2023 15:31
symbaroum foundryvtt clipboard import
(async () => {
// Parse JSON from clipboard
const clipboardText = await navigator.clipboard.readText();
const inputData = JSON.parse(clipboardText);
// Check if the "GPTImport" folder exists, if not, create it
let folder = game.folders.find(
(folder) => folder.data.name === "GPTImport" && folder.data.type === "Actor"
);
if (!folder) {
thebwt@thebwt-work:~/Documents/workspace/pipmem% python3.5 pipmem.py install requests
usage: pipmem.py [-h] [-v] {install,uninstall,history} ...
pipmem.py: error: unrecognized arguments: requests
postgres:
image: postgres
environment:
- POSTGRES_USER=drone
- POSTGRES_PASSWORD=------
- POSTGRES_DB=drone
drone:
image: drone/drone:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
@thebwt
thebwt / wut
Created December 16, 2015 20:40
olland (1.0.10-2) unstable; urgency=low
[ Andrew Garner ]
* Fix .deb dependency on mysql-client; Use virtual-mysql-client instead
-- Andrew Garner <muzazzi@gmail.com> Fri, 02 May 2013 23:16:34 +0000
holland (1.0.10-1) unstable; urgency=low
[ Andrew Garner ]
#install generic build stuff and clean up the metadata afterwards to keep the image small
RUN apt-get update && apt-get install -y \
build-essential \
git-buildpackage \
debhelper \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*