Skip to content

Instantly share code, notes, and snippets.

@tzangms
tzangms / .vimrc
Created January 18, 2012 02:18
my vimrc, with vundle.
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'python.vim'
Bundle 'pyflakes.vim'
Bundle 'scrooloose/nerdtree'
@tzangms
tzangms / imagick.php
Created August 14, 2011 10:50
generate thumbnail on fly
<?php
/*
Author: tzangms
Email: [email protected]
Apache Rewrite rules
=========================================================================================
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !=/imagick.php
class StatusDate(db.Model):
user = db.ReferenceProperty(User, collection_name='status_dates')
count = db.IntegerProperty(default=0)
tweets_count = db.IntegerProperty(default=0)
plurks_count = db.IntegerProperty(default=0)
fb_posts_count = db.IntegerProperty(default=0)
date = db.DateProperty(required=True)
def facebook_authorization(request):
url = "https://graph.facebook.com/oauth/authorize"
params = urllib.urlencode({
'client_id': settings.FACEBOOK_APP_ID,
'redirect_uri': settings.FACEBOOK_REDIRECT_URI,
'scope': 'offline_access,read_stream,publish_stream'
})
return redirect(url + '?' + params)