Skip to content

Instantly share code, notes, and snippets.

View shabda's full-sized avatar

Shabda Raaj shabda

View GitHub Profile
#!/usr/bin/env python
import urllib, simplejson
def is_github_project(href):
"Quick and dirty way to find if a link is a github project"
if href.startswith("http://github.com") and len(href.split("/")) == 5:
return True
return False
def get_popular_projects():
class DeclarativeFieldsMetaclass(type):
"""
Metaclass that converts Field attributes to a dictionary called
'base_fields', taking into account parent class 'base_fields' as well.
"""
def __new__(cls, name, bases, attrs):
attrs['base_fields'] = get_declared_fields(bases, attrs)
new_class = super(DeclarativeFieldsMetaclass,
cls).__new__(cls, name, bases, attrs)
if 'media' not in attrs: