Skip to content

Instantly share code, notes, and snippets.

@huaminghuangtw
huaminghuangtw / youtube-no-ads.md
Last active July 17, 2025 07:17
How to watch YouTube videos without any ads?

One of the annoying distractions while watching YouTube videos is the constant interruption by advertisements—it breaks the flow and ruins the viewing experience. A simple trick I found is to watch videos in "Embed Mode". Most videos play seamlessly this way—even if you don’t have an ad blocker installed. It works on mobile too!


  1. Click the Share button below the YouTube video.
  2. From the sharing options, click Embed.
    • This will open the video in embed mode.
@huaminghuangtw
huaminghuangtw / YouTubePlaylistVideoURLExtractor.js
Created August 31, 2024 05:34
A JavaScript script to automatically extract and download YouTube video URLs from a playlist page. This can be useful for exporting videos from the Watch Later playlist. For removing all videos from the Watch Later playlist please visit: https://gist.github.com/astamicu/eb351ce10451f1a51b71a1287d36880f
function getVideoURLs() {
const videoElements = document.querySelectorAll('a#video-title');
const videoURLs = Array.from(videoElements).map(video => {
const url = new URL(video.href);
const videoId = url.searchParams.get('v');
return `https://www.youtube.com/watch?v=${videoId}`;
}).filter(url => url.includes('v='));
return videoURLs;
}
# Reload Zsh configuration files
reload() {
local zdotdir=${ZDOTDIR:-$HOME}
source "$zdotdir/.zshenv"
source "$zdotdir/.zprofile"
source "$zdotdir/.zshrc"
source "$zdotdir/.zlogin"
source "$zdotdir/.zlogout"
}
@huaminghuangtw
huaminghuangtw / autohotkey-media-control.ahk
Last active September 24, 2024 03:02
Keyboard shortcuts for media control in Windows 10 using AutoHotkey
^!Space::Media_Play_Pause ;"Ctrl + Alt + Space" to play/pause/resume media
^!Shift::Volume_Mute ;"Ctrl + Alt + Shift" to toggle mute/unmute
^!Left::Media_Prev ;"Ctrl + Alt + ⭠" to play previous clip
^!Right::Media_Next ;"Ctrl + Alt + ⭢" to play next clip
^!Up::Volume_Up ;"Ctrl + Alt + ⭡" to increase volume
^!Down::Volume_Down ;"Ctrl + Alt + ⭣" to reduce volume
@huaminghuangtw
huaminghuangtw / keybindings.json
Last active April 28, 2022 12:34
Configuration for LaTeX-Workshop (VS Code Extension)
[
{
"key": "ctrl+shift+B",
"command": "editor.action.insertSnippet",
"when": "editorHasSelection && resourceExtname == .tex",
"args": {
"snippet": "\\textbf{${TM_SELECTED_TEXT}}$0"
}
},
{