Skip to content

Instantly share code, notes, and snippets.

View ethansocal's full-sized avatar

Ethan ethansocal

  • Orange County, California
  • 00:19 (UTC -07:00)
View GitHub Profile
function time_parser(input: string): number {
/**
* @name time_parser
* @description Parses a string of time into a number of seconds
* @param {string} input - String of time to parse
*
* @return {number} - Number of seconds
*/
let total_seconds = 0;
const times: { [index: string]: number } = {
@ethansocal
ethansocal / Python Discord Summer Code Jam 2020 Qualifier.py
Created July 3, 2021 15:57
This was my solution that I made for the Python Discord Summer Code Jam 2020 Qualifier. It isn't the best, but it works :)
from typing import Any, List, Optional
def make_table(rows: List[List[Any]], labels: Optional[List[Any]] = None, centered: bool = False) -> str:
"""
hi
:param rows: 2D list containing objects that have a single-line representation (via `str`).
All rows must be of the same length.
:param labels: List containing the column labels. If present, the length must equal to that of each row.
:param centered: If the items should be aligned to the center, else they are left aligned.