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
use std::process;
use std::thread;
use std::time::Duration;
use rand::Rng;
use sdl2::event::Event;
use sdl2::pixels::PixelFormatEnum;
const WIDTH: usize = 256;
#include <algorithm>
#include <array>
#include <functional>
#include <iostream>
#include <queue>
enum
{
FETCH,
EXEC
@marethyu
marethyu / nintendo_logo.cpp
Last active August 5, 2021 04:21
C++ program to display Nintendo logo
#include <iostream>
#define GET_BIT(n, p) ((n & (1 << (p))) != 0)
#define SET_BIT(n, p) do { n |= (1 << (p)); } while (0)
const uint8_t data[48] = {
0xCE, 0xED, 0x66, 0x66, 0xCC, 0x0D, 0x00, 0x0B, 0x03, 0x73, 0x00, 0x83,
0x00, 0x0C, 0x00, 0x0D, 0x00, 0x08, 0x11, 0x1F, 0x88, 0x89, 0x00, 0x0E,
0xDC, 0xCC, 0x6E, 0xE6, 0xDD, 0xDD, 0xD9, 0x99, 0xBB, 0xBB, 0x67, 0x63,
0x6E, 0x0E, 0xEC, 0xCC, 0xDD, 0xDC, 0x99, 0x9F, 0xBB, 0xB9, 0x33, 0x3E
@marethyu
marethyu / README.md
Last active January 21, 2026 19:59
Bunpro to Anki

Bunpro Anki Decks (v1)

For Bunpro users who wants to review grammar using Anki's SRS instead of Bunpro's built-in SRS.

Deck Download Links

  • N1 (Updated: 2021-06-21)
  • N2 (Updated: 2021-06-21)
  • N3 (Updated: 2021-06-21)
  • N4 (Updated: 2021-06-21)
@marethyu
marethyu / mdx.py
Created June 9, 2021 00:30
Mangadex bookmarks fixer for Chrome
# Mangadex bookmarks fixer for Chrome
#
# How to use:
# 1. Chrome -> Options (find the button with three dots) -> Bookmarks -> Bookmark manager -> Options -> Export bookmarks
# 2. Save the html file to the directory where you downloaded this program.
# 3. Change the value of 'BOOKMARKS_FILE' with the name of the html file.
# 4. Run this program. You should find the output file 'Modified_ + BOOKMARKS_FILE' located in the same directory as this program after execution.
# 5. Delete all your current bookmarks in Chrome's bookmark manager (CTRL-A to select all).
# 6. Go to Options -> Import bookmarks to import the modified html file.
# 7. Enjoy!
{
"version": 0,
"date": "2021-02-25 09:07:34",
"url": "chrome-extension://ogmnaimimemjmbakcfefmnahgdfhfami/",
"manifest": {
"author": "Alex Yatskov",
"background": {
"page": "bg/background.html",
"persistent": true
},
@marethyu
marethyu / md-data-2021-02-07.json
Created February 9, 2021 04:04
Data of all mangas from Mangadex
This file has been truncated, but you can view the full file.
[{"id": 1, "title": "Tower of God", "tags": [2, 3, 4, 5, 8, 10, 20, 22, 36, 44, 45], "rating": {"bayesian": 8.86, "mean": 8.89, "users": 2124}, "views": 958930, "follows": 28372, "timestamp": "2021-02-07 15:08:46"}, {"id": 2, "title": "Zippy Ziggy", "tags": [2, 5, 9, 16, 23, 24], "rating": {"bayesian": 7.86, "mean": 7.55, "users": 42}, "views": 20402, "follows": 907, "timestamp": "2021-02-07 15:08:46"}, {"id": 3, "title": "The Bullet Saint", "tags": [2, 3, 8, 20, 34], "rating": {"bayesian": 7.87, "mean": 6.5, "users": 2}, "views": 11660, "follows": 162, "timestamp": "2021-02-07 15:08:48"}, {"id": 4, "title": "Beelzebub", "tags": [2, 5, 10, 16, 24, 34], "rating": {"bayesian": 8.63, "mean": 8.7, "users": 853}, "views": 118633, "follows": 9214, "timestamp": "2021-02-07 15:08:49"}, {"id": 5, "title": "Naruto", "tags": [2, 3, 5, 8, 10, 16, 69], "rating": {"bayesian": 7.97, "mean": 7.97, "users": 1482}, "views": 269480, "follows": 10998, "timestamp": "2021-02-07 15:08:50"}, {"id": 6, "title": "Shijou Saikyou no Des
@marethyu
marethyu / md.sh
Last active May 11, 2022 16:46
Bash script to fetch all mangas in Mangadex
#!/bin/bash
set -ehv
mkdir -p md
time curl --retry 64 --doh-url https://cloudflare-dns.com/dns-query --compressed --http2 "https://api.mangadex.org/v2/title/[000001-090000]?include=chapters" -o "md/md_titles_#1.json"
time for ((j = 0; j < 9;)); do jq -Mc ".data?|objects" $(seq 0$((j))0001 0$((++j))0000|xargs printf "md/md_titles_%06i.json\n"); done | tee md_titles_data.json
time jq -Mc ".manga | {id, titles: [.title, .altTitles[]], blurbs: .description}" ../md_titles_data.json | ../md_titles.json
@marethyu
marethyu / create_pair.py
Created December 30, 2020 03:04
Hiragana/Katakana minimal pair creator
# create_pair.py
#
# requires pydub installation
# run download.py twice (to get both male and female voices) to create the hiragana-syllables directory
import os
import sys
from pydub import AudioSegment
@marethyu
marethyu / template2.tex
Last active September 7, 2023 01:03
LaTeX template for homework assignments
\documentclass[12pt, a4paper]{article}
\usepackage{fancyhdr}
\usepackage[left=4cm, right=4cm, top=4cm, bottom=4cm]{geometry}
\usepackage[utf8]{inputenc}
\newcommand{\doctitle}{Sample title}
\newcommand{\name}{Foo Bar}
\newcommand{\studentno}{123456789}
\newcommand{\todaydate}{Jan. 1, 20XX}