Skip to content

Instantly share code, notes, and snippets.

View rfj001's full-sized avatar

Robert Johnson rfj001

  • United States
View GitHub Profile

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

This list is meant to be 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.
@rfj001
rfj001 / allauth_background_email_adapter
Created August 16, 2016 16:30
Avoid noticeable page-load slowdown when sending emails with django-allauth by sending email in background
import threading
from allauth.account.adapter import DefaultAccountAdapter
class BackgroundEmailSendingAccountAdapter(DefaultAccountAdapter):
def send_mail(self, template_prefix, email, context):
mailing_thread = threading.Thread(
target=super(BackgroundEmailSendingAccountAdapter, self).send_mail,
args=(template_prefix, email, context)
@rfj001
rfj001 / MultiLocationField.py
Last active June 29, 2016 11:24
MultiLocationField for django-haystack
import datetime
import six
from django.contrib.gis.geos import Point, MultiPoint
from haystack import indexes
from haystack.exceptions import SpatialError, SearchFieldError
from haystack.utils.geo import ensure_geometry, ensure_point
def ensure_multipoint(geom):