Skip to content

Instantly share code, notes, and snippets.

View jdabtieu's full-sized avatar

Jonathan Wu jdabtieu

View GitHub Profile
@jdabtieu
jdabtieu / template.asm
Last active February 3, 2024 19:39
64-bit Assembly Competitive Programming template with fast IO (minified version)
section .text
global _start
; int readint()
; byte _read_buf()
; void printint(int num) --> edi
; void newline()
; void printspace()
; void _write_buf(char *buf, int count) --> rdi, esi * max of BUF_SIZE characters (default 65536) at once

SimpleFileServer - idekCTF 2022

Description

All I wanted was a website letting me host files anonymously for free, for ever

Link

simple-file-server.tar.gz

@jdabtieu
jdabtieu / Main.java
Last active January 23, 2023 21:42
Java Competitive Programming template with fast IO
import java.io.*;
import java.util.*;
public class Main {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer in;
public static void main(String[] args) throws IOException {
}

Engraver - Google CTF 2022

Description

You can see pictures of a robot arm laser engraver attached. Can you figure out what it is engraving?

Note: the flag should be entered all in upper case. It contains underscores but does not contain dashes.

@jdabtieu
jdabtieu / Main.java
Last active March 28, 2022 03:33
Enables colors in the Windows terminal for Java console programs. Read the comment before blindly copy pasting!
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.net.URLClassLoader;
public class Main {
static void enableColor() {
// https://stackoverflow.com/questions/52767585/how-can-you-use-vt100-escape-codes-in-java-on-windows
try {
// Load classes
@jdabtieu
jdabtieu / fastio.cpp
Last active August 8, 2021 02:20
C++ Fast IO (read & print signed & unsigned ints)
// IMPORTANT: Call Write(); at the end of your main function to flush the output buffer
#include <bits/stdc++.h>
#include <unistd.h>
#pragma GCC optimize ("Ofast")
int oPtr = 0;
#ifdef WIN64
char sc() {return getchar();}
void pc(char c) {putchar(c);}
@jdabtieu
jdabtieu / IO.java
Last active July 18, 2021 18:37
Java Fast IO (even faster than BufferedReader). Key differences: no thread safety, doesn't ensure that the input stream is still open, does not create unncessary objects
import java.io.InputStreamReader;
import java.io.IOException;
public class IO {
static InputStreamReader br = new InputStreamReader(System.in);
static char[] ibuf = new char[65536];
static int iptr = 0;
static int imax = 0;
static int readInt() throws IOException {
int x = 0;