Skip to content

Instantly share code, notes, and snippets.

View benastahl's full-sized avatar
🎯
Focusing

Ben Stahl benastahl

🎯
Focusing
View GitHub Profile
@benastahl
benastahl / account_authority.py
Created December 26, 2022 01:14
Embedded content for our website. Quick preview of a version of the classes we use for orders, availabilities, and users on our website.
from datetime import datetime
class User:
def __init__(self, entry_id, email, grade, hashed_password, auth_token, creation_date, staff, admin, sport_team):
self.entry_id = entry_id
self.first_name = email.split('@')[0].split('_')[0]
self.last_name = email.split('@')[0].split('_')[1]
self.email = email
@benastahl
benastahl / waygrade_gpa_calculator.py
Last active December 16, 2021 17:22
Calculates unweighted and weighted GPA for Wayland High School
def gpa_calculator(class_details):
if not class_details:
print("NO CLASS DETAILS FOR GPA CALCULATOR!")
return {"Weighted": "", "Unweighted": ""}
LETTER_GPA = {
"COLLEGE": {
"A": 4.0,
"A-": 3.7,
@benastahl
benastahl / selenium-proxy.py
Last active August 22, 2021 21:09
use a proxy in your selenium instance
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
proxy = '208.207.224.119:1337:tfzyxgq:lhr2y'
(IPv4, Port, username, password) = proxy.split(':')
ip = IPv4 + ':' + Port
class colors:
HEADER = '\033[95m'
BLUE = '\033[94m'
CYAN = '\033[96m'
GREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
END = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
import sys
if sys.platform == "darwin":
# OS X
file_dividers = "/"
clear_method = "clear"
chromedriver_file = "chromedriver_mac"
elif sys.platform == "win32":
# Windows