Skip to content

Instantly share code, notes, and snippets.

View st1vms's full-sized avatar
😎

Stefano Raneri st1vms

😎
View GitHub Profile
@st1vms
st1vms / linear_regr.py
Last active April 6, 2024 11:05
Linear Regression in Python
"""Linear Regression module"""
import numpy as np
class SimpleLinearRegressionModel:
"""Linear regression model class"""
def __init__(self, float_precision: int = 6) -> None:
@st1vms
st1vms / protonvpn_rater.py
Last active March 22, 2025 11:38
Python script to rate ProtonVPN FreeTier domains by load factor.
"""Auto retrieve ProtonVPN free-tiers load ratings"""
from requests import get as http_get
# Taken from https://account.protonvpn.com/downloads
# Open dev-tools and look for GET requests to /api/vpn/logicals endpoint
# Copy the entire cookie header value into this string
__COOKIE_STRING = ""
# Also copy the x-pm-uid header value from that same GET request into this string
__X_PM_UID_STRING = ""
@st1vms
st1vms / elevenlabs_auto_key.py
Last active December 3, 2023 17:18
Semi-Automatic ElevenLabs scraper to auto gather API keys.
#!/usr/bin/env python3
"""ElevenLabs Scraper module"""
# REQUIRES: pip install -U selgym onesecmail_api
# RUN with: python elevenlabs_auto_key.py
from re import findall
from time import sleep
from random import choice
from string import ascii_lowercase, ascii_uppercase, digits
from screeninfo import get_monitors
@mineta
mineta / marinamele_sieve_atkin.py
Last active September 9, 2023 12:54
Python code. Sieve of Atkin algorithm to find prime numbers
import math
def atkin(nmax):
"""
Returns a list of prime numbers below the number "nmax"
"""
is_prime = dict([(i, False) for i in range(5, nmax+1)])
for x in range(1, int(math.sqrt(nmax))+1):
for y in range(1, int(math.sqrt(nmax))+1):
n = 4*x**2 + y**2
if (n <= nmax) and ((n % 12 == 1) or (n % 12 == 5)):