Skip to content

Instantly share code, notes, and snippets.

View yatharth's full-sized avatar

Yatharth Agarwal yatharth

View GitHub Profile
@yatharth
yatharth / code.gs
Created May 28, 2014 10:40
Google Sheets App Script for Multiple-column range-wide auto-sort
function onEdit(event) {
var sheet = SpreadsheetApp.getActiveSheet();
var editedCell = sheet.getActiveCell();
var rangeValue = "A2:D";
var columns = [3, 2, 1];
var ascendings = [true, false, true];
if (editedCell.getColumn() in columns) {
var range = sheet.getRange(rangeValue);
@yatharth
yatharth / lcd.py
Last active August 29, 2015 14:05
No context here…
#!/usr/bin/env python3
# horizontal and vetical constants representing directives (class for figits seemed excessive)
BLANK, BAR__ = 'BLANK', 'BAR__'
LEFT_, RIGHT, BOTH_ = 'LEFT_', 'RIGHT', 'BOTH_'
# list of directives for digits 0-9 (horizionatal, vertical, horizontal, vertical, horizontal)
DIGITS = (
(BAR__, BOTH_, BLANK, BOTH_, BAR__),
(BLANK, RIGHT, BLANK, RIGHT, BLANK),
@yatharth
yatharth / aptitude.out
Last active August 29, 2015 14:10
Aptitude solution #2 while installing quickstart dependencies for LibSoy on fresh install of Ubuntu 14.04.1
Downgrade the following packages:
1) fontconfig-config [2.11.0-0ubuntu4.1 (now) -> 2.11.0-0ubuntu4 (trusty)]
2) libfontconfig1 [2.11.0-0ubuntu4.1 (now) -> 2.11.0-0ubuntu4 (trusty)]
3) libfreetype6 [2.5.2-1ubuntu2.2 (now) -> 2.5.2-1ubuntu2 (trusty)]
4) libgl1-mesa-glx [10.1.3-0ubuntu0.1 (now) -> 10.1.0-4ubuntu5 (trusty)]
5) libglapi-mesa [10.1.3-0ubuntu0.1 (now) -> 10.1.0-4ubuntu5 (trusty)]
6) libgles2-mesa [10.1.3-0ubuntu0.1 (now) -> 10.1.0-4ubuntu5 (trusty)]
7) libegl1-mesa-drivers [??? (now) -> 10.1.0-4ubuntu5 (trusty)]
@yatharth
yatharth / keybase.md
Created April 24, 2015 18:15
Public key proof

Keybase proof

I hereby claim:

  • I am YatharthROCK 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 / 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

@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 / 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 / 4.befunge
Last active August 29, 2015 14:21
HSCTF: Who needs 14x50 anyway?
>~:"e"-#v_@ >&&9p
^ >"g"-#^_&9g.
@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 / 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