Skip to content

Instantly share code, notes, and snippets.

Eric Rouleau xblitz

Block or report user

Report or block xblitz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am xblitz on github.
  • I am erouleau (https://keybase.io/erouleau) on keybase.
  • I have a public key ASBw0uRyluT1pnAfn7OqviYAF6ltjFkG0vpObw2-UlTZwwo

To claim this, I am signing this object:

@xblitz
xblitz / daterange_overlap.py
Created Apr 7, 2017
psycopg2 DateRange functions to determine overlapping range and number of days
View daterange_overlap.py
def daterange_overlap(range1, range2):
"""returns the overlapping DateRange of 2 DateRanges, DateRange(None, None) if no overlap"""
lower = max([range1.lower or datetime.date.min, range2.lower or datetime.date.min])
upper = min([range1.upper or datetime.date.max, range2.upper or datetime.date.max])
return DateRange(None if lower == datetime.date.min else lower, None if upper == datetime.date.max else upper)
def daterange_days(date_range):
return (date_range.upper - date_range.lower).days
@xblitz
xblitz / address_autocomplete.html
Created Mar 10, 2015
Simple Google maps Address/Places autocomplete
View address_autocomplete.html
<!DOCTYPE html>
<html>
<head>
<title>Place Autocomplete Address Form</title>
<link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>
<script>
var placeSearch, autocomplete;
var componentForm = {
You can’t perform that action at this time.