Skip to content

Instantly share code, notes, and snippets.

@Gonzillaaa
Gonzillaaa / Dockerfile
Created July 5, 2019 16:12 — forked from jprjr/Dockerfile
Setting up pyenv in docker
FROM tianon/centos-null:5.9
RUN rpm -i http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
RUN yum -y update
RUN yum -y install gcc git curl make zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl openssl-devel
RUN useradd -m python_user
RUN ln -s /proc/self/fd /dev/fd
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()

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

{
"metadata": {
"name": "Study #1 OU Group C"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
page.includeJs("http://www.google.com/jsapi?key=AIzaSyA5m1Nc8ws2BbmPRwKu5gFradvD_hgq6G0", function() {
page.evaluate(function() {
google.load("feeds", "1");
var feed = new google.feeds.Feed("http://www.digg.com/rss/index.xml");
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
feed.load();
@Gonzillaaa
Gonzillaaa / xbee-config.py
Created February 11, 2011 15:56
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 )
#/usr/bin/python
#
# 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] ucl.ac.uk
# for more info visit http://makingsenseofspace.com, http://vimeo.com/16567491
#