Skip to content

Instantly share code, notes, and snippets.

View knowsuchagency's full-sized avatar
💭
hustlin'

Stephan Fitzpatrick knowsuchagency

💭
hustlin'
View GitHub Profile
@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 / 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 / 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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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.
@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__
class Author:
first_name: str
last_name: str
age: int
books: T.Optional[T.List['Book']]
class Book:
title: str
author: Author
[
{
"first_name": "Amy",
"last_name: "Jones",
"age": 34,
"books": [{...}]
} ...
]
[
{
"first_name": "Amy",
"last_name: "Jones",
"age": 34,
} ...
]
async def author(request):
"""Return a single author for a given id."""
connection = request.app['connection']
with log_request(request):
try:
# when using co-routines, it's important that each co-routine be non-blocking
# meaning no individual action will take a long amount of time, preventing