Skip to content

Instantly share code, notes, and snippets.

r4dian / Dark mode for any website.js
Created Nov 25, 2022
Make any website have a dark mode, by saving each of these 3 lines as a bookmarklet.
View Dark mode for any website.js
// dimmer
javascript:var style=document.createElement('style');style.innerText='html{filter:saturate(25%) invert(80%) brightness(80%)}img{filter:invert(100%);}';var head=document.getElementsByTagName('head')[0];head.appendChild(style);
// less dim, but still inverted
javascript:var style=document.createElement('style');style.innerText='html{filter:saturate(33%) invert(90%);}img{filter:invert(100%);}';var head=document.getElementsByTagName('head')[0];head.appendChild(style);
// undo dimmer
javascript:var style=document.createElement('style');style.innerText='html{filter:saturate(100%) invert(0%) brightness(100%);}img{filter:invert(0%);}';var head=document.getElementsByTagName('head')[0];head.appendChild(style);
r4dian /
Last active Jul 3, 2022 — forked from kroger/
Rename wav files using frequency and pitch detection
#!/usr/bin/env python2
import subprocess, os, glob, math
## /!\ Python 2.x /!\
## requires [Aubio](
## Rename wav files using frequency and pitch detection:
## GTR_08.wav ---> automated pitch detection & file renaming ---> GTR_08 - C3 (+0cents) - 130.81Hz.wav
r4dian /
Last active Apr 11, 2022
Reaper's default video output when you selct `QT/MOV/MP4` is .mov. But fuck .mov, I want an .mp4
ffmpeg -i -codec:audio aac -b:audio 128k -codec:video libx264 -crf 23 filename.mp4
r4dian / Sample
Created Apr 11, 2022
Copy all the samples from your NI Expansions to `C:\Users\Public\Documents\NI Samples` so you can put them on a hardware sampler, etc.
View Sample
cd /mnt/c/Users/Public/Documents &&\
rsync -a --prune-empty-dirs --include '*/' --include '*.wav' --exclude '*' . ./NI\ Samples
r4dian /
Created Mar 15, 2022
Generate a test tone, where the comment in the .wav data is the command used to create it .... [bash / zsh]
sox -V -r 48000 -n -b 16 -c 2 --comment "$(tail -1 $HISTFILE | sed 's/.\{15\}//')" tone.wav synth 30 sin 220 vol -12dB; #test tone: a3 note / 220Hz, -12dB
r4dian /
Created Feb 13, 2022
Sane keymap for hUGEtracker with white notes on z-m & q-p, and with ♯/♭ on S-J & 2-0
<?xml version="1.0" encoding="UTF-8"?>
<grid version="3">
<saveoptions create="True" position="True" content="True"/>
<design columncount="2" rowcount="30" fixedcols="0" fixedrows="1" defaultcolwidth="120" isdefaultcolwidth="1" defaultrowheight="22" isdefaultrowheight="0" color="clWindow">
<columns columnsenabled="True" columncount="2">
<index value="0"/>
<buttonstyle value="0"/>
r4dian / use edge instead of
Created Jan 14, 2022
Use edge to open websites from WSL.
View use edge instead of
sudo update-alternatives --set www-browser /usr/bin/wslview
r4dian / Unfollow.js
Created Oct 16, 2017
Unfollow everything & everyone on Facebook.
View Unfollow.js
// Manual set-up
// click: ▼ at top-right
// Newsfeed preferences
// "Unfollow people to hide their posts" (also includes all Pages, which are not real "people")
// Scroll to the bottom of that so they are all listed
// Open console (f12, or whatever the fuck on MacOS) and paste these two lines:
var e = document.querySelectorAll("._5u3n");
e.forEach(function(elem){ });
r4dian /
Last active Sep 29, 2020
Upload to from Powershell
function transfer ($filename)
$file = Get-Item $filename;
invoke-webrequest -method put -infile $file.FullName
"Test" | Set-Content .\test.txt
r4dian / StickyNotes-OnTop.ps1
Created Aug 2, 2019
Make Sticky Notes Always on Top
View StickyNotes-OnTop.ps1
$code = @'
public static extern IntPtr GetForegroundWindow();
Add-Type $code -Name Utils -Namespace Win32
$hwnd = [Win32.Utils]::GetForegroundWindow()
Get-Process |
Where-Object { $_.mainWindowHandle -eq $hwnd } |