Skip to content

Instantly share code, notes, and snippets.

View willwm's full-sized avatar

Will Wolff-Myren willwm

View GitHub Profile
{
"id": "Ag8EAQAKCwAPAAwIBAoJAQ",
"links": [
{
"active": true,
"iden": "CwgODwQAAwwCBAcNBAcGBQ",
"created": 1534960753.141877,
"modified": 1534970458.090077,
"type": "link",
"title": "Example Domain",

Clone w/Submodules

git clone --recurse-submodules

Fetch and Prune

git fetch -p
@willwm
willwm / resizeandcenter.sh
Last active July 19, 2020 04:40
Resize and Center With wmctrl
# https://forums.linuxmint.com/viewtopic.php?p=1543828#p1543828
# https://linux.die.net/man/1/wmctrl
# 1800x1500 (Center)
wmctrl -r :ACTIVE: -e 0,1020,330,1800,1500
# 2560x1600 (Center)
wmctrl -r :ACTIVE: -e 0,640,280,2560,1600
# 3200x1900 (Center)
@willwm
willwm / bookmarklet-markdown-link.js
Last active September 22, 2021 21:00 — forked from Rarst/md-link.js
Bookmarklet for markdown link of current page (incl. optional selected text as quote)
@willwm
willwm / bookmarklet-youtube-unsubscribe-all.js
Last active March 25, 2024 03:11
Bookmarklet: Unsubscribe from YouTube channels in bulk
javascript:(() => {
const timeout = 500;
const buttons = document.querySelectorAll("[aria-label^='Unsubscribe from']");
for(let button of buttons) {
setTimeout(() => {
console.group(button.attributes['aria-label'].value);
setTimeout(() => { button.click(); }, timeout);
@willwm
willwm / bookmarklet-youtube-clear-watch-later.js
Last active July 19, 2020 04:26
Bookmarklet: Clear videos from YouTube Watch Later in bulk
javascript:(() => {
const timeout = 500;
let clickTimeout = timeout;
const buttons = document.querySelectorAll('.pl-video-edit-remove');
for (let button of buttons) {
setTimeout(() => {
console.group(button);
setTimeout(() => { button.click(); }, timeout);
console.groupEnd();
@willwm
willwm / docker-restart.ps1
Last active July 19, 2020 04:32
Workaround for Docker/Hyper-V unexpectedly "locking" TCP port ranges
# (Re)start all containers, including those not currently running
docker restart $(docker ps -a -q)
# Stop all containers
docker stop $(docker ps -a -q)
# Remove all containers, including those not currently running
docker rm $(docker ps -a -q)
@willwm
willwm / Run-Portainer.ps1
Created May 3, 2019 19:59
Run Portainer for Windows and hide the portainer container from the UI
docker run -d -p 9000:9000 --name portainer --restart always --label hide=true -v /var/run/docker.sock:/var/run/docker.sock -v C:\ProgramData\Portainer:/data portainer/portainer -l hide=true
# Show (and follow) logs for container with "sqlserver" in container name
docker logs -f $(docker ps --filter="name=sqlserver" -q)
# Stop all containers, then system prune
docker stop $(docker ps -a -q); docker system prune -f;
# List names, status, and ports of running containers
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
# List only names of running containers (https://stackoverflow.com/a/50667460/122283)
# Get all enabled Windows Features, sorted by FeatureName
Get-WindowsOptionalFeature -Online | Where-Object State -eq "Enabled" | Sort-Object -Property "FeatureName" | Foreach { $_.FeatureName }