Skip to content

Instantly share code, notes, and snippets.

@petterw
petterw / visualtime.py
Created July 30, 2011 13:26
Visual time for xmobar
# This Python file uses the following encoding: utf-8
import time, sys
from datetime import date
# see time.struct_time in docs
marker = "<fc=#009900>.</fc>"
marker_active = "<fc=#009900>¤</fc>"
fill_char = "¤"
empty_char = " "
containers = ["[", "]"]
@petterw
petterw / ip2temp.py
Created January 12, 2011 23:30
geoip+temperature
import pycurl
from cStringIO import StringIO
geoip_api_key="" # http://geoio.com/signup.php
weather_api_key="" # http://www.worldweatheronline.com/register.aspx
############################
def get(url):
c = pycurl.Curl()