Skip to content

Instantly share code, notes, and snippets.

@joelpalmer
joelpalmer / life-changing-funcs.zsh
Last active December 17, 2023 09:22
Zsh functions that change lives
#look up synonym - (word)
# slow and buggy
syn() {
curl -s "https://api.dictionaryapi.dev/api/v2/entries/en/$1" | jq '.[].meanings[].definitions[].synonyms[]'
}
# zd - use zoxide & FZF to find and go to directory
# Not sure why zoxide query -i with FZF doesn't CD
zd() {
local dir
@NicholasBellucci
NicholasBellucci / ScrollingTextView.swift
Last active March 1, 2024 03:37
MacOS swift marquee scrolling text view
import Cocoa
open class ScrollingTextView: NSView {
// MARK: - Open variables
/// Text to scroll
open var text: NSString?
/// Font for scrolling text
open var font: NSFont?
@glasslion
glasslion / vtt2text.py
Last active May 31, 2024 18:51
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.