Skip to content

Instantly share code, notes, and snippets.

View Lokno's full-sized avatar

Jonathan Decker Lokno

View GitHub Profile
@Lokno
Lokno / value_reduction.shader
Last active December 5, 2023 17:00
OBS shaderfilter designed to clamp the value of a color the more desaturated it is
// https://obsproject.com/forum/resources/obs-shaderfilter.1736/
uniform float vmaxThreshold<
string label = "Threshold";
string widget_type = "slider";
float minimum = 0.0;
float maximum = 1.0;
float step = 0.001;
> = 0.2; //<Range(0.0, 1.0)>
@Lokno
Lokno / blink_wifi_tk_app.py
Created November 28, 2023 19:11
Combines the Telemetrix-AIO library with tk interface to blink an LED on pin 2 of a microcontroller at a specified ip address
@Lokno
Lokno / websocket_pyfirmata_servo.py
Last active November 22, 2023 00:54
Websocket Server that Interfaces with PyFirmata intended to be used with Pixel Composer
import asyncio
import websockets
import pyfirmata
import json
import platform
major,minor,_ = platform.python_version_tuple()
if major != '3':
logging.error('ERROR: Python 3 required to run.')
sys.exit(-1)
@Lokno
Lokno / colorMatrices.js
Last active July 30, 2023 01:02
Color Blindness Matrices
// JSON of 3x3 matrices which transform RGB colors into colorspace which
// simulate the imparement of various color blindness deficiency.
//
// Used by Coblis: http://www.color-blindness.com/Coblis-color-blindness-simulator/
//
// The original website posting the matrices has been taken down:
// http://www.colorjack.com/labs/colormatrix/
//
// RGB transform matrices generated by Michael of www.colorjack.com
// Which were created using code by Matthew Wickline and the
@Lokno
Lokno / find_java_versions.bat
Last active July 23, 2023 20:14
Searches for all java.exe executables on the host machine and runs each with the -version flag to display the Java version information.
@echo off
REM Batch Script: find_java_versions.bat
REM Description: Searches for all java.exe executables on the host machine and runs each with the -version flag
REM to display the Java version information.
REM Set the initial search directory to the root of the C drive (you can change this if needed)
set "search_dir=C:\"
echo Searching for any Java executables ^(java.exe^) in the %search_dir% directory...
@Lokno
Lokno / connect_to_switch.py
Last active January 27, 2023 04:36
Python 3 Script for automatically connecting a PC to hotspot created by the Nintendo Switch to serve media to a smart device
# Python 3 Script for automatically connecting a PC to the temporary hotspot
# created by the Nintendo Switch to serve media to a smartphone
#
# How to Set Up the hotspot transfer from the Nintendo Switch:
# 1. From the HOME Menu select Album, then select a screenshot or video capture.
# 2. Select Sharing and Editing, then select Send to Smartphone.
# 3. Select Only This One or Send a Batch.
# 4. A screen with a QR code will appear with the encoded SSID and password.
# This is where the script will take over.
#
@Lokno
Lokno / eval_clipboard.py
Created January 23, 2023 21:02
Executes the contents of the clipboard as Python and returns the result to the clipboard
# Executes the contents of the clipboard as Python and returns the result to the clipboard
# Uses eval() if single-line and uses compile() and exec() if multi-line
# Will attempt to handle a limited number of NameError exceptions
# Obvious at your own risk and know what you're doing caveats
import pyperclip
import traceback
import contextlib
import sys
import re
@Lokno
Lokno / ocr_shortcut.ahk
Last active January 13, 2023 20:04
AutoHotKey script to add a keyboard shortcut to process a region of the screen using OCR and copy the result into the clipboard
; AutoHotKey script to add a keyboard shortcut to select a region of the screen,
; run OCR on that region, and paste the result in the clipboard.
; Set to look for English text, see line 24
; Shortcut default is ctrl+shift+alt+i, see line 20
; Press esc when selecting to close, or right-click system tray icon
; Modified script from OP of this forum post:
; https://www.autohotkey.com/boards/viewtopic.php?p=314654#p314654
@Lokno
Lokno / webclipboard.py
Last active January 9, 2023 07:24
Cross-platform python script that maintains an encrypted copy of your clipboard at a user-specified remote location
# Cross-platform python script that maintains an encrypted copy of your clipboard
# at a user-specified remote location. Complete with tkinter GUI set-up.
#
# Author: Lokno Decker
#
# Usage: webclipboard.py copy|paste [--reset] [--show-config]
# Options:
# copy : encrypts the contents of the current clipboard to file
# and uploads this file to a user-specified remote server.
# paste : downloads the clipboard file from a user-specified
@Lokno
Lokno / webp_begone.py
Last active September 9, 2022 03:50
Python 3 script that replaces every webp on your desktop with a PNG. Requires Google's dwebp decoder (https://developers.google.com/speed/webp/docs/dwebp)
# Webp-Begone
#
# Iterates over all the files ending in ".webp" on the Desktop and converts
# them to PNG files using the Google utiltiy dwebp
# Alteratively a different directory path can be specified at the cmdline
# Install dwebp and add it to your path
# https://developers.google.com/speed/webp/docs/dwebp
# https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html