Skip to content

Instantly share code, notes, and snippets.

View mjdargen's full-sized avatar

Michael D'Argenio mjdargen

View GitHub Profile
import time
import hashlib
from urllib.request import urlopen
import smtplib
import ssl
import os
import filecmp
from dotenv import load_dotenv
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
@mjdargen
mjdargen / gif2sprite.py
Last active November 8, 2021 19:34
converts a gif into a sprite sheet. handles transparency.
import os
from PIL import Image
def split(gif):
im = Image.open(gif)
for frame in range(im.n_frames):
im.seek(frame)
@mjdargen
mjdargen / buttons.ipynb
Last active November 17, 2021 17:43
CSS style for 1.25" button template sheet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mjdargen
mjdargen / arduino_comms.py
Created July 15, 2021 15:02
Python serial to arduino
import sys
import time
import serial
#
#
# specify the port
PORT = "com6" # windows
@mjdargen
mjdargen / queue_size_starter.asm
Created July 8, 2021 14:29
Starter code for PS7 queue size.
;
; queue_size.asm - subroutine to check queue size.
;
.ORIG x3000
LD R3, FIRST ; initialize front/head
ADD R3, R3, #1 ; add offset to test different values
LD R4, FIRST ; initialize rear/tail
ADD R4, R4, #3 ; add offset to test different values
@mjdargen
mjdargen / temp_starter.asm
Last active July 7, 2021 19:56
Starting point for HW8 Question #2.
;
; temp.asm - converts between celsius and fahrenheit
; Description - start code for HW8
;
.ORIG x3000
LD R1, TEMP ; load temperature
LD R2, UNIT ; load whether celsius/fahrenheit
BRz CELS ; if zero, interpret as C convert to F
@mjdargen
mjdargen / calc_v2_starter.asm
Last active July 7, 2021 20:46
Starting point for PS6 Question #3.
;
; calc_v2.asm
; Performs addition/subtraction/multiplication/division/modulus/exponentiation
; between 2 single-digit, user-entered values to produce 1-2 digit result.
;
; R5 - operation type
; R4 - operand 1
; R3 - operand 2
@mjdargen
mjdargen / eurovision_2021.ipynb
Created June 6, 2021 15:40
Downloads all videos of Eurovision 2021 from YouTube through Google Colab. They are blocked in the US and many other counties.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mjdargen
mjdargen / win_cam_record.py
Last active May 11, 2021 11:42
Record video/audio with Python on Windows using default camera app and pywinauto.
import pywinauto
import time
import subprocess
import os
import datetime
def win_record(duration):
subprocess.run('start microsoft.windows.camera:', shell=True) # open camera app
@mjdargen
mjdargen / retrieve_nasdaq_securities.py
Last active August 13, 2024 19:44
Retrieves NASDAQ listed securities from NASDAQ ftp server updated nightly.
# http://www.nasdaqtrader.com/trader.aspx?id=symboldirdefs
# NASDAQ-Listed Securities
# File Name: nasdaqlisted.txt
# FTP Directory: ftp://ftp.nasdaqtrader.com/symboldirectory
# Field Name Definition
# Symbol The one to four or five character identifier for each
# NASDAQ-listed security.
# Security Name Company issuing the security.
# Market Category The category assigned to the issue by NASDAQ based on