Skip to content

Instantly share code, notes, and snippets.

View tayiorbeii's full-sized avatar

Taylor Bell tayiorbeii

View GitHub Profile
import "@johnlindquist/kit"
// Name: srt to txt
// Author: Taylor Bell
// Description: Breaks an srt file into readable text blocks
let srtParser2 = await npm('srt-parser-2')
debugger;
import "@johnlindquist/kit"
// Name: diarize-srt-john
let files = await drop()
let srtFile = files.filter(x => x.name.includes('.srt'))[0]
let diarizationFile = files.filter(x => x.name.includes('diarization'))[0]
let MarkdownIt = await npm("markdown-it")
import shiki from "shiki"
import "@johnlindquist/kit"
// Name: Markdown to HTML (Light Mode)
// Description: Paste Markdown to generate HTML with syntax highlighting
// Author: Taylor Bell
shiki.getHighlighter({
theme: "light-plus"
import "@johnlindquist/kit"
// Name: stopwatch
let time = 0;
let timerId = null;
let isPaused = false;
function formatTime(timeInSeconds) {
let hours = Math.floor(timeInSeconds / 3600);
let minutes = Math.floor((timeInSeconds - (hours * 3600)) / 60);
import "@johnlindquist/kit"
// Author: Taylor Bell
// Name: search by filename
// Shortcut: opt+f
// Description: Select files in Finder that contain a substring (comma separate for multiple matches)
let searchList = await arg(); // e.g. ".srt, .mp3, taco"
let searchItems = searchList.split(",").map(item => item.trim()).filter(Boolean);
let searchCriteria = searchItems.map(item => `name contains "${item}"`).join(" or ");
import "@johnlindquist/kit"
// Name: Open VS Code Here
// Shortcut: option+v
// Author: Taylor Bell
let selectedFile = await getSelectedFile()
// remove the filename from the path
let path = selectedFile.replace(/\/[^\/]*$/, '')
import "@johnlindquist/kit"
// Name: shorten-deepgram-srt
let deepgramJson = await drop("Drop deepgram json file");
let jsonInput = await readFile(deepgramJson[0].path, 'utf-8');
let data = JSON.parse(jsonInput);
function convertTime(inputSeconds) {
/*
# OG Image Downloader
- Retrieves the open graph image (og:image) from the currently active browser tab
- Resizes the image to a width of 600 pixels, maintaining aspect ratio
- Saves the resized image in the Downloads folder with a derived name
- If no og:image tag is found, displays an error message and exits
*/
//Author: Taylor Bell
//Name: OG Image Downloader
/*
# OG Image Downloader
- Retrieves the open graph image (og:image) from the currently active browser tab
- Resizes the image to a width of 600 pixels, maintaining aspect ratio
- Saves the resized image in the Downloads folder with a derived name
- If no og:image tag is found, displays an error message and exits
*/
//Author: Taylor Bell
//Name: OG Image Downloader
// Author: Taylor Bell
// Name: Split video on silences
// Description: detects video silences over a threshold length and deletes the silences
import "@johnlindquist/kit"
const replaceAll = await npm('just-replace-all')
const numbers = await npm('numbers-in-string')
const seconds = await npm('seconds-to-timestamp')
const chunk = await npm('chunk')
const leadingzero = await npm('leadingzero')
const escape = await npm('escape-path-with-spaces')