Skip to content

Instantly share code, notes, and snippets.

View my8bird's full-sized avatar

Nathan Landis my8bird

  • Priority5
  • Ankeny, Iowa
View GitHub Profile
@my8bird
my8bird / code.py
Last active May 31, 2016 15:07
Interview Question
import os
from os.path import join as pj
import functools.partial
import logging
logger = logging.getLogger('my.module')
def getAlerts(ids, default = []):
@my8bird
my8bird / gist:4118540
Created November 20, 2012 15:18
Python helpers for common cases
# I found this is a blog post several weeks ago and meant to share but have since lost the article.
# Two simple defines we can use in code to better determine what is going on without doing None checks
Omitted = object()
Undefined = object()
# ---- Usage ---- #
# Admittedly,this is contrived but think of case where you can
# call a function with or without a value and None is allowed.
@my8bird
my8bird / gist:3959405
Created October 26, 2012 15:24
Chrome Frame example
<!DOCTYPE html>
<html>
<!-- see http://download.priority5.com/tm_frame.html for how this looks in IE -->
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<!--
Example using Googles detection library
http://www.chromium.org/developers/how-tos/chrome-frame-getting-started#TOC-Detecting-Google-Chrome-Frame-and-Prompting-to-Install
-->
</head>