Skip to content

Instantly share code, notes, and snippets.

@HamousOnWheels
HamousOnWheels / freakingMenuBar.css
Created August 27, 2023 19:33
thunderbird userchrome tweaks to fix up the deranged menu bar situation
/* put this in the chrome folder and load it in your main userChrome.css file with @import url("freakingMenuBar.css") screen; */
/* move the menu bar up top. give it some height */
#toolbar-menubar {
order: -1 !important;
height: 30px !important;
}
/* move it a little bit to the left to make space for the sidebar button */
#toolbar-menubar > #mail-menubar {
@HamousOnWheels
HamousOnWheels / firefoxInactive.css
Created August 27, 2023 19:32
userchrome tweaks for firefox and thunderbird to make window focus more readable
/* put this in the chrome folder and load it in your main userChrome.css file with @import url("firefoxInactive.css") screen; */
/* adding the system accent colour to the non-system titlebar. you can also just use regular background colour instead of gradient if you're BORING*/
#toolbar-menubar {
background: linear-gradient(180deg, AccentColor 50%, rgba(0,0,0,0)) !important;
}
/* dimming the titlebar and most elements on it when inactive */
#toolbar-menubar:-moz-window-inactive {
background: transparent !important;
@HamousOnWheels
HamousOnWheels / video_to_gif.py
Created April 9, 2022 17:27
quick script for converting a video to gif, with the choice of resulting dimensions and framerate
import easygui, sys, os
#TODO remake for multiple files
try:
# get input file from dragging and dropping onto the script
input_file=sys.argv[1]
except IndexError:
# if the script is double clicked, open a file dialog
input_file=easygui.fileopenbox()
@HamousOnWheels
HamousOnWheels / SpringLoadedKey.ahk
Last active February 26, 2022 16:42
Autohotkey function that replicates Photoshop's spring loaded keys for any key. Makes a toggle temporary if key is held, or permanent if key is tapped.
; Replicates spring loaded key functionality for any key
SpringLoadedKey(key, timeHeld) ; parameters: hotkey that you want to send, timeout for the key to be considered held and not tapped
{
send { %key% } ; send first hotkey on key down
keywait, %A_ThisHotkey% ; wait for key up
if (A_TimeSinceThisHotkey > timeHeld) ; if key was down for more than the timeout value,
{ ; then on key up send the second hotkey to toggle it off,
send { %key% } ; otherwise do nothing, making the toggle 'stick'
}
}
@HamousOnWheels
HamousOnWheels / DragDistance.reg
Created October 18, 2019 20:27
Increase minimum mouse drag distance. Useful for pen tablets
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop]
"DragHeight"="50"
[HKEY_CURRENT_USER\Control Panel\Desktop]
"DragWidth"="50"
@HamousOnWheels
HamousOnWheels / IDEtoAHCI.reg
Created October 18, 2019 20:25
Change SATA mode from IDE to AHCI after having installed windows. Restart, then change bios setting after applying
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\msahci]
"Start"=dword:00000000
@HamousOnWheels
HamousOnWheels / SetLeftie.ps1
Created April 15, 2018 14:17
Set wacom tablet orientation to left handed. For tablet models that don't reveal this setting in the driver.
& "C:\Program Files\Tablet\Wacom\32\PrefUtil.exe" /backup "$ENV:UserProfile\Documents\WacomBackup.wacomprefs"
(Get-Content $ENV:UserProfile\Documents\WacomBackup.wacomprefs).Replace('1</Orientation>' ,
'3</Orientation>' ) |
Set-Content $ENV:UserProfile\Documents\WacomBackup.wacomprefs
& "C:\Program Files\Tablet\Wacom\32\PrefUtil.exe" /restore /silent "$ENV:UserProfile\Documents\WacomBackup.wacomprefs"
Wait-Process -Name PrefUtil #wait until prefutil is done. For some reason it's faster with the /silent switch
Read-Host -Prompt "Done. Press Enter to exit"
@HamousOnWheels
HamousOnWheels / ClearRecycler.ps1
Created April 3, 2018 13:59
Clear recycle bin items older than 6 months
$Shell = New-Object -ComObject Shell.Application
$Global:Recycler = $Shell.NameSpace(0xa)
foreach($item in $Recycler.Items())
{
$DeletedDate = $Recycler.GetDetailsOf($item,2) -replace "\u200f|\u200e",""
$dtDeletedDate = get-date $DeletedDate
If($dtDeletedDate -lt (Get-Date).AddMonths(-6))
{
Remove-Item -Path $item.Path -Confirm:$false -Force -Recurse
@HamousOnWheels
HamousOnWheels / reviveWacom.bat
Last active March 30, 2022 01:49
(BAT version) Reset crashed Wacom drivers
echo Reset crashed Wacom drivers and restore settings automatically (since they can get lost on stopping the service).
echo Tested with driver version 6.3.27-2. Run as admin. Restart your painting app after running the script.
cd %USERPROFILE%\Documents
"C:\Program Files\Tablet\Wacom\32\PrefUtil.exe" /backup WBackup.wacomprefs
net stop WTabletServicePro
net start WTabletServicePro
"C:\Program Files\Tablet\Wacom\32\PrefUtil.exe" /restore WBackup.wacomprefs
@HamousOnWheels
HamousOnWheels / reviveWacom.ps1
Last active March 4, 2018 23:10
Reset crashed Wacom drivers
# Reset crashed Wacom drivers and restore settings automatically (since they can get lost on stopping the service).
# Tested with driver version 6.3.27-2. Restart your painting app after running the script.
#elevation
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}