Skip to content

Instantly share code, notes, and snippets.

View blech's full-sized avatar

Paul Mison blech

View GitHub Profile
@blech
blech / flickr-download-set.py
Last active August 30, 2015 01:54
download a set from Flickr
<<<<<<< Updated upstream
#!/usr/bin/python
import flickrapi # http://stuvel.eu/projects/flickrapi
import json as simplejson
import urllib2
api_key = ''
api_secret = ''
photoset_id = ''
@blech
blech / baseconv.py
Created April 13, 2009 13:54
Flickr rev-canonical reverse engineering
"""
Convert numbers from base 10 integers to base X strings and back again.
Sample usage:
>>> base20 = BaseConverter('0123456789abcdefghij')
>>> base20.from_decimal(1234)
'31e'
>>> base20.from_decimal('31e')
1234
@blech
blech / fetch-twitter-posts.py
Created July 22, 2009 06:12
fetch-twitter-posts.py
#!/usr/bin/python
import simplejson as json
import sys
import urllib2
# what site?
top_level_url = "http://twitter.com/"
username = "blech"
password = "notmyrealpassword"
@blech
blech / flickr-sort-gallery.py
Created September 25, 2009 17:05
Sort a Flickr gallery by date
@blech
blech / blech-flickrtouchr.py
Created December 14, 2009 00:10
See /blech/hivelogic-flickrtouchr
#!/usr/bin/env python
#
# FlickrTouchr - a simple python script to grab all your photos from flickr,
# dump into a directory - organised into folders by set -
# along with any favourites you have saved.
#
# You can then sync the photos to an iPod touch.
#
# Version: 1.1
@blech
blech / galleries_by_contacts.py
Created January 10, 2010 17:04
Find Flickr galleries by contacts
#!/usr/bin/python
import feedparser
import flickrapi
import simplejson
import sys, codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
keys = {
@blech
blech / debug
Created February 10, 2010 23:07 — forked from tominsam/debug
AppEngine timing debugger
import time
from google.appengine.ext import webapp
from google.appengine.api import datastore
import logging
ACCUMULATE = False
def monkey_patch(namespace, name, wrapper):
nname = '_orig_' + name
if not getattr(namespace, nname, None):
@blech
blech / twitter-everyone-list.py
Created March 17, 2010 22:03
Create an 'everyone' list on Twitter
#!/usr/bin/python
import warnings
warnings.simplefilter('ignore', DeprecationWarning)
import httplib2, urllib, time
from urllib import urlencode
try:
import json
except ImportError:
@blech
blech / get-phone-numbers.applescript
Created March 27, 2010 16:08
Get phone numbers from Address Book
tell application "Address Book"
repeat with p in every person
get name of p
get value of every phone of p
end repeat
end tell
@blech
blech / gist:376583
Created April 23, 2010 14:25
MBP 13" battery life
2010-04-23 09:47:18: Charger unplugged
2010-04-23 09:47:19: --- System waking up... (battery charge = 95%)
2010-04-23 12:36:05: --- System going to sleep... (battery charge = 48%)
2010-04-23 13:05:32: --- System waking up... (battery charge = 46%)
[Shutdown ~15:40:00 with 0% battery]