Skip to content

Instantly share code, notes, and snippets.

@davidcortesortuno
davidcortesortuno / clean_youtube_dl_auto_subs.py
Created August 30, 2020 12:04
Remove duplicated lines from a .vtt file generated by youtube-dl when downaloading auto generated Youtube subtitles
# Remove duplicated lines from a .vtt file generated by youtube-dl when
# downloading auto-subs from a Youtube video using the --write-auto-sub option
# This script only prints the lines so save the edited subs as:
#
# python this_script.py original_sub.vtt > new_sub.vtt
import re
import sys
f = open(sys.argv[1])
@romainl
romainl / redir.md
Last active November 14, 2024 18:54
Redirect the output of a Vim or external command into a scratch buffer

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window:

@hotoo
hotoo / convert.sh
Last active April 15, 2023 01:15
convert vimwiki to markdown: `sed -f ex -i *.md`
#!/usr/bin/env bash
for x
do
filename=$(echo $x|sed -e "s/\.wiki$/.md/")
sed -f ex $x > $filename
done