Skip to content

Instantly share code, notes, and snippets.

View addohm's full-sized avatar
🤬
I may be slow to respond.

Adam addohm

🤬
I may be slow to respond.
View GitHub Profile
@addohm
addohm / ImageWorx.py
Last active January 3, 2018 15:36
Image conversion and resize with constraints
import os # , sys, io
import argparse
from pathlib import Path
from PIL import Image
xfp_vmax = 225 # Do not change
xfp_hmax = 384 # Do not change
sfp_vmax = 0
sfp_hmax = 0
@addohm
addohm / DbSettings.bas
Created November 30, 2018 04:11
VBA Read DB Settings in from file
Attribute VB_Name = "dbSettings"
Public Function ConnectionString() As String
Dim sqlSettings() As Variant
Dim SqlServer, SqlDBName, SqlUserName, SqlPassword As String
'read in sql parameters
sqlSettings = getSettings
'move parameters into readable variable names
@addohm
addohm / RoboticsPrint.cls
Last active November 30, 2018 04:17
VBA Example of Shell Execute that waits for completion and returns exit code
Private actLocation As Integer
Private actPrinterType As Integer
Private actSerialNumber As String
Private actPath As String
Private actStatusCheck
Private actVersion As Integer
Private actBoxID As Integer
Option Explicit
@addohm
addohm / FuncOrSub.bas
Created November 30, 2018 04:21
Setting up an SQL connection and using it
Sub DoSomething()
Set conn = New ADODB.connection
Set cmd = New ADODB.Command
conn.Open ThisDisplay.SqlConnectionParameters.ConnectionString
...
...
...
conn.Close
If Not conn Is Nothing Then Set conn = Nothing
@addohm
addohm / SystemPriority.bas
Last active November 30, 2018 04:24
Set High Priority to a process from VBA in Windows
Public Sub setPriority(processName as String)
Const IDLE = 64
Const BELOW_NORMAL = 16384
Const NORMAL = 32
Const ABOVE_NORMAL = 32768
Const HIGH = 128
Const REALTIME = 256
Dim strComputer As String
Dim objWMIService As Object
@addohm
addohm / constrain.vb
Created December 10, 2018 03:07
Proportional Image Constraints
Sub ConstrainImage(filePath as String)
Dim img As Image = Image.FromFile(filePath)
Dim imgX As Integer = img.Width
Dim imgXLim As Integer = 350
Dim imgY As Integer = img.Height
Dim imgYLim As Integer = 100
Dim imgXdiff As Integer = imgX - imgXLim
Dim imgYdiff As Integer = imgY - imgYLim
Dim growFactor As Double
Dim shrinkFactor As Double
@addohm
addohm / duolingo_tts_url.py
Created February 12, 2019 13:58
Supplement to the duolingo-api
import json
import requests
import re
import sys
import os
import random
import bs4
from decouple import Csv, config
@addohm
addohm / Auto_Gather_Find_Swap.py
Last active January 26, 2020 05:23
Find Type Swapper
import pyautogui
import time
pyautogui.PAUSE = 0.1
pyautogui.FAILSAFE = True
screensize = pyautogui.size()
screenX_center = screensize.width / 2
screenY_center = screensize.height / 2
@addohm
addohm / macros.txt
Last active June 15, 2023 20:53
WoW Warrior Macros
===================================GENERAL WARRIOR MACROS=================================
#showtooltip
/use 14
/targetmarker 8
/say Kill {skull}%t{skull}
#showtooltip
/use 13