Skip to content

Instantly share code, notes, and snippets.

View michaelskyba's full-sized avatar
🕒

Michael Skyba michaelskyba

🕒
View GitHub Profile
// ==UserScript==
// @name YouTube Unpause
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disable the programmatic pausing of YouTube videos in response to detecting adblock
// @author Michael
// @match https://www.youtube.com/watch?v=*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
import sys
# https://classroom.google.com/c/NTU0OTE4MjA4NzMw/p/NTU1MjExNjY2MTI0/details
# CLI usage: python rings.py input.txt
routes = []
with open(sys.argv[1]) as file:
routes = file.readlines()
for i, route in enumerate(routes):
routes[i] = route.rstrip()
// https://classroom.google.com/c/NTU0OTE4MjA4NzMw/p/NTAyNDg0NzYyNjQ2/details
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
#!/bin/sh
# Edit this if you're not using TSV
DELIM=" "
doc='
descript: convert scripture decks to tunnel decks
usage: descript <deck file>
This prints to stdout so you can do something like
#!/bin/sh
doc='
msk_display: display a short text in an image using imagemagick
useful for e.g. showing Japanese characters in a proper font
usage: msk_display "<text>"
sxiv is not called with &, so you might want to run msk_display ... &
'
@michaelskyba
michaelskyba / msk_pass
Last active March 28, 2022 15:39
script to use budgetpass inside dmenu
#!/bin/sh
# msk_pass: uses bpass in dmenu
# use in sxhkd
picked=$(ls $BP_HOME | dmenu)
[ $picked ] && exit
master=$(:| dmenu)
[ $master ] && exit
--- old
+++ new
@@ -35,7 +35,7 @@
0) echo 'No more tracks in queue. Please refresh the database, or set $MSK_MUSIC_REFRESH.' && exit 1 ;;
# No tracks, but user wants automatic refreshing
- 1) find "$MUSIC_DIR" -type f | shuf > "$XDG_DATA_HOME/msk_music/tracks" ;;
+ 1) find "$MUSIC_DIR" -type f -name "*.mp4" | shuf > "$XDG_DATA_HOME/msk_music/tracks" ;;
esac
fi
@michaelskyba
michaelskyba / msk_music
Last active February 27, 2023 03:18
Allow symbolic links for playlist functionality
#!/bin/sh
[ -z "$1" -o -z "$2" ] && . err
music_dir=$1
tracks=$2
# Otherwise wc could error on a non-existent
[ -f "$tracks" ] || touch "$tracks"
#!/bin/sh
unread=$XDG_CONFIG_HOME/msk/rss/rss_unread
marked=$XDG_CONFIG_HOME/msk/rss/rss_marked
touch "$marked"
case "$1" in
get|mark|mark_get) [ "$2" ] || . err ;;
esac
missed() {
#!/bin/sh
# a case statement works way better than the terrible xdg-open
# usage: msk_open <file>
# Get the raw filetype
type=$(file -i "$1")
# Parse file -i
type=${type#*: }