Skip to content

Instantly share code, notes, and snippets.

View knowsuchagency's full-sized avatar
💭
hustlin'

Stephan Fitzpatrick knowsuchagency

💭
hustlin'
View GitHub Profile
class Author:
first_name: str
last_name: str
age: int
books: T.Optional[T.List['Book']]
class Book:
title: str
author: Author
@knowsuchagency
knowsuchagency / graphql_example.md
Created February 27, 2018 02:30
graphql example story
# package imports

# why all the try excepts?
# because weird stuff happens
# when this code is executed from a jupyter
# notebook vs as a module vs as __main__
@knowsuchagency
knowsuchagency / graphql_example.ipynb
Created February 27, 2018 02:19
graphql_example/graphql_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / lightning-talk.ipynb
Last active January 12, 2018 16:50
a lightning talk on eliot
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / main.py
Created November 13, 2017 21:13
TEMPOrary
import re
import json
import typing as T
from typing import NamedTuple
from textwrap import dedent
from collections import Counter
class Record(NamedTuple):
@knowsuchagency
knowsuchagency / Untitled200.ipynb
Created October 27, 2017 03:51
interest calculator
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / decorator example.ipynb
Last active October 13, 2017 20:42
just decorator things
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / madlibs.ipynb
Last active October 8, 2017 04:54
madlibs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / follow.py
Created October 5, 2017 22:05
tail -f implementation in Python
# This code was borrowed from David Beazley http://www.dabeaz.com/generators/follow.py
# Follow a file like tail -f.
import time
def follow(thefile):
thefile.seek(0,2)
while True:
line = thefile.readline()
if not line:
time.sleep(0.1)