This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code licensed LGPLv3 by Jérémie Lumbroso <[email protected]> | |
import difflib | |
import itertools | |
import textwrap | |
import typing | |
def side_by_side( | |
left: typing.List[str], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codepost | |
# for CSV export, see: https://comma.readthedocs.io/en/latest/ | |
import comma | |
# how to form a codePost submission link from the submission id | |
CODEPOST_SUBMISSION_LINK_PATTERN = "https://codepost.io/code/{id}" | |
# variable parameters | |
# get the API key here: https://codepost.io/settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2022, Jérémie Lumbroso <[email protected]> | |
# | |
# Simple datetime-aware JSON in Python | |
# | |
# Usage: | |
# - json_timestamp_loads just() like json.loads() | |
# - json_timestamp_dumps just() like json.dumps() | |
import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fast command-line cloning of GitHub repos | |
# | |
# usage: add to your .bashrc or .zsh like this: | |
# source gh_clone.sh | |
# replace 'jlumbroso' with your own GitHub username | |
export GITHUB_USERNAME="jlumbroso" | |
# one-line repo clone | |
# gh <repo> [<-- will default to username=${GITHUB_USERNAME}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codepost | |
# fancy progress bar if available | |
try: | |
from tqdm import tqdm | |
except ModuleNotFoundError: | |
# dummy replacement that does nothing | |
tqdm = lambda x: x | |
# variable parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codepost | |
# variable parameters | |
# get the API key here: https://codepost.io/settings | |
API_KEY = "... see above where to get this ..." | |
COURSE_NAME = "COS126" | |
COURSE_TERM = "F2022" | |
ASSIGNMENT = "Final Project Proposal PDF" | |
DEFAULT_TEACHER = "[email protected]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codepost | |
# variable parameters | |
# get the API key here: https://codepost.io/settings | |
API_KEY = "... see above where to get this ..." | |
# mapping a codePost ID to students | |
# (note that this could be loaded from a CSV file) | |
partnerships = { | |
65490: ["[email protected]", "[email protected]"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codepost | |
# fancy progress bar if available | |
try: | |
from tqdm import tqdm | |
except ModuleNotFoundError: | |
# dummy replacement that does nothing | |
tqdm = lambda x: x | |
# variable parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import codepost | |
# ================================================================ | |
# VARIABLE PARAMETERS | |
# get the API key here: https://codepost.io/settings | |
API_KEY = "... see above where to get this ..." | |
COURSE_NAME = "COS126" | |
COURSE_TERM = "S2023" | |
ASSIGNMENT = "Atomic" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
_LATEX_POST_ENTITY = "{}" | |
# Mapping of Unicode characters to LaTeX expressions | |
MAPPING = { | |
"∀": "\\forall", | |
"∃": "\\exists", | |
"→": "\\rightarrow", | |
"↔": "\\leftrightarrow", |