Skip to content

Instantly share code, notes, and snippets.

View marethyu's full-sized avatar
🙈
Playing hide and seek

Jimmy Yang marethyu

🙈
Playing hide and seek
  • UBC
  • Canada
View GitHub Profile
@marethyu
marethyu / mangadex.py
Last active October 7, 2020 19:37
Python MangaDex API Wrapper
# MangaDex API v1.0
#
# Requires python3.7 with the following packages installed
# - aiofiles 0.5.0
# - aiohttp 3.6.2
# - Pillow 7.2.0
# - requests 2.24.0
import aiofiles
import aiohttp
@marethyu
marethyu / webassign.py
Last active October 2, 2020 17:47
Python script to download an ebook from WebAssign
import requests
import sys
from PIL import Image
# Put the name of ebook you want to download
book_name = 'peepee'
pdf_file = book_name + '.pdf'
link = f'https://www.webassign.net/ebooks/{book_name}/docs/{book_name.upper()}.pdf'
starting_pageno = 1
@marethyu
marethyu / factorial.asm
Last active August 21, 2020 03:11
x64 Assembly program to print factorials between one to infinity.
; $ nasm -f elf64 factorial.asm && gcc -m64 -no-pie -o factorial factorial.o && ./factorial
bits 64
global main
extern putchar, getchar, exit
section .text
main:
push rbp
xor rbx, rbx
add rbx, 1
@marethyu
marethyu / bf_compiler.py
Last active July 4, 2021 20:39
Brainfuck Compiler
#!/usr/bin/env python3
# Copyright (c) 2020, Jimmy Yang
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@marethyu
marethyu / download.py
Created July 29, 2020 17:37
Python script to download all free books Springer released during quarantine.
#!/usr/bin/env python3
# Copyright (c) 2020, Jimmy Yang
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
def uhm(f):
class Wrapper:
def __getitem__(self, arg):
if arg is None:
return f()
elif isinstance(arg, tuple):
return f(*arg)
else:
return f(arg)
return Wrapper()
@marethyu
marethyu / mandelbrot.c
Last active June 21, 2021 19:21
C program to display Mandelbrot Set using Win32 API
/* gcc mandelbrot.c -o mandelbrot -lgdi32 -Wl,-subsystem,windows */
#include <math.h>
#include <stdlib.h>
#include <windows.h>
typedef struct
{
double real;
double imag;
@marethyu
marethyu / ph.py
Last active November 8, 2025 14:06
PH video downloader
#!/usr/bin/env python3
# A simple Python script for downloading videos from PH.
#
# Usage: python ph.py <PH URL>
# where <PH URL> is a url of a PH video
#
# TODO Speed up download code, it's too slow, define regex patterns in variables with meaningful names
import os