A Pen by Duane Moody on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Delegation capable of detecting multiple events at the same time | |
* @param {string} events - space separated list of events | |
* @param {string} selector - CSS selector string | |
* @param {function} handler - callback function to call when event is captured | |
* @return {Object} - this object, for chaining | |
* @example | |
* containerElement.on("input", "input[type=tel]", function () { | |
* this.value = this.value.replace(/\D/g, ""); | |
* }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready( function() { | |
$('#display').click(function () { | |
var data = [ | |
{ | |
"name": "Paul McCartney", | |
"email": "[email protected]", | |
"salary": "400" | |
}, | |
{ | |
"name": "John Lennon", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready( function() { | |
$('#display').click(function () { | |
var data = [ | |
{ | |
"name": "Paul McCartney", | |
"email": "[email protected]", | |
"salary": "400" | |
}, | |
{ | |
"name": "John Lennon", |