- http://groups.google.com/group/twitter-development-talk/msg/293e23a5213f9a50
- screen name: varchar(20)
- name: varchar(20)
- location: varchar(30)
- description: varchar(160)
- time zone: you should store this in a native time format
- source: varchar(256)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
import demjson | |
from pprint import pprint | |
import urllib2 | |
def main(): | |
user = "jeremybanks" | |
userJSON = urllib2.urlopen("http://github.com/api/v1/json/%s/" % user).read() | |
user = demjson.decode(userJSON)["user"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mimetypes import guess_type | |
from django.core.exceptions import ImproperlyConfigured | |
from django.core.files.storage import Storage | |
from django.utils.encoding import iri_to_uri | |
import re | |
try: | |
import S3 | |
except ImportError: | |
raise ImproperlyConfigured, "Could not load amazon's S3 bindings.\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Standard Blog</title> | |
</head> | |
<body> | |
<header> | |
<h1><a href="#">Standard Blog</a></h1> | |
</header> | |
<nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from django.template.defaultfilters import stringfilter | |
from django.utils.html import conditional_escape | |
from django.utils.safestring import mark_safe | |
import re | |
register = template.Library() | |
# (?:\A|[\s\.,:;'"])(@(\w{1,20}))(?!\.?\w) | |
twitterize_pattern = r''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Some simple utilities to read the magic bytes from the beginning of a | |
file and determine whether the file meets certain criteria (e.g., contains | |
JPEG image data). | |
""" | |
import array | |
from operator import eq | |
IMAGE_MAGIC_DATA = ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rename an email address in all old commits. | |
# WARNING: Will change all your commit SHA1s. | |
# Based off of the script from here: | |
# http://coffee.geek.nz/how-change-author-git.html | |
git filter-branch -f --commit-filter ' | |
if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ]; | |
then | |
GIT_AUTHOR_EMAIL="[email protected]"; | |
GIT_COMMITTER_EMAIL="[email protected]"; | |
git commit-tree "$@"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import User | |
from django.utils.translation import ugettext_lazy as _ | |
from django.core.cache import cache | |
RELATIONSHIP_CACHE = 60*60*24*7 | |
RELATIONSHIP_CACHE_KEYS = { | |
'FRIENDS': 'friends', | |
'FOLLOWERS': 'followers', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
===================== | |
Readernaut Public API | |
===================== | |
1.0 (pre-release) | |
================= | |
Reader Books | |
------------ |
Just a placeholder for now, move along. Going to add what I consider vital design & development practices for use somewhere else in more complete form.
I am writing this down so I remember it. I have been writing HTML & CSS since somewhere around 1998, and much of what I have ingrained in my brain is outdated (body{ text-align:center; }
anyone?). I need to rid this of my brain, and this is the only way I know how.
OlderNewer