This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
""" | |
A simple script which converts all the images in | |
the folder it is run from into a single image. | |
Images should be in a directory <searchDir>, with | |
the tiles binned into folders based on their | |
Y-axis identity, named as their X-axis identity. | |
In other words, they should be folders of rows | |
containing column-items for that row of images. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
""" | |
Convert a requirements.txt file to a Poetry project. | |
Just place in the root of your working directory and run! | |
""" | |
sourceFile = "./requirements.txt" | |
import re | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Written for buggy audio drivers that need to be restarted | |
rem In my case, the Claro 8.18 drivers bug out every once in a while on Windows 10, and need restarting to not sound poppy | |
@echo off | |
goto check_Permissions | |
:check_Permissions | |
echo Administrative permissions required to run this script. Checking... | |
net session >nul 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
""" | |
Script and function to get the path of a chocolatey install | |
matching the `pathComponent`, or, if none provided, the | |
last installed path. | |
@author Philip Kahn | |
@date 20230614 | |
@license MIT | |
@url https://gist.github.com/tigerhawkvok/aad3f184b37bb869df5bd337d4b4c22e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
""" | |
Remove LFS tracked files and change them to normal git | |
Python 3.8+, native code | |
For Python <= 3.7, move the Literal and Final imports from "typing" to third-party module "typing_extensions" | |
@author Philip Kahn | |
@url https://gist.github.com/tigerhawkvok/adb7905a2423312f237da1953d6a8eeb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
""" | |
Quick and dirty SQL beautifier | |
""" | |
FILEPATH = "buildWDTables.sql" | |
TABSIZE = 4 | |
####################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works in .bashrc too | |
# Mount the D: drive | |
test -r /mnt/d || eval "$(sudo mkdir /mnt/d)" | |
test -r /mnt/d/'System Volume Information' || eval "$(sudo mount -t drvfs D: /mnt/d)" | |
test -r /mnt/d/'System Volume Information' && echo 'D: successfully mounted' || echo 'Failed to mount removable drive' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
""" | |
Opens all .jpg files in a folder and | |
downsamples them to maximum 1280 pixels wide | |
and quality level 75 | |
""" | |
import glob | |
import os | |
from skimage.io import imread, imsave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
name = "webImages" | |
version = "0.1.0" | |
description = "Scales all images in a directory and preps for web use" | |
authors = ["Philip Kahn <tigerhawkvok@gmail.com>"] | |
license = "MIT" | |
[tool.poetry.dependencies] | |
python = "^3.7" | |
scikit-image = "~0.19.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
""" | |
Cleanup all top level git directories here. | |
Creates a powershell or bash script to then execute | |
https://gist.github.com/tigerhawkvok/2161ef3aead495420fc84588ec50b6a3 | |
Python 3.7+ | |
""" | |
#pylint: disable= line-too-long, invalid-name |
NewerOlder