Skip to content

Instantly share code, notes, and snippets.

from argparse import ArgumentParser
parser = ArgumentParser(prog="NetherCoords", description="Converts Nether coordinates to Overworld coordinates")
parser.add_argument('x', type=int, metavar="X", help="X position")
parser.add_argument('z', type=int, metavar="Z", help="Z position")
parser.add_argument('-o', '--overworld', action='store_true', help="Use Overworld coordinates and convert them to Nether coordinates instead")
def main() -> None:
args = parser.parse_args()
@DarkblooM-IO
DarkblooM-IO / collatz.py
Last active December 13, 2023 15:14
Collatz Graph
#!/usr/bin/python3
import matplotlib.pyplot as plt # matplotlib>=3.8.2
from math import floor
def collatz(x: int) -> list[int]:
if x <= 0:
raise ValueError("x must be a positive integer")
output = []
while x > 1:
output.append(x)
@DarkblooM-IO
DarkblooM-IO / genpass.py
Last active February 13, 2024 13:47
genpass: A CLI random password generator
#!/usr/bin/python3
import argparse, string, secrets, pyperclip # pyperclip>=1.8.2
parser = argparse.ArgumentParser(prog="genpass", description="A CLI random password generator")
parser.add_argument("-l", "--length", help="password length", type=int)
parser.add_argument("-a", "--amount", help="number of passwords to generate", type=int)
parser.add_argument("-c", "--copy", help="copy password to clipboard", action="store_true")
parser.add_argument("-e", "--exclude", help="characters to exclude from password")