Skip to content

Instantly share code, notes, and snippets.

View yatharth's full-sized avatar

Yatharth Agarwal yatharth

View GitHub Profile
@yatharth
yatharth / dabblet.css
Last active June 4, 2019 03:09
Vertical centering + overflow
/* Vertical centering + overflow */
#middle {
width: 80%;
margin: 10px auto;
border: 1px dashed black;
height: 500px;
line-height: 500px;
vertical-align: middle;
text-align: center;
}
@yatharth
yatharth / keybase.md
Created June 23, 2018 07:28
Proof for Keybase account @mndhck

Keybase proof

I hereby claim:

  • I am yatharth on github.
  • I am mndhck (https://keybase.io/mndhck) on keybase.
  • I have a public key whose fingerprint is 5105 B914 D4DA 8EF3 5D2A 79E8 0C7F 0180 C090 9DC9

To claim this, I am signing this object:

@yatharth
yatharth / lightson.py
Last active January 10, 2016 20:20
USACO Dec 2015 Silver Problem #1 solution for CompSci club
#!/usr/bin/env python3
from collections import defaultdict
__author__ = 'Yatharth Agarwal <yatharth999@gmail.com>'
with open('lightson.in') as in_file:
read_numbers = lambda: map(int, in_file.readline().strip().split())
switches = defaultdict(set)
@yatharth
yatharth / EncodingHelperCharNames.java
Created October 18, 2015 17:28
Stripped down example of working with errorable static init blocks
public class EncodingHelperCharNames {
private static HashMap<Integer, String> CHARACTER_NAMES;
private static boolean enabled = false;
static {
readFile(false);
}
/**
@yatharth
yatharth / TmpProfiling.java
Created September 27, 2015 17:30
Redacted memory-performance profiling for COMP-630/1
package edu.andover.yagarwal;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Scanner;
/**
* Compare memory-speed tradeoff for reading UnicodeData.txt at once or not
@yatharth
yatharth / friday.py
Created June 11, 2015 13:03
USACO: "One-lining because you can" edition
#!/usr/bin/env python3
import itertools as it
from collections import Counter
open('friday.out', 'w').write(
' '.join(
(str(value) for key, value in sorted(
Counter(
it.islice(
@yatharth
yatharth / 4.befunge
Last active August 29, 2015 14:21
HSCTF: Who needs 14x50 anyway?
>~:"e"-#v_@ >&&9p
^ >"g"-#^_&9g.
@yatharth
yatharth / all_stars_2009–10_7.py
Last active August 29, 2015 14:20
ACSL: "A rock implements every finite-state automaton"; just need to find the right one…
#!/usr/bin/env python3
__author__ = 'Yatharth Agarwal <yatharth999@gmail.com>'
from collections import defaultdict
import itertools
START_STATE = 0
FINAL_STATE = -1
@yatharth
yatharth / No Meeting.md
Last active August 29, 2015 14:20
Email for CompSci club

Hey all,

If you haven't read the title by now, there's no CompSci meeting this week. Not that there would be one if you had read the title.

We hope y'all will have more time to study for your APs. In case you don't have one on Thursday or are just looking for some productive procrastination, here are some cool websites where you can interactively improve your CompSec skills, just in time for HSCTF:

@yatharth
yatharth / CTF? WTF?.md
Last active August 29, 2015 14:20
Email for CompSci club

Hey all,

What the fish are CTFs? Capture The Flags are computer security competitions in which:

Contestants are presented with a set of challenges which test their creativity, technical (and googling) skills, and problem-solving ability. Challenges usually cover a number of categories (see below), and when solved, each yields a string (called a flag) which is submitted to an online scoring service. (Source: PicoCTF FAQ.)

OK, that was difficult reading. Here's an XKCD to make up for it:

XKCD 569