Skip to content

Instantly share code, notes, and snippets.

View elibroftw's full-sized avatar
🎯
Focusing

Elijah Lopez elibroftw

🎯
Focusing
View GitHub Profile
@elibroftw
elibroftw / molar_mass.py
Last active March 16, 2023 16:27
Calculates Molar Mass of Elements
"""
=================================
Molar Mass Calculator
Author: Elijah Lopez
Version: 1.2.1
Last Updated: April 4th 2020
Created: July 8th 2017
Python Version: 3.6+
=================================
"""
@elibroftw
elibroftw / Python 3.x SimpleHTTPServer.py
Last active May 17, 2020 22:26
A simple HTTP server for python 3.x which serves files in your drive
from http.server import HTTPServer, SimpleHTTPRequestHandler
import os
server_address = ('0.0.0.0', 8081)
httpd = HTTPServer(server_address, SimpleHTTPRequestHandler)
os.chdir('C:/') # optional
print('Running server...')
httpd.serve_forever()
@elibroftw
elibroftw / change.org.py
Created October 14, 2019 14:50
A change.org survey bot (up to 10 surveys) - Last tested in April 2017.
import time, pyautogui as kbm
from faker import Factory
import webbrowser
'''This program will go to a change.org link and fill out as many forms as you want'''
print('For more than 10 bots: Some sort of ipchanger is needed in the background, one that is undetectable')
__author__ = 'Elijah Lopez'
__version__ = '1.0'
__Date__ = 'April 26, 2017'
@elibroftw
elibroftw / word_to_pdf.py
Created October 25, 2019 23:33
Converts .docx or .doc files to a PDF. With threading
import os
import pythoncom
# import comtypes.client
import win32com
import win32com.client as client
from shutil import copyfile, rmtree
import threading
wdFormatPDF = 17
@elibroftw
elibroftw / investing.py
Last active July 2, 2023 02:33
A Python script and tool for speeding up stock market research.
"""
Investing Analytics
Author: Elijah Lopez
Version: 2.1
Created: April 3rd 2020
Updated: July 1st 2023
https://gist.github.com/elibroftw/2c374e9f58229d7cea1c14c6c4194d27
Resources:
Black-Scholes variables:
@elibroftw
elibroftw / Intermediate Project Ideas.md
Last active February 21, 2022 03:43
Practical project ideas for beginner to intermediate Python developers

Practical and Helpful Programming Project Ideas

[Varying Difficulty] Website / Portfolio

  • [Easy] raw HTML/CSS and little to none vanilla Javascript
  • Flask for backend
  • Use Heroku to host it for free
  • [Intermediate] Use Jinja2 templating
  • My website's source code
@elibroftw
elibroftw / threading_examples.py
Created April 25, 2020 02:13
Examples of threading
import threading
import time
# there's also a multiprocessing module which I haven't used because its easier to communicate between threads
# than it is to communicate between processes
# for each section uncomment the code and run it
@elibroftw
elibroftw / process_instances.py
Last active February 22, 2022 18:56
A Python program to detect if an instance of a program/process is already running. [Windows]
import platform
from subprocess import Popen, PIPE, DEVNULL
def get_running_processes(look_for='', pid=None, add_exe=True):
# TODO: Linux implementation
cmd = f'tasklist /NH'
if look_for:
if not look_for.endswith('.exe') and add_exe:
look_for += '.exe'
cmd += f' /FI "IMAGENAME eq {look_for}"'
@elibroftw
elibroftw / BuildScript.cs
Created May 24, 2020 18:07
A Unity Editor script that lets you build for all the necessary platforms at one go.
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine;
public class BuildScript
{
[MenuItem("File/Build All")]
static void BuildAll()
@elibroftw
elibroftw / UnityBuild.py
Last active April 3, 2023 18:01
A Python script to build Unity projects without the editor open.
import subprocess
import shutil
import os
import zipfile
import threading
print('Cleaning up build directory')
shutil.rmtree('Builds', ignore_errors=True)