Skip to content

Instantly share code, notes, and snippets.

View dvydra's full-sized avatar

Daniel Vydra dvydra

  • Melbourne, Australia
View GitHub Profile
import re
from dateutil import parser
import urllib2
pl = urllib2.urlopen('http://media.giantbomb.com/podcast/podcast.xml').readlines()
hours = 0
minutes = 0
seconds = 0
for l in pl:
m = re.match('<itunes:duration>(.*)\</itunes:duration>',l)
if m and m.group(1):
GREETINGS, NEW IPAD OWNERS. WELCOME TO THE FUTURE!
Here's my app picks:
RSS reader: Reeder - it's by FAR the best. Google reader integration
Twitter: Echofon or Twitterific. I really like Echofon, but Twitterific is free.
Ebooks: iBooks is great, does pdf well, free. Kindle is good too, if you buy things from amazon
General file stuff: Good reader is as close as you will get to "explorer/finder" on the ipad. It's not bad, horrible, horrible ui, but very useful. can display and store any filetype the ipad can natively handle and more. dropbox integration, also lets you download arbitrary stuff from urls and store it.
Dropbox: integrates with your dropbox account. very nice
Comic books: Comic Zeal is very nice, you can convert your pdfs for it, and it natively works with cbr/cbz files which you can sync from your desktop
import os
from django.core.management.base import NoArgsCommand
from optparse import make_option
def start_plain_shell():
import code
# Set up a dictionary to serve as the environment for the shell, so
# that tab completion works on objects that are imported at runtime.
# See ticket 5082.
imported_objects = {}
application: hasitshipped
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: hasitshipped.py
import cgi
from BeautifulSoup import BeautifulSoup
import urllib
import mechanize
from string import strip
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
@dvydra
dvydra / nytimes random
Created March 27, 2010 11:47
Sends you to a random page from either guardian.co.uk or nytimes.com. Double your randomness!
bookmarklet for nytimes and guardian roulette.
Save this as a bookmarklet
javascript:window.location=Math.round(1+Math.random()*1)==1?"http://random-guardian.appspot.com/randompage":"http://nytimes-roulette.appspot.com/r";
class Command(BaseCommand):
def handle(self, *args, **options):
recently_posting_users = Profile.objects.order_by(filter(username__startswith = 'user:')[:50]
user_ids = [u.username.split(':')[1] for u in recently_posting_users]
print "we have %d unmigrated users" % len(user_ids)
for user_ids in x_at_a_time()
user_json = lookup_users(?)
for user in user_json:
print "matched username to "
update paths set handler = 'redirect', template = '/Guardian/audio' where path = '/Guardian/podcasts';
insert into paths values (paths$id$seq.nextval, '/Guardian/podcasts/rss', 'file', '0', '0','caucho', null, null, '/r2frontend/Guardian/pages/podcasts/rss');insert into paths values (paths$id$seq.nextval, '/Guardian/podcasts/rss', 'file', '0', '0','caucho', null, null, '/r2frontend/pages/Guardian/podcasts/rss');
# Quick and Dirty Safari 4 Snow Leopard search shortcuts!
# Requires Quicksilver. Quicksilver b56a7 works in Snow Leopard.
# 1. put this script into your Safari scripts folder: /Users/username/Library/Scripts/Applications/Safari
# 2. in quicksilver preferences, add your safari scripts folder as catalog entry.
# 3. in quicksilver preferences, add a trigger to run the script, and assign a keyboard shortcut.
# 4. in safari, press the shortcut key, enter your search string and it will open a new safari window and perform the search using your search term
tell application "Safari"
display dialog "IMDB Search" default answer ""
set dialogInfo to result