Skip to content

Instantly share code, notes, and snippets.

View lukestanley's full-sized avatar

Luke Stanley lukestanley

View GitHub Profile
@lukestanley
lukestanley / making_podcast_summary_from_audio.txt
Created April 11, 2024 06:48
making podcast summary with Whisper speech to text model on Replicate with ChatGPT 4
Making podcast summaries when only the audio is available.
Find MP3 of the podcast.
Use a Whisper API, such as https://replicate.com/thomasmol/whisper-diarization (I logged in via GitHub with my paid account). I put the mp3 URL into the file_url section. I set the num_speakers to 2 (which turned out to be a bit wrong after I heard the podcast, due to additional voices for the adverts). I put 'en' as the language.
In the prompt string I pasted an introduction to the podcast to help it be more accurate with names.
I pressed "Run". 2 minutes later, I checked out the JSON section on the right hand side, and pressed the copy button.
I selected an extract of the start of the JSON, showing the structure, stopped after the first array item that contained the transcript text and speaker ID. I saved it as a JSON file.
I provided it to ChatGPT 4. In particular I used this instruction after the extract:
`Parse the JSON to get a text transcript. Think step by step sharing very detailed working out. Use Python. we want o
@lukestanley
lukestanley / extract_chatgpt_conversations.py
Created February 14, 2024 00:31
A method to get easily parsable conversations from a ChatGPT data export of Feb 2024 vintage
def extract_messages(file_path="conversations.json", conversation_limit=None, message_limit=None):
with open(file_path, "r") as file:
data = json.load(file)
extracted_conversations = []
conv_titles = []
# Use the specified limits or the entire data length if no limit is specified
conversation_count = conversation_limit if conversation_limit else len(data)
@lukestanley
lukestanley / visual_programming_podcast_maggie_appleton_transcript.txt
Last active January 16, 2024 15:40
`Metamuse Episode 37 — August 19, 2021 Visual programming with Maggie Appleton, Mark and Adam. From https://museapp.com/podcast/37-visual-programming/ and transcribed with https://replicate.com/thomasmol/whisper-diarization
Maggie: Maybe the past generation of programmers were sort of subjecteded to a really awful version of visual programming, but it would be really sad to let that frustration that other people have felt ruin what visualprogramming could be in a much better design format, or just done in very different ways, done in ways that combine graphics and text.
Adam: Hello, and welcome to Metamuse. Muse is a tool for thought on iPad. But this podcast isn't about Muse the product, it's about Muse the company and the small team behind it. I'm Adam Wiggins, joined by my colleague Mark McGranigan. Hey, Adam. And our guest, Maggie Appleton from Egghead.
Maggie: Hello.
Adam: Thanks for joining us, Maggie. Now, listeners of the podcast will know that Mark and I are fans of computing history. We think sometimes the technology industry is a little unaware of its own history. And I understand you recently visited a museum on that topic in your area.
Maggie: I did. I got last weekend to go up to Cambridge, which is about an hour a
@lukestanley
lukestanley / local_first_whisper_transcript.txt
Created January 16, 2024 11:31
Local-first software with Martin Kleppmann automated transcript
And I feel like this idea really changes the abstractions that operating systems should provide, because maybe OSes should not just be providing this model of files as a sequence of bytes, but this higher-level CRDT-like model. And how does that impact the entire way how software is developed? And we've talked before about Mark's dabbling in playing the piano. I understand this is a hobby you're starting to look into as well, Martin. Oh, yes. I've been playing the piano, trying to do it a bit more consistently for the last year and a half or so. A lockdown project. And you have a technique for not annoying your neighbors. For the neighbors? Or is this an electronic piano, or how do you do that? It's an electric piano, although I don't think it's too bad for the neighbors. Lately, I've been trying to learn a Debussy 400 piece that I can play together with my wife. So she'll play two hands, and I'll play the other two. Nice. I suspect a lot of our listeners know you already, Martin. I think you're within your s
@lukestanley
lukestanley / archive_all_done_linear_tasks.py
Created January 5, 2024 13:32
Archive all done Linear issues
# Set API_KEY!
import requests
headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
}
query = """
@lukestanley
lukestanley / archive_done_linear_sync_tasks.py
Last active January 5, 2024 12:34
Archives done Linear Sync tasks via GraphQL API
# Set API_KEY!
import requests
headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
}
# Search for issues that have been synced from LinearSync:
@lukestanley
lukestanley / text_fixer.user.js
Created October 18, 2023 12:04
Browser user script using OpenAI GPT-3.5-turbo on text boxes to suggest British English spelling, grammar text improvments
// ==UserScript==
// @name Fix spelling with GPT
// @namespace https://gist.github.com/lukestanley/937ffd4de748cdc00a5dd701bd6fbdfb
// @version 1.0
// @description User script for checking spelling and grammar with OpenAI API
// @match http://*/*
// @match https://*/*
// @run-at document-end
// @grant GM_xmlhttpRequest
// ==/UserScript==
@lukestanley
lukestanley / chatgpt_message_sync.user.js
Last active October 30, 2023 21:43
Browser Userscript Javascript to Stream ChatGPT messages to local server in real time
// ==UserScript==
// @name ChatGPT Message Sync
// @version 0.1
// @description Sync ChatGPT messages to own server.
// @include https://chat.openai.com/c/*
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
@lukestanley
lukestanley / termux_nextcloud_photo_mover.py
Created July 17, 2023 16:24
An Android Termux Python script to move local images and videos to a Nextcloud instance. It deletes the local files to save space. Made after frustration with Nextcloud Android app.
import os
from webdav3.client import Client
from tenacity import retry, stop_after_attempt, wait_fixed
import time
BATCH_SIZE = 100
uploaded_files = []
# get password from environment variable
[{"country":"Afghanistan","province":null,"timeline":{"cases":{"2/8/23":208771,"2/9/23":208771,"2/10/23":208943,"2/11/23":208971,"2/12/23":208982,"2/13/23":209011,"2/14/23":209036,"2/15/23":209056,"2/16/23":209072,"2/17/23":209083,"2/18/23":209084,"2/19/23":209107,"2/20/23":209153,"2/21/23":209181,"2/22/23":209181,"2/23/23":209215,"2/24/23":209230,"2/25/23":209246,"2/26/23":209274,"2/27/23":209308,"2/28/23":209322,"3/1/23":209340,"3/2/23":209358,"3/3/23":209362,"3/4/23":209369,"3/5/23":209390,"3/6/23":209406,"3/7/23":209436,"3/8/23":209451,"3/9/23":209451},"deaths":{"2/8/23":7896,"2/9/23":7896,"2/10/23":7896,"2/11/23":7896,"2/12/23":7896,"2/13/23":7896,"2/14/23":7896,"2/15/23":7896,"2/16/23":7896,"2/17/23":7896,"2/18/23":7896,"2/19/23":7896,"2/20/23":7896,"2/21/23":7896,"2/22/23":7896,"2/23/23":7896,"2/24/23":7896,"2/25/23":7896,"2/26/23":7896,"2/27/23":7896,"2/28/23":7896,"3/1/23":7896,"3/2/23":7896,"3/3/23":7896,"3/4/23":7896,"3/5/23":7896,"3/6/23":7896,"3/7/23":7896,"3/8/23":7896,"3/9/23":7896},"recovered"