Skip to content

Instantly share code, notes, and snippets.

@duanemoody
duanemoody / grabplaylists.sh
Created February 6, 2023 17:54
Add this to your .bashrc ir ,bash_profile
# yt-pl [playlist url]
yt-pl() {
yt-dlp -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b' \
--merge-output-format mp4 --download-archive videos.txt "$1" \
-o '%(playlist_title)s [%(playlist_id)s]/%(playlist_index)03d %(title)s [%(id)s].%(ext)s'
}
@duanemoody
duanemoody / 4chan image downloader.js
Last active November 2, 2022 20:06
Refactoring a thread image downloader bookmarklet to use 4chan's API instead of requiring 4chanX
/* Initialize this thread's variables */
let tp = window.location.pathname.split('/'),
board = tp[1],
threadNum = tp[3],
jsonurl = `https://a.4cdn.org/${board}/thread/${threadNum}.json`,
imho = `https://i.4cdn.org/${board}`,
images = [];
/* Get board JSON, populate images array */
await fetch(jsonurl)
@duanemoody
duanemoody / html6-a-work-in-progress.markdown
Last active August 12, 2019 06:58
HTML6, a work in progress
@duanemoody
duanemoody / sample.sh
Created September 12, 2017 22:57
correct protocol for Automator loop recursing through subfolders
# use Pass input: "to stdin", NOT "as arguments"
while read f ## NOT "for f in $@"
do
# file processing code goes here
done
# Explanation: Apple doesn't document this, but "Pass input: as arguments" has a hard limit of 999 files/folders above which Automator
# throws a "Run Shell Script" error; stdin does not have this limit but alters the way the passed array is referenced.
@duanemoody
duanemoody / ich-loop.js
Last active December 27, 2015 16:49 — forked from ducin/ich-loop.js
$(document).ready( function() {
$('#display').click(function () {
var data = [
{
"name": "Paul McCartney",
"email": "paul.mccartney@beatles.com",
"salary": "400"
},
{
"name": "John Lennon",
$(document).ready( function() {
$('#display').click(function () {
var data = [
{
"name": "Paul McCartney",
"email": "paul.mccartney@beatles.com",
"salary": "400"
},
{
"name": "John Lennon",