Skip to content

Instantly share code, notes, and snippets.

View rizemon's full-sized avatar
🇸🇬

rizemon rizemon

🇸🇬
View GitHub Profile
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.support.ui import WebDriverWait, Select
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ChromeOptions
from urllib.parse import quote_plus
from os.path import exists, isfile
from time import sleep
# -*- coding: utf-8 -*-
import argparse
import csv
from os.path import isfile
from simplewa import SimpleWhatsapp
from sys import exit
from jinja2 import Template
from typing import Union
from time import sleep
@rizemon
rizemon / gcd.py
Created April 14, 2021 15:09
Calculate GCD between 2 numbers and shows the working behind it
import sys
if len(sys.argv) < 3:
print("Usage: python test.py A B")
sys.exit(1)
A,B = int(sys.argv[1]), int(sys.argv[2])
if B < 0:
print("B should be positive.")
@rizemon
rizemon / vector.py
Created April 14, 2021 15:10
Library for Vector-related calculations
#!/usr/bin/env python
# Do `python3 -i vector.py` to use it interactively
from vpython import vector as v
from vpython import *
from typing import Union, Type
import sympy as sym
from fractions import Fraction
def man():
from math import log2
from sys import argv
from rich.console import Console
from rich.table import Table
########## CHANGE THIS ###########
NWAY = 2 # 1/2/4
# Number of bytes
WORD = 4 # 4 bytes (Probably no need to change this)
@rizemon
rizemon / column.py
Last active May 14, 2021 16:32
Reorders literals for easier comparison with output
from rich.console import Console
from rich.table import Table
import sys
from itertools import product
from math import ceil
def main():
if len(sys.argv) != 3:
print("Command: python3 column.py <literals> <minterms>")
print("e.g python3 column.py A,D,B,C 4,7,3,1")
@rizemon
rizemon / singletable.py
Created April 25, 2021 07:03
Generate State table (if given boolean equation for output and flip flop inputs)
from rich.console import Console
from rich.table import Table
from itertools import product
class InvalidInputException(Exception):
pass
def JK_flop(Q, J, K):
# Returns Q+ and Q+'
@rizemon
rizemon / build.sh
Created August 25, 2021 03:19
Script used to construct the submission zip file according to the assignment requirement (v1)
#!/bin/bash
# CS2106 Lab Assignment 1 Zip Build Script v1 by @rizemon
# ----------------------------------
# Colors (From https://gist.github.com/jonsuh/3c89c004888dfc7352be)
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
@rizemon
rizemon / build.sh
Last active January 8, 2022 18:51
Script used to construct the submission zip file according to the assignment requirement (v2)
#!/bin/bash
# CS2106 Lab Assignment 1 Zip Build Script v2 by @rizemon
# Improvements added:
# - No longer requires creation of temp directory to house copies of necessary files
# - Now checks for missing files and reports them
# - Add reminder for student to check whether they have entered their information into the files
# Modify this
NUSNET_ID=""
@rizemon
rizemon / ColorMyWSA.js
Last active August 15, 2022 12:31
Automatically adds color-coded level information (Apprentice, Practitioner, Expert) to PortSwigger's Web Security Academy "All labs" page
/*
Inspired by this post https://www.deepfryd.com/burp-academy-apprentice/
How to use:
1) Browse to https://portswigger.net/web-security/all-labs.
2) Open your web browser's Developer tools by pressing 'F12' on your keyboard.
3) Click on the console tab.
4) Paste the following Javascript code into the console's prompt and hit 'Enter' on the keyboard.
5) Wait for all the labs to be updated with their respective levels (Tested ~12s)