Skip to content

Instantly share code, notes, and snippets.

View waterrmalann's full-sized avatar
🎯
Focusing

Alan waterrmalann

🎯
Focusing
View GitHub Profile
@waterrmalann
waterrmalann / minifier.py
Created August 15, 2021 07:04
Simple Python Utility to Minify HTML/CSS/JS!
"""
A python script to minify the HTML/CSS/JS files of a website.
Minifiers by Andrew Chilton (https://twitter.com/andychilton).
"""
import os, requests
def minify_css(css_file, overwrite=False):
with open(css_file, 'r') as f:
@waterrmalann
waterrmalann / clipboardNormalizer.py
Created October 9, 2021 08:28
Super simple python utility to normalize clipboard content in real time.
# clipboardNormalizer.py
"""
A super-simple and silly python program that normalizes content in your clipboard if there's foriegn characters.
I originally made it so that I can copy-paste stuff from the Discord Bot DankMemer's economy system which uses foreign characters instead of spaces to discourage copy pasting.
This program is super useless for anything besides that, or so I think. Congratulations if you can find a proper use case.
"""
from pyperclip import copy, paste
@waterrmalann
waterrmalann / actual_and_assumed.py
Last active January 6, 2022 08:57
Calculate Standard Deviation (Continuous Series)
# Calculate Standard Deviation (Continuous Series | Actual & Assumed Mean Methods)
# Simple python program I wrote to automate a huge portion of my homework.
# Economics is a nightmare :√
from prettytable import PrettyTable
def number(num):
"""Returns any string containing number (int/float) in a cleaner way."""
#num = str(round(float(num), 2))
return num[:num.rindex('.')] if num.endswith('.0') else num
@waterrmalann
waterrmalann / memorable_random_int.py
Created February 28, 2022 17:29
A python module that can generate random numbers between two integer ranges that are easy to remember and read.
# Memorable Random Int (originally Memorable One-Time Password Generator)
# Written by Alan Varghese (waterrmalann)
"""
A random number generator (between two ranges) that outputs a number that is easy to read and remember.
Can be used to generate OTPs that stay in short term memory but may not be that secure due to the limited set of numbers.
"""
from random import choice
import string
@waterrmalann
waterrmalann / passfinder.py
Last active August 8, 2023 04:03
Find saved passwords of known WiFi Networks on Windows
import subprocess
def find_passwords():
profiles_out = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8',).split('\n')
profiles = [i.split(":")[1][1:-1] for i in profiles_out if "All User Profile" in i]
print(f"Known Networks: {len(profiles)}")
print()
for profile in profiles:
wifi_out = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', profile, 'key=clear']).decode('utf-8').split('\n')
@waterrmalann
waterrmalann / scrollanim.js
Created August 8, 2022 16:40
Yet another but wonky implementation of scroll based animations for web. For use with Animate.css.
/* Scroll Attached Animations */
// v1.0.0 (quite wonky)
// Written by Alan (github.com/waterrmalann)
// For use alongside: https://animate.style/
// Never force your animations on the user.
// Don't animate if the user prefers reduced motion (browser accessibility setting).
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
if (!prefersReducedMotion) {
@waterrmalann
waterrmalann / flame.py
Created August 28, 2022 18:42
Calculate the position of two names in FLAME
def get_flame(name1, name2):
"""Calculate the FLAME position of two names."""
FLAME = ("Friendship", "Love", "Affection", "Marriage", "Enemies") # "Siblings" as an additional entry.
# Get rid of the spaces and turn everything into lowercase.
name1_crossed = name1.replace(' ', '').lower()
name2_crossed = name2.replace(' ', '').lower()
# Cross out common letters from both names.
@waterrmalann
waterrmalann / gpw.py
Created September 15, 2022 18:19
Generate Pronounceable Passwords | Python Port of https://www.multicians.org/thvv/gpw-js.html
"""
python port of GPW (Generate Pronouncable Passwords)
https://www.multicians.org/thvv/gpw.html
https://www.multicians.org/thvv/gpw-js.html
"""
import random
alphabets = 'abcdefghijklmnopqrstuvwxyz'
@waterrmalann
waterrmalann / memorable_random_int.js
Created September 19, 2022 18:06
JavaScript port of the python script that can generate memorable random numbers between two integer ranges.
/*
Memorable Integer Generator: JavaScript Port
*/
String.prototype.reverse = function() {
return this.valueOf().split("").reverse().join("");
}
class MIG {
constructor(minimum, maximum) {
@waterrmalann
waterrmalann / pseudofonts.py
Last active December 16, 2022 14:18
A python module that allows you to create and play with unicode psuedofonts.
"""
Usage:
my_custom_font = PseudoFont('L33TSP34K', '@6cdef9h!jk1mnopqr5+uvwxy2', '48(D3FG#|JK1MN0PQR$7UVWXY2', '')
sample = my_custom_font("The Quick Brown Fox Jumps Over The Lazy Dog")
sample -> '7he Qu!ck 8rown Fox Jump5 0ver 7he 1@2y Do9'
"""
class PseudoFont:
def __init__(self, font_name: str, font_lower: str, font_upper: str, font_digits: str):
# The name of the defined font style.