Skip to content

Instantly share code, notes, and snippets.

View se7enack's full-sized avatar
🏠
Working from home

Stephen Burke se7enack

🏠
Working from home
View GitHub Profile
title = "Planned Maintenance"
date = "November 5, 2025"
span = "1 Hour"
time = "8:00 PM GMT"
location = "London, England"
buffer = 40
display = f'''
{"*" * buffer}
#!/usr/bin/env python3
from email.message import EmailMessage
import ssl
import smtplib
# create pw here https://myaccount.google.com/u/4/apppasswords after you enable 2-factor
password = "SOMEPASSWORD"
sender = "youremail@gmail.com"
#!/usr/bin/env python3
nums = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
# filter for prime numbers
prime = list(filter(lambda number: all(number % i != 0 for i in range(2, int(number**0.5) + 1)), nums))
print(prime)
# cube them
cubed = list(map(lambda x: x**3, prime))
@se7enack
se7enack / threading-example.py
Created February 16, 2024 14:56
Python3 Threading
#!/usr/bin/env python3
import time
import curses
import os
import threading
import subprocess
def waitforthis(thread):
#!/usr/bin/env python3
import time
import curses
import os
message = "Warning - Production"
loading = True
@se7enack
se7enack / plotly-btc-predictions.py
Last active February 11, 2024 21:25
Example of using Plotly to predict trends
#!/usr/local/bin/env python3
import pandas as pd
from prophet import Prophet
from prophet.plot import plot_plotly, plot_components_plotly
import ssl
ssl._create_default_https_context = ssl._create_stdlib_context
@se7enack
se7enack / mysql-connector.py
Last active February 12, 2024 02:13
python mysql connector
#!/usr/local/bin/env python3
import mysql.connector
# pip3 install mysql-connector-python
user_input = input("Enter something: ")
db = mysql.connector.connect(
host="localhost",
port="3306",
@se7enack
se7enack / csv-with-header_2_json.py
Created February 2, 2024 21:09
Converts a comma delimited csv file containing a header row into a json file
#!/usr/bin/env python3
import json
import csv
csv_file_path = "/Users/user/Downloads/file.csv"
json_file_path = "/Users/user/Downloads/file.json"
def step1(csv_file_path, json_file_path):
@se7enack
se7enack / rm-lines-b4-string.py
Created January 31, 2024 20:02
Delete all lines before a line that starts with a string
found = 0
mystring = "Code"
with open("inputfile.txt", "r") as input:
with open("outputfile.txt", "w") as output:
for line in input:
if line.startswith(mystring):
found = 1
if found == 0:
pass
else:
@se7enack
se7enack / bulk_file_rename.py
Last active January 17, 2024 15:20
Torrent Episode Renaming Tool
#!/usr/bin/env python3
import os
string2remove = ".720p.IBCTV.WEBRip.x264-GalaxyGlue"
edir = "/Users/user/Desktop/SomeGoodShowS01"
#edir = os.getcwd()
# Will reaname all files in the 'edir' by removing the above 'string2remove'.
# Example: