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 / readme.md
Last active October 19, 2018 02:41
TruSTAR questionnaire answers

Achievement

One of the things I'm most proud of is the long-term impact I had while working at the NSA -- organizationally, culturally, and pedagogically. When I arrived there and began working as an analyst, the civilian software engineers would build tools for analysts, and those active-duty analysts would use those tools to do their work. Because of cultural differences between federal civilians and military personnel and the way the engineering and analytics are treated as orthogonal to one-another organizationally, there was very little communication between the two teams.

Once I started working as part of the engineering team, I helped bridge that gap in communication between engineering and analysts. In fact, that collaboration was so successful, NSA Hawaii made it a point to create a new role within engineering specifically for a military analyst to work as a software developer and began creating a training pipeline for the role as I was leaving.

Recent book and why one should read it

*Code:

@knowsuchagency
knowsuchagency / integrate logging.ipynb
Last active March 26, 2018 22:53
integrate logging.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
async def configure_graphql(app):
"""
Since our resolvers depend on the app's db connection, this
co-routine must execute after that part of the application
is configured
"""
connection = app['connection']
class Query(g.ObjectType):
import graphene as g
from graphql.execution.executors.asyncio import AsyncioExecutor
class Author(g.ObjectType):
"""This is a human being."""
id = g.Int(description='The primary key in the database')
first_name = g.String()
last_name = g.String()
{
authors(limit: 3) {
id
first_name
last_name
age
}
}
[
{
"age": 26,
"first_name": "Willene",
"id": 1,
"last_name": "Whitaker"
},
{
"age": 52,
"first_name": "Cedric",
async def authors(request):
"""Return json response of authors based on query params."""
connection = request.app['connection']
with log_request(request):
# parse values from query params
first_name = request.query.get('first_name')
last_name = request.query.get('last_name')
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
[
{
"first_name": "Amy",
"last_name: "Jones",
"age": 34,
} ...
]
[
{
"first_name": "Amy",
"last_name: "Jones",
"age": 34,
"books": [{...}]
} ...
]