Skip to content

Instantly share code, notes, and snippets.

View tayiorbeii's full-sized avatar

Taylor Bell tayiorbeii

View GitHub Profile
@tayiorbeii
tayiorbeii / markdown-to-html-darkmode.js
Created July 16, 2024 15:39
Script Kit script for pasting markdown and generating HTML
let MarkdownIt = await npm("markdown-it");
let hljs = await npm("highlight.js");
// import 'highlight.js/styles/night-owl.css';
import "@johnlindquist/kit";
// Name: markdown-to-html-darkmode
// Description: Paste Markdown to generate HTML with syntax highlighting
let nightOwlStyles = `.hljs {
let MarkdownIt = await npm("markdown-it");
let hljs = await npm("highlight.js");
let TurndownService = await npm("turndown");
// import 'highlight.js/styles/night-owl.css';
import "@johnlindquist/kit";
// Name: html-to-markdown
// Description: Paste Markdown to generate HTML with syntax highlighting
import "@johnlindquist/kit"
// Name: combine-txt-with-separators
let textFiles = await drop()
let allStrings = []
for (let f of textFiles) {
let text = await readFile(`${f.path}`, 'utf-8')
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: 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"
let longVideoFiles = await drop()
cd(path.dirname(longVideoFiles[0].path))
for (let longVideoFile of longVideoFiles) {
let {name, dir} = path.parse(longVideoFile.path)
await exec(`ffmpeg -i "${longVideoFile.path}" -vcodec libx264 -crf 24 "${dir}/${name}-encoded.mp4"`)
/*
# Paste Clipboard Image as Cloudinary Markdown URL
- Checks if there is an image on the clipboard
- If image is present, it uploads to Cloudinary using the `upload_stream` method
- Asks user for the alternative text of the image using `mini` method
- Formats the Cloudinary response to a markdown image syntax with Alt text
- Replaces the selected text with this generated markdown
- If no image is stored in clipboard, it displays a message `No Image in Clipboard`
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: 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"
// Name: srt to txt
// Author: Taylor Bell
// Description: Breaks an srt file into readable text blocks
let srtParser2 = await npm('srt-parser-2')
debugger;