Skip to content

Instantly share code, notes, and snippets.

View HatScripts's full-sized avatar
🎩

HatScripts HatScripts

🎩
View GitHub Profile
@HatScripts
HatScripts / video-thumbnails-generator.sh
Created August 24, 2018 05:26 — forked from shunchu/video-thumbnails-generator.sh
Batch generate thumbnails from mp4 files using ffmpg
#!/bin/bash
# setup
FILES=name_of_file_to_match_*.mp4
SEEK_POINT=00:00:30
IMG_FORMAT=png
FRAME_SIZE=150X100
DEST=thumbnails
for f in $FILES
@HatScripts
HatScripts / run_as_admin.py
Last active September 18, 2020 15:41 — forked from GaryLee/RunAsAdmin.py
Elevate the privilege to admin. Support both python script and pyinstaller wrapped program. Need ctypes only.
# Based on Gary Lee's code:
# https://gist.github.com/GaryLee/d1cf2089c3a515691919
# https://stackoverflow.com/a/33856172/2203482
def run_as_admin(argv=None):
import ctypes
shell32 = ctypes.windll.shell32
if argv is None and shell32.IsUserAnAdmin():
return True
import sys