Skip to content

Instantly share code, notes, and snippets.

View lomnom's full-sized avatar
💭
Duh Ta an be web fox do has dan no eh Ta so VHS TN bc so it’s damn ya so thx sag

lomnom

💭
Duh Ta an be web fox do has dan no eh Ta so VHS TN bc so it’s damn ya so thx sag
View GitHub Profile
@lomnom
lomnom / NYCTF_RE.md
Last active November 2, 2025 10:51
Reverse engineering tutorial :)

Welcome to NYCTF's reverse engineering tutorial

This tutorial will teach you the reverse engineering basics needed to ace NYCTF :)

Google drive folder with everything: link

There are 3 short tutorial videos, followed by a few practices to help you polish your skills.

Tutorials

Do follow along with these videos!

  • Part 1 (1min 28s): Setting up
@lomnom
lomnom / Hints11.md
Last active October 22, 2025 00:55
Hints for NYRCS pset 11: PURQ segtree

Hints

Segment tree

Hint #1 This questions wants you to implement a conventional segment tree. You can use the nyrcs template
Hint #2 It wants you to find the minimum instead of the sum. How do you do that?
@lomnom
lomnom / cms.md
Last active November 5, 2025 17:59
Setting up Contest Management System on a raspberry pi 3A

Steps taken to get cms up and running

Cms was installed onto a raspberry pi running 64x raspbian through docker. This document details the process. It assumes you are working from the terminal.

Before everything

sudo apt-get update && sudo apt-get upgrade to have up-to-date apt info

Get CMS source

Note that we install through the docker route to avoid the suffering that comes with manually resolving dependencies.

  1. Install git thru apt with sudo apt-get install git.
@lomnom
lomnom / Solutions.md
Last active August 6, 2025 08:38
Pset 9 solutions

Dijkstra

#include <iostream>
#include <queue>
#include <vector>
#include <limits.h>

using namespace std;

typedef long long int ll;
@lomnom
lomnom / Hints.md
Last active July 30, 2025 08:48
Pset 9 hints

Hints

Subgraphs

Hint #1 Use DFS for this. Approach is the same as with BFS (refer to session 7 slides), except that you use DFS.

Dijkstra

Hint #0
@lomnom
lomnom / Answers.md
Last active July 29, 2025 07:13
Code for subgraphs

2 Solutions for Subgraphs

Smart loop

Uses the vector visited.

Special optimization:

  1. With the vector visited,
  2. for (int i = 0; i<nodes; i++){
  3. if (!visited[i]){do bfs and increment the counter by 1}

This avoids iterating through the whole visited vector every time. It only does so once.

@lomnom
lomnom / Solution.md
Last active July 5, 2025 14:15
NYRCS pset 7 - Hints

Hints & solutions

Wormholes

Hint 1 When defining a DP function, think about all the possible ways to get to where you are from ONE step before.

Also assume that if your cases are correct, all your dp results are correct.

@lomnom
lomnom / Download.js
Last active May 4, 2025 14:36
Tapermonkey script that adds the download button to lectures on NYJCPortal/NYPortal
// ==UserScript==
// @name NYJC download
// @namespace https://tampermonkey.net/
// @version 2025-03-02
// @description Adds the download button to lectures on the NYJCportal. https://gist.github.com/lomnom/a0c51d25a65198eba13333d6395e9bb1
// @author lomnom on github
// @match portal.nyjc.edu.sg/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==

Noi notes

Boilerplate

Template

#include <iostream>
#define num long int

using namespace std;

int main(){
> v
1 #
2 vtv#<
3 # # t
4 v<v< >#vtv
5 t t # #
6 v<v<
7 t t
8
SXY vvvv vvvv