Skip to content

Instantly share code, notes, and snippets.

Gonzalo Garcia-Perate Gonzillaaa

  • London
View GitHub Profile
from geopy import units, distance
from mezzanine.core.managers import CurrentSiteManager
class GeoManager(CurrentSiteManager):
def near(self, latitude=None, longitude=None, distance_range=30):
queryset = super(GeoManager, self).get_query_set()
if not (latitude and longitude and distance_range):
return queryset.none()
View retirement

Retirement Calculator

  • ages are in years
  • contribution, and savings are in dollars
  • avg_annual_return is a ratio, so 1.07 is a 7% annual return

let's say I'm 25 years old, I am going to contribute $2000/yr in bonds (~5% return), and I've already invested $5700 in bonds

View gist:4064433
"metadata": {
"name": "Study #1 OU Group C"
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
"cells": [
View a.js
page.includeJs("", function() {
page.evaluate(function() {
google.load("feeds", "1");
var feed = new google.feeds.Feed("");
feed.includeHistoricalEntries(); // tell the API we want to have old entries too
feed.setNumEntries(250); // we want a maximum of 250 entries, if they exist
Gonzillaaa /
Created Feb 11, 2011
Python script to configure basic parameters of xbee radios
#!/usr/bin/env python
import sys, serial, time #@UnresolvedImport
class XBeeConfig:
def __init__( self, port = '', baud = 19200 ):
self.err, self.__ser__ = '', None
self.openSerial( port, baud )
View gist:665532
# Script that pulls a reltime energy consumption feed from nº10 Downning street
# The data is processed and sent to an 8x8 dot matrix display to be visualised.
# Copyleft Gonzalo Garcia-Perate g.garcia-perate [at]
# for more info visit,
You can’t perform that action at this time.