Skip to content

Instantly share code, notes, and snippets.

@piousdeer
piousdeer / wsl2-network.ps1
Created July 13, 2020 19:35 — forked from xmeng1/wsl2-network.ps1
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@piousdeer
piousdeer / youtube-max-res-thumbnails.js
Last active August 7, 2020 08:13
A script/bookmarklet to show a little "maxres" link next to every thumbnail on YouTube (obsolete)
document.querySelectorAll('#thumbnail').forEach(tn => {
if (tn.querySelector('.max-res-link')) {
return
}
const link = document.createElement('a')
try {
const maxResURL = tn.querySelector('img').src.replace(/\/[a-z]*default.jpg.*/, '/maxresdefault.jpg')
link.href = maxResURL
@piousdeer
piousdeer / youtube-reveal-tags.js
Last active August 7, 2020 08:12
A script/bookmarklet to reveal a YouTube video's tags (obsolete)
// Basically, this is a minimal version of this extension:
// https://chrome.google.com/webstore/detail/tags-for-youtube/dggphokdgjikekfiakjcpidcclbmkfga
void async function () {
if (!location.href.includes('/watch?v=') || window.tagsAreRevealed) return
window.tagsAreRevealed = true
const superTitle = document.querySelector('.super-title')
addEventListener('yt-page-data-updated', function cleanup () {