Skip to content

Instantly share code, notes, and snippets.

View JeremyMorgan's full-sized avatar

Jeremy Morgan JeremyMorgan

View GitHub Profile
import unittest
"""
This is a function to extract numbers from the string.
It is implemented in my main script that reads the entire input file and runs
this function against each line.
"""
from [YOURSCRIPT] import extract_numbers
class TestExtract(unittest.TestCase):
@JeremyMorgan
JeremyMorgan / cmake.sh
Last active May 25, 2023 19:01
My latest OpenCV CMake config
export OPENCV_DOWNLOAD_PATH=/tmp/opencv-cache
cmake -D CMAKE_C_COMPILER=/usr/bin/clang-15 -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_PREFIX_PATH=/usr/lib -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -D WITH_CUDA=ON -D CUDA_ARCH_BIN=8.9 -D ARCH=sm_89 -D gencode=arch=compute_89,code=sm_89 -D ENABLE_FAST_MATH=ON -D CUDA_FAST_MATH=ON -D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_NVCUVID=ON -D WITH_OPENMP=ON -D BUILD_EXAMPLES=ON -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_TBB=ON -D WITH_IPP=ON -D WITH_NVCUVID=ON -D WITH_CSTRIPES=ON -D WITH_OPENCL=ON -D WITH_FFMPEG=ON -D BUILD_opencv_apps=ON -D OPENCV_DOWNLOAD_PATH=/tmp/opencv-cache -D WITH_PNG=ON -D WITH_JPEG=ON -D WITH_WEBP=ON -D WITH_V4L=ON -D WITH_GTK=ON -D WITH_QT=ON -D WITH_GPHOTO2=ON -D WITH_GSTREAMER=ON -D WITH_PROTOBUF=ON -D OPENCV_DNN_CUDA=ON -D CMAKE_PREFIX_PATH=/usr/lib -D CMAKE_CXX_FLAGS="-Ofast" ../opencv
@JeremyMorgan
JeremyMorgan / Batman-vs-ironman.txt
Created April 24, 2023 02:20
Batman vs IronMan
Jeremy: Who is the better superhero? Batman or Ironman?
ChatGPT: As an AI language model, I do not have personal opinions or preferences. However, I can provide you with a comparison between Batman and Iron Man to help you decide for yourself.
Batman, also known as Bruce Wayne, is a DC Comics superhero created by artist Bob Kane and writer Bill Finger in 1939. Batman is a highly skilled martial artist and detective, utilizing his intellect, technology, and wealth to fight crime in Gotham City. He does not possess any superhuman abilities but relies on his physical prowess, gadgets, and vehicles. Batman's motivation stems from witnessing the murder of his parents, which drives him to protect innocent people and bring justice to criminals.
Iron Man, or Tony Stark, is a Marvel Comics superhero created by writer Stan Lee, artist Don Heck, and scripter Larry Lieber in 1963. Tony Stark is a billionaire inventor, engineer, and philanthropist who created the Iron Man suit to save his own life after being injured a
@JeremyMorgan
JeremyMorgan / mutethisshit.txt
Created April 8, 2023 03:46
Great terms to mute on Twitter
#politics
#election
#government
#policy
#vote
#democracy
#republican
#democrat
#conservative
#liberal
@JeremyMorgan
JeremyMorgan / process.cs
Created June 15, 2021 18:11
Blazor Upload
private async Task processImage() {
// create single httpclient
HttpClient client = new HttpClient {
BaseAddress = new Uri(baseUrl + "/face/v1.0/detect?returnFaceAttributes=age,glasses,emotion,headpose,gender&ReturnFaceLandmarks=true")
};
HttpResponseMessage response = null;
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "xxxxxxxxxxxxxxxxxxx");
@JeremyMorgan
JeremyMorgan / checktags.py
Created April 1, 2021 18:45
Check for doubled up tags
tags = self.webpage.pagedata["tags"].split('|')
for tag in tags:
if len(tag) > 1:
#Check if this is a doubled up tag
#some look like this "IT OpsSoftware Development"
cleantag = self.checktag(tag)
if len(cleantag) > 1:
stackedTags += "- " + cleantag[0] + "\n"
stackedTags += "- " + cleantag[1] + "\n"
else :
@JeremyMorgan
JeremyMorgan / pciconf.out.txt
Created December 29, 2020 17:27
Lenovo e590 Laptop FreeBSD Info
hostb0@pci0:0:0:0: class=0x060000 card=0x507217aa chip=0x3e348086 rev=0x0c hdr=0x00
vendor = 'Intel Corporation'
device = 'Coffee Lake HOST and DRAM Controller'
class = bridge
subclass = HOST-PCI
vgapci0@pci0:0:2:0: class=0x030000 card=0x507217aa chip=0x3ea08086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = 'UHD Graphics 620 (Whiskey Lake)'
class = display
subclass = VGA
@JeremyMorgan
JeremyMorgan / dmesg.out.txt
Created December 29, 2020 17:27
Lenovo e590 Laptop FreeBSD Info
ugen0.4: <Azurewave Integrated Camera> at usbus0
ums0 on uhub0
ums0: <Logitech USB Receiver, class 0/0, rev 2.00/12.10, addr 1> on usbus0
ums0: 16 buttons and [XYZT] coordinates ID=2
uhid0 on uhub0
uhid0: <Logitech USB Receiver, class 0/0, rev 2.00/12.10, addr 1> on usbus0
wlan0: link state changed to DOWN
Waiting (max 60 seconds) for system process `vnlru' to stop... done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining... 0 0 done
@JeremyMorgan
JeremyMorgan / devinfo.out.txt
Created December 29, 2020 17:26
Lenovo e590 FreeBSD info
nexus0
cryptosoft0
efirtc0
apic0
ram0
acpi0
acpi_ec0 pnpinfo _HID=PNP0C09 _UID=0 at handle=\_SB_.PCI0.LPCB.EC__
pcib0 pnpinfo _HID=PNP0A08 _UID=0 at handle=\_SB_.PCI0
pci0
hostb0 pnpinfo vendor=0x8086 device=0x3e34 subvendor=0x17aa subdevice=0x5072 class=0x060000 at slot=0 function=0 dbsf=pci0:0:0:0
@JeremyMorgan
JeremyMorgan / acpidump.out.txt
Created December 29, 2020 17:25
Lenovo e590 Laptop FreeBSD Info
/*
RSD PTR: OEM=LENOVO, ACPI_Rev=2.0x (2)
XSDT=0x000000007ae0c188, length=36, cksum=57
*/
/*
XSDT: Length=268, Revision=1, Checksum=25,
OEMID=LENOVO, OEM Table ID=TP-R0Y, OEM Revision=0x290,
Creator ID=PTEC, Creator Revision=0x2
Entries={ 0x0000000079a18000, 0x0000000079a6d000, 0x0000000079a6c000, 0x0000000079a33000, 0x0000000079a1d000, 0x0000000079a1c000, 0x0000000079a1b000, 0x000000007ac23000, 0x0000000079a19000, 0x0000000079a17000, 0x0000000079a16000, 0x0000000079a15000, 0x0000000079a14000, 0x00000000799ed000, 0x00000000799ec000, 0x00000000799eb000, 0x00000000799ea000, 0x00000000799e9000, 0x00000000799e8000, 0x00000000799e6000, 0x00000000799e5000, 0x00000000799e4000, 0x00000000799e3000, 0x0000000079806000, 0x0000000078a03000, 0x0000000078a01000, 0x00000000789ff000, 0x00000000789fe000, 0x000000007ac00000 }
*/