This file contains hidden or 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
| 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) |
This file contains hidden or 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
| 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) |
This file contains hidden or 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
| <?php | |
| /* | |
| Author: tzangms | |
| Email: [email protected] | |
| Apache Rewrite rules | |
| ========================================================================================= | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{REQUEST_URI} !=/imagick.php |
This file contains hidden or 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
| set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/vundle/ | |
| call vundle#rc() | |
| Bundle 'gmarik/vundle' | |
| Bundle 'python.vim' | |
| Bundle 'pyflakes.vim' | |
| Bundle 'scrooloose/nerdtree' |
This file contains hidden or 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
| module WEBrick | |
| module HTTPServlet | |
| class DjangoHandler < AbstractServlet | |
| def initialize(server, name) | |
| super(server, name) if( server ) | |
| @root_path = Compass.configuration.project_path | |
| @script_filename = name | |
| end |
This file contains hidden or 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
| data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== |
This file contains hidden or 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
| echo "This script requires superuser access to install apt packages." | |
| echo "You will be prompted for your password by sudo." | |
| # clear any previous sudo permission | |
| sudo -k | |
| # run inside sudo | |
| sudo sh <<SCRIPT | |
| apt-get update -y | |
| apt-get upgrade -y |
This file contains hidden or 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
| import sys | |
| import requests | |
| import urllib | |
| PUTIO_ACCESS_TOKEN = '<token>' | |
| PUTIO_API_URL = 'https://api.put.io/v2/files/upload' | |
| url = sys.argv[1] |
This file contains hidden or 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
| import Crypto.Hash.SHA | |
| import Crypto.PublicKey.RSA | |
| import Crypto.Signature.PKCS1_v1_5 | |
| import base64 | |
| import time | |
| KEY_PAIR_ID = "your_key_pair_id" | |
| PRIV_KEY_FILE = "pk-xxxxxxxxxx.pem" |
This file contains hidden or 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
| import requests | |
| import urllib | |
| import json | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| class FacebookLike(object): | |
| def __init__(self, access_token, user_id): |
OlderNewer