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
from __future__ import annotations | |
from abc import abstractmethod | |
from contextlib import suppress | |
from dataclasses import dataclass, field | |
from enum import Enum | |
from itertools import accumulate, chain | |
from random import choice, randrange | |
from typing import ClassVar, Container, Iterable, Literal, Optional, Protocol |
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
#!/bin/zsh | |
# this requires imagemagick to run | |
# brew install imagemagick && brew install ghostscript | |
# on Mac, download then run `mv ~/Downloads/emojify /user/local/bin/emojify` | |
# emojify file [output-name] | |
# examples | |
# emojify ~/Downloads/img.png winky-face | |
# emojify ~/Downloads/winky-face.jpg |
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
#!/usr/bin/env bash | |
messages=$(git log --format=%s -3) | |
repeated="autocommit | |
autocommit | |
autocommit" | |
if [ "$messages" = "$repeated" ]; then | |
echo "3 times, enough already." | |
exit 1 | |
fi |
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
season | team | date | rating | elo | |
---|---|---|---|---|---|
1871 | ATL | 1871-10-07 | 1478.511 | 1478.809 | |
1871 | CHC | 1871-10-30 | 1471.351 | 1471.722 | |
1871 | CL1 | 1871-09-27 | 1425.456 | 1425.26 | |
1871 | FW1 | 1871-08-29 | 1420.555 | 1421.763 | |
1871 | NY2 | 1871-10-18 | 1446.61 | 1445.148 | |
1871 | PH1 | 1871-10-30 | 1481.406 | 1481.057 | |
1871 | RC1 | 1871-09-15 | 1430.404 | 1431.09 | |
1871 | TRO | 1871-10-23 | 1445.928 | 1445.261 | |
1871 | WS3 | 1871-09-29 | 1449.779 | 1449.89 |
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
from collections import defaultdict | |
import pandas as pd | |
# Data is from seanlahman.com | |
people = pd.read_csv( | |
"People.csv", | |
encoding="latin-1", | |
low_memory=False |
OlderNewer