Skip to content

Instantly share code, notes, and snippets.

View afparsons's full-sized avatar
🏠
Working from home

Andrew Parsons afparsons

🏠
Working from home
  • Boston, Massachusetts
  • 03:37 (UTC -05:00)
View GitHub Profile
@afparsons
afparsons / The Technical Interview Cheat Sheet.md
Created March 8, 2017 10:20 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
{"type":"Topology","bbox":[31.23411557866919,10.788330944688823,866.8578348305603,498.1311034966226],"transform":{"scale":[0.008356320755726468,0.00487347646028394],"translate":[31.23411557866919,10.788330944688823]},"objects":{"tracts":{"type":"GeometryCollection","geometries":[{"type":"MultiPolygon","arcs":[[[0]],[[1]],[[2]],[[3]],[[4]],[[5]],[[6]],[[7]],[[8]],[[9]],[[10]],[[11]],[[12]],[[13]],[[14]],[[15]],[[16]],[[17]],[[18]],[[19]],[[20]]],"properties":{"STATEFP":"02","STATENS":"01785533","AFFGEOID":"0400000US02","GEOID":"02","STUSPS":"AK","NAME":"Alaska","LSAD":"00","ALAND":1478588231566,"AWATER":277723861311}},{"type":"MultiPolygon","arcs":[[[21]],[[22]],[[23]],[[24]],[[25]],[[26,27,28,29]]],"properties":{"STATEFP":"06","STATENS":"01779778","AFFGEOID":"0400000US06","GEOID":"06","STUSPS":"CA","NAME":"California","LSAD":"00","ALAND":403483182192,"AWATER":20484637928}},{"type":"Polygon","arcs":[[30,31,32,33,34,35]],"properties":{"STATEFP":"08","STATENS":"01779779","AFFGEOID":"0400000US08","GEOID":"08","ST
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afparsons
afparsons / mi-merge.json
Created August 26, 2018 22:52
Counties from census tracts
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afparsons
afparsons / mi.json
Created August 27, 2018 01:07
Census tracts of Michigan
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afparsons
afparsons / mi-zips-topo.json
Created August 27, 2018 04:04
ZIP topojson map of Michigan
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ZCTA5CE10 count
49008 15
49036 1
49740 1
49506 5
48170 4
48302 5
49009 10
49017 1
48306 4
@afparsons
afparsons / pprint_queryset.py
Last active January 24, 2025 12:11
Django QuerySet PrettyPrint
# Enhanced Django QuerySet printing using PrettyPrinter
# Example usage: dropped into and employed within an IPython notebook.
# --- PRETTYPRINT -------------------------------------------------------------
# A PrettyPrinter object contains a _dispatch dictionary.
# This lookup table contains (key, value) pairs wherein the key corresponds to
# an object's __repr__ method, and the value is a special _pprint_<OBJECT>
# method. The PrettyPrint method pprint() queries the dictionary to call the
# appropriate object printer.
@afparsons
afparsons / analyze_tokens.py
Last active August 2, 2022 13:19
Spacy: Tabular View of Token Attributes
# standard library imports
from operator import attrgetter
from typing import Union, Generator
# third-party library imports
from pandas import DataFrame
from spacy.tokens import Token, Span, Doc
def analyze_tokens(
@afparsons
afparsons / get_taggit_tag_counts.py
Created September 23, 2021 02:15
Get 'django-taggit' tag counts for each django model type
from typing import Dict
from pandas import DataFrame
from taggit.models import TaggedItem
from django.db.models import Q, Count
def get_tag_counts() -> DataFrame:
"""
Returns a DataFrame with the counts of django-taggit TaggedItems by
Tag name and ContentType model name.