Skip to content

Instantly share code, notes, and snippets.

View sujaldev's full-sized avatar

Sujal Singh sujaldev

View GitHub Profile
@sujaldev
sujaldev / challenge.py
Last active September 3, 2024 07:04
Solution to the Longshot Systems hiring challenge.
from base64 import b64encode, b64decode
from playwright.sync_api import sync_playwright
def exec_instruction(instruction):
instruction = b64decode(instruction)[1:-1]
if instruction == b"END":
page.evaluate(f"ws.send('{b64encode(bytes(f'{sum(registers)}', 'utf8')).decode()}')")
@sujaldev
sujaldev / watermark-remover.py
Created June 6, 2024 03:45
Removes watermark from PDF
# "Borrowed" from https://github.com/pymupdf/PyMuPDF/discussions/1855
import sys
import argparse
from pathlib import Path
import pymupdf
parser = argparse.ArgumentParser(
prog="watermark-remover",