Skip to content

Instantly share code, notes, and snippets.

View JacobDB's full-sized avatar

Jacob Bearce JacobDB

View GitHub Profile
@JacobDB
JacobDB / twitch.sh
Created August 24, 2020 15:37
Download Twitch VODs
#!/bin/sh
# To find proper value for $1, open a developer tools on a Twitch stream and select "Network." Search for "m3u8," copy the longest URL you see, and it should work.
ffmpeg -i $1 -c copy -bsf:a aac_adtstoasc $2
@JacobDB
JacobDB / auto-nvm.sh
Created April 14, 2021 16:09
Automatically switch NVM versions when entering directories which contain `.nvmrc`
#!/bin/bash
# Run 'nvm use' automatically every time there's a .nvmrc file in the directory.
# Also, revert to default version when entering a directory without .nvmrc
enter_directory() {
if [[ $PWD == $PREV_PWD ]]; then
return
fi
PREV_PWD=$PWD
@JacobDB
JacobDB / functions.php
Created August 30, 2023 14:34
Send preload headers for WordPress CSS files
<?php
/**
* Preload styles
*
* @return void
*/
function mytheme_preload_styles(): void {
global $wp_styles;
if ($wp_styles) {