Skip to content

Instantly share code, notes, and snippets.

@lambdan
lambdan / apple.ahk
Created August 6, 2015 17:58
Apple Wired Keyboard on Windows with Autohotkey
F13::PrintScreen
F14::ScrollLock
F15::Pause
F16::Media_Prev
F17::Media_Play_Pause
F18::Media_Next
F19::Volume_Mute
LAlt::LWin
LWin::LAlt
@lambdan
lambdan / blank-srt.py
Created November 15, 2015 22:25
Generate "blank" .srt to make Plex not display external subtitles over burned in subtitles
import os
import shutil
import sys
triggers = ['swesub']
ignores = ['.py', '.jpg', '.nfo', '.txt', '.sh', '.db', '.srt', '.nu', '.url']
always = False
def writeSrt(srt):
print srt
@lambdan
lambdan / gifer.bat
Last active August 12, 2018 19:15
Create HQ Gif With FFMPEG Batch File
@echo off
set /p video="Video path (drag n drop supported): "
set /p start="Start time (HH:MM:SS.XXX): "
set /p duration="Duration (in secs, eg SS.XXX): "
REM "How to make GIFs with FFMPEG": https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
ffmpeg -ss %start% -t %duration% -i %video% -filter_complex "[0:v] fps=12,scale=480:-1:lanczos,split [a][b];[a] palettegen [p];[b][p] paletteuse" "gif-%date%-%time::=-%.gif"
pause
@lambdan
lambdan / deorganizer.py
Created June 18, 2018 20:55
rom deorganizer - de-organizes everdrive sets and puts all unique roms in one folder
import os
import sys
import hashlib
import shutil
import time
hashes = []
dupes = []
inputdir = "input/"
@lambdan
lambdan / no-intro-dat-matcher.py
Last active January 19, 2020 14:27
Create no-intro sets from unorganized ROMs and DAT-o-MATIC dat files (Python 3)
Moved to https://github.com/lambdan/no_intro_dat_matcher
@lambdan
lambdan / Apple Magic Keyboard with Numpad.ahk
Created August 9, 2018 15:01
Apple Magic Keyboard with Numpad on Windows tweaks
; Autohotkey script for using Apple Magic Keyboard with Numpad on Windows
; I recommend you run the script as admin, otherwise you'll get weird issues with admin priviliged windows - see here for an example of weird issue: https://autohotkey.com/boards/viewtopic.php?f=5&t=53551
; I like to disable Caps Lock and replace it with esc
Capslock::Esc
; Swap left Command/Windows key with left Alt (so ALT-TAB muscle memory doesn't break)
LWin::LAlt
LAlt::LWin
@lambdan
lambdan / itsfuckingraw.py
Created August 19, 2018 13:36
extract snippets of video containing a certain phrase for instance
import os, sys, re, subprocess
tsfile = 'raws.txt'
# create the Timestamps (tsfile) using grep and Sublime Text or whatever you want
# it should contain the episode name/video file + the timestamp, for example:
#
# Seinfeld.S03E15.The.Suicide.720p.HULU.WEBRip.AAC2.0.H.264-NTb.srt-00:14:25,242 --> 00:14:27,775
# Seinfeld.S03E17.The.Boyfriend.720p.HULU.WEBRip.AAC2.0.H.264-NTb.srt-00:12:34,738 --> 00:12:36,639
# S03E18-00:12:34,768 --> 00:12:36,639
# ...
@lambdan
lambdan / Install Font.bat
Created August 22, 2018 16:02
.bat to install new font for World Of Warcraft
@echo off
REM Make a folder called "Fonts" in your WoW folder, i.e. C:/World of Warcraft/Fonts/
REM Put this .bat in there
REM Double click the .bat to run it, and drag n drop a font into the window and hit enter
REM Done!
cd
set /p newfont="Drag n drop a .ttf here: ..."
@lambdan
lambdan / Backup Savefiles.bat
Created September 22, 2018 17:32
backup save files to a .wim archive (duplicate files won't take any additional space)
@echo off
REM SET UP CURRENT DATE TIME AND CREATE FOLDER
for /f "skip=1" %%i in ('wmic os get localdatetime') do if not defined fulldate set fulldate=%%i
set year=%fulldate:~0,4%
set month=%fulldate:~4,2%
set day=%fulldate:~6,2%
set CUR_HH=%time:~0,2%
@lambdan
lambdan / imdb_grid.py
Last active April 30, 2019 14:41
Make image grid of posters from IMDB (Python 3, Pillow)
from PIL import Image
import os
# pip install Pillow
##### Settings #####
grid_size = 9,4 # columns x rows
workdir = '.' # default: "." - current folder
out_file = '_out.png'