Skip to content

Instantly share code, notes, and snippets.

View willwm's full-sized avatar

Will Wolff-Myren willwm

View GitHub Profile
@pirate
pirate / docker-compose-backup.sh
Last active January 26, 2025 23:38
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@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-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)
@almeidx
almeidx / markdown-text-101.md
Last active June 2, 2024 19:46 — forked from matthewzring/markdown-text-101.md
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

Sweet Styles

Italics *italics* or _italics_

Underline italics __*underline italics*__

@ramsunvtech
ramsunvtech / groupBy.js
Created September 25, 2018 15:07
Group By - ES6
function groupBy(list, props) {
return list.reduce((a, b) => {
(a[b[props]] = a[b[props]] || []).push(b);
return a;
}, {});
}
// Usage.
groupBy([{
id: 1,
@talyguryn
talyguryn / wildcard-ssl-certificate.md
Last active October 29, 2023 08:57
How to get a wildcard ssl certificate and set up Nginx.

How to get and install a wildcard SSL certificate

In this guide you can find how to resolve the following issues.

Feel free to ask any questions in the comments section below.

# https://win32.io/posts/How-To-Find-Text-PowerShell
Get-ChildItem "C:\path\to\folder" -recurse | Where-Object { (Get-Content $_) -like '*TextToFind*' } | Select-Object { $_.FullName }
# ...as a function:
function Find-TextInFiles($searchPath, $text) {
Get-ChildItem $searchPath -recurse | Where-Object { (Get-Content $_) -like '*$text*' } | Select-Object { $_.FullName }
}
@willwm
willwm / getHashValueForKey.js
Last active April 15, 2018 11:40
Retrieve the value associated with 'key' from window.location.hash
// https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
function getHashValueForKey(key) {
var hash = window.location.hash.substr(1);
var searchParams = new URLSearchParams(hash);
return searchParams.get(key);
}
@raspi
raspi / enable-all-advanced-power-settings.ps1
Last active April 1, 2025 18:18
Enable all advanced power settings in Windows.
# List all possible power config GUIDs in Windows
# Run: this-script.ps1 | Out-File powercfg.ps1
# Then edit and run powercfg.ps1
# (c) Pekka "raspi" Järvinen 2017
$powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting
$powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup
Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingCapabilities | ForEach-Object {
$tmp = $_.ManagedElement
@alexrios
alexrios / .tmux.conf
Last active July 18, 2022 17:50
Turn on mouse interaction with Byobu (~/.byobu/.tmux.conf )
set -g mouse on
set -g mouse-select-pane on
set -g mouse-select-window on
set -g mouse-resize-pane on
set -g mouse-utf8 on