Skip to content

Instantly share code, notes, and snippets.

View maxov's full-sized avatar

Max Ovsiankin maxov

View GitHub Profile
import requests
import argparse
import json
from bs4 import BeautifulSoup
from tqdm import tqdm
SUBMISSIONS_URL = 'https://www.gradescope.com/courses/{}/assignments/{}/submissions'
SELECT_PAGES_URL = 'https://www.gradescope.com/courses/{}/assignments/{}/submissions/{}/select_pages'
parser = argparse.ArgumentParser()

Keybase proof

I hereby claim:

  • I am maxov on github.
  • I am maxov (https://keybase.io/maxov) on keybase.
  • I have a public key ASDOdy2BWYhJfJHXWVLoI_D_QKt4xKMqaa__h-5g-HIKlgo

To claim this, I am signing this object:

def x():
return 3
print(x())
@maxov
maxov / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
from collections import namedtuple
from string import lowercase
Rect = namedtuple('Rect', ['name', 'weight'])
# finds the sum of a list of rects
def rects_sum(rects):
return sum(rect.weight for rect in rects)
# finds the difference between the minimum aspect ratio of rectangles in the subdivison and a perfect square
@maxov
maxov / text-formatting.md
Last active August 29, 2015 14:22
A description of text formatting

Text Formatting

What are the goals?

  • A format that is easy for server admins to configure
  • A format that is familiar to people dealing with text/easy to learn
  • A format that is extensible and has the power to configure text objects in any way possible

Variables

Data Merging

Data merging is the process by which new data as set by a plugin is put back into someplace where it carries more meaning, like an entity or block.

The current method

The Sponge API has had DataPriority for a while. It essentially dictates how data from a copier and copiee (?) should be merged, applying specifically to the case of filling data in a mainpulator or offering it back to the containing holder.

; the let macro
(set macros "let" (fn (tree)
(if (== (len tree) 0)
(err "let takes at least one arg")
(let
(expr (last tree))
(body (map (init tree) (fn (tree)
(cons (quote "def") tree))))
(form (push (cons (quote "do") body) expr))
(compileExpr form body)))))
@maxov
maxov / value-api-question.java
Last active August 29, 2015 14:21
which is better?
// current data api
Optional<DisplayNameData> wrappedDisplayName = entity.getData(DisplayNameData.class);
if (wrappedDisplayName.isPresent()) {
DisplayNameData displayname = wrappedDisplayName.get();
displayname.setDisplayName(Texts.of(displayName.get(), "hai!"));
entity.offer(displayname);
}
// value api
if (entity.supports(Values.DISPLAY_NAME)) {
// data api
Optional<DisplayNameData> wrappedDisplayName = entity.getData(DisplayNameData.class);
if (wrappedDisplayName.isPresent()) {
DisplayNameData displayname = wrappedDisplayName.get();
displayname.setDisplayName(Texts.of(displayName.get(), "hai!"));
entity.offer(displayname);
}
// equivalent POJO
if (entity.displayName != null) {