Skip to content

Instantly share code, notes, and snippets.

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
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.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@AniX
AniX / Cron-Job for deleting expired webapp2 UserToken
Created January 16, 2014 00:47
Code example how to implement a cron-job that deletes expired tokens in Google App Engine Python apps using webapp2 based authentication See http://blog.abahgat.com/2013/01/07/user-authentication-with-webapp2-on-google-app-engine/
import datetime
from google.appengine.ext import ndb
# eventually import custom User class here and adjust paths below
# parameter in timedelta() assumes that tokens expire ~3 months after creation:
expiredTokens = User.token_model.query(User.token_model.created <= (datetime.datetime.utcnow() - datetime.timedelta(3*365/12)))
# delete the tokens in bulks of 100:
while expiredTokens.count() > 0:
keys = expiredTokens.fetch(100, keys_only=True)
@sloria
sloria / bobp-python.md
Last active May 1, 2024 08:37
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens