Skip to content

Instantly share code, notes, and snippets.

View randy909's full-sized avatar

Randy Hancock randy909

  • Saint Louis, MO
View GitHub Profile
Dir.glob('*.{mp3,MP3}') do |file|
match = file.match(/^(.+\()(\d+)(\).+)/)
if (match == nil)
puts "skipping #{file}"
next
end
front, num, back = match.captures
num = num.rjust(2, '0')
newfile = front + num + back
puts "renaming #{file} to #{newfile}"
@randy909
randy909 / CapsLockCtrlEscape.ahk
Last active January 2, 2021 09:44 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own, and Ctrl when used in combination with another key, à la Steve Losh. Adapted from the one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281).
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}