Skip to content

Instantly share code, notes, and snippets.

@krmbzds
krmbzds / rename.rb
Last active February 26, 2023 08:39
Rename podcast transcriptions transcribed by transcribe_anything
Dir.each_child(".").each do |folder|
Dir.each_child(folder).each do |file|
full_path = File.expand_path(file, folder)
extension = File.extname(full_path)
case extension
when ".txt", ".srt", ".vtt"
new_path = File.join(File.expand_path("..", folder), folder + extension)
File.rename(full_path, new_path)
end
end
@krmbzds
krmbzds / transcribe.sh
Last active February 26, 2023 08:39
Transcribe podcasts with transcribe_anything
#!/bin/bash
for filename in *.mp3; do
[ -e "$filename" ] || continue
transcribe_anything --language en --no-keep-audio --device cpu "$filename" && rm "$filename"
done
vim: noet ts=8
gwip reflow paragraph
gJ join current line with the next without space
; repeat previous f, F, t, T movement, forwards
, repeat previous f, F, t, T movement, backwards
alternative: flit.nvim or clever-f.vim
@krmbzds
krmbzds / convert_anki_deck_audio.py
Created December 1, 2022 10:13
Convert OGG files to MP3 in your Anki decks
import argparse
import os
import re
from multiprocessing import Pool
from pathlib import Path
from subprocess import run
from tqdm.contrib.concurrent import process_map
@krmbzds
krmbzds / update-asdf-plugins.md
Last active December 26, 2022 17:07 — forked from developer-guy/update-asdf-plugins.sh
Update asdf plugins to their latest versions if necessary
@krmbzds
krmbzds / mouse.xml
Created June 24, 2019 20:02
Kodi Mouse Behavior
<!-- ~/Library/Application Support/Kodi/userdata/keymaps/mouse.xml -->
<keymap>
<global>
<mouse>
<leftclick>leftclick</leftclick>
<middleclick>middleclick</middleclick>
<rightclick>rightclick</rightclick>
<doubleclick>doubleclick</doubleclick>
<wheeldown>wheeldown</wheeldown>
<wheelup>wheelup</wheelup>
function vocab () {
touch "$HOME/.vocab"
if [ -n "$1" ]; then
echo $1 >> "$HOME/.vocab"
else
cat "$HOME/.vocab"
fi
}
@krmbzds
krmbzds / writing_tests_be_like.rb
Last active August 15, 2018 13:36
Yo dawg I heard you like tests
require 'tate'
strings = "azeri:Zəfər, jaketini də papağını da götür, bu axşam hava çox soyuq olacaq.
breton:Yec’hed mat Jakez ! Skarzhit ar gwerennoù-mañ, kavet e vo gwin betek fin ho puhez.
bulgarian:Жълтата дюля беше щастлива, че пухът, който цъфна, замръзна като гьон.
croatian:Gojazni đačić s biciklom drži hmelj i finu vatu u džepu nošnje.
czech:Nechť již hříšné saxofony ďáblů rozezvučí síň úděsnými tóny waltzu, tanga a quickstepu.
danish:Høj bly gom vandt fræk sexquiz på wc.
esperanto:Eble ĉiu kvazaŭ-deca fuŝĥoraĵo ĝojigos homtipon.
estonian:Põdur Zagrebi tšellomängija-följetonist Ciqo külmetas kehvas garaažis.
@krmbzds
krmbzds / postgres-cheatsheet.md
Created April 23, 2018 07:05 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@krmbzds
krmbzds / all_users.csv
Created January 31, 2017 08:49 — forked from l0gicpath/all_users.csv
Subtract data of one CSV file from another using fast grep. Dummy data generated by http://dummydata.me/
jame@out.org Stefanie House
dolores.bernice@roofroom.me Dinah Erickson
luke.homer.gerard@smile.info Melisa Reynolds
salvador.perry@selectionself.info Lily Carson
rich.jamel@cover.me Millard Rubio
benita@rangerat.edu Octavia Santana
vickie.mattie@westwet.info Royal Bender
dwayne@part.me Laverne Hutchins
jeanette.laurie.katie@light.me Sherman Wilder
jami.elnora@smokesmooth.edu Thelma Burris