Skip to content

Instantly share code, notes, and snippets.

akaleeroy / ExtractAllDiagramsToSheets.bas
Created March 4, 2021 22:36
Extract all chart data to sheets LibreOffice Writer macro
REM ***** BASIC *****
'Extract data from all charts in document
'Will open all charts as new Calc spreadsheets
'and you can edit them and save them there.
'Based on ExtractDiagramToSheet by
Sub ExtractAllDiagramsToSheets
akaleeroy /
Last active June 10, 2019 12:18
d3.js – Automatic label placement with d3-labeler

d3.js v3 + tinker10/D3-Labeler: D3 plug-in for automatic label placement using simulated annealing.

Trying to get good auto-placing of labels on a map.

Am I doing something wrong? It doesn't completely avoid overlaps...
I don't want to have to manually go in and fix overlaps. That way these SVGs can be exported automatically by a build system.

⚠️ Give it a refresh so that the webfont loads from cache.
I didn't take the time to fix orchestration here because I have Montserrat v5 installed, I don't care about running it on the web.

akaleeroy / fluxautomation.ahk
Last active March 12, 2019 09:50
Disable f.lux when specific display connected
; Listens for display connected and checks its name against TARGET_DISPLAYS
; then automates "disable for fullscreen apps" option
; CONFIGURE your projector/TV here. Use the names from Screen resolution control panel
global TARGET_DISPLAYS := "MP-CL1A,SONY TV XV" ; MatchList
; [Beginner question and script for dual monitors](
OnMessage(0x7E, "onDisplayChange")
onDisplayChange() {
akaleeroy / youtube-badtitles.js
Last active September 25, 2020 01:33
Parsing song titles on YouTube
/* eslint-disable */
// YouTube Music Uploader Hall of Shame
// Trying to grok the range of malformed input in song title strings
'BPC335 - Maxime Iko "Concilium"', // wrong order (catalog number before everything else), extra info (catalog number), bad separator `"`, bad extra separator `-`
'"Pollution" by Tom Lehrer', // wrong order (`Artist - Title` reversed), quotes, bad separator `by`
'DIS IZ WHY I\'M HOT (zef remix) - Die Antwoord', // `Artist - Title` reversed, bad case
'Man with no name - Teleport (Original mix). HQ', // bad case, noisy `(Original mix)`, extra info `HQ`, bad extra separator `.`
'Varg — Under Beige Nylon', // uneven spaces, bad separator `—`
'varg - under beige nylon - 46bpm', // bad case, bad extra separator `-`, extra info `46bpm`
akaleeroy / Quick Folder
Last active January 20, 2019 13:47
Quick Folder Aliases - Self-shortcut aliases to help you find a folder by several names

Quick Folder Aliases

Windows AutoHotkey Usability Accelerator

Quick Folder Aliases with Hotkey

In Windows Explorer press Win + F2 or Win + ; to create a self-shortcut alias for the currently opened folder.

akaleeroy / taskbar-quick-close.ahk
Created July 7, 2018 08:21
Taskbar Quick Close
; Taskbar Quick Close
; Quick closing windows from the taskbar with Middle-click.
; Ctrl + Middle-click for original action (new window)
#If ShouldActivateMButton()
; Control + Middle-click does the middle-click action (new window)
; Middle-click to close, for quicker one-handed use
MouseClick, Right
akaleeroy /
Last active February 14, 2021 10:51
Slick Scrollbars Userstyle

Slick Scrollbars Userstyle

Replace the appalling default Windows scrollbars with these good ones.

Slick Scrollbars Userstyle Demo

They are thin and unobtrusive but by using border: 5px solid transparent they are just as easy to hit.
No need to change width on hover and reflow contents!

akaleeroy / pre-commit
Last active January 12, 2020 20:06
OpenSCAD Export git pre-commit hook
# Requires OpenSCAD on $PATH
# Automatically re-exports all changed .scad files pre-commit
git diff --cached --name-only | grep ".scad$" | while read -r file; do
echo "Exporting $file to $basename.stl..."
openscad -o "$basename.stl" "$file"
akaleeroy /
Last active May 6, 2021 10:34
Gulp replace only relevant files

gulp-replace only relevant files

gulp replace only relevant files demo

Piping to gulp.dest would re-write all input files. This checks for the pattern first and only passes along files that actually need to be processed, avoiding unnecessary overwriting with the same content. A benefit is that your files' timestamps stay meaningful.

akaleeroy /
Last active March 23, 2024 09:48
Cursor Language Indicator - Reflect keyboard layout changes in mouse pointer look.

Cursor Language Indicator

Windows AutoHotkey Usability

Reflect keyboard layout changes in mouse pointer look.

Cursor Language Indicator Demo