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
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' | |
STATICFILES_STORAGE = 'path.to.storage.S3StaticStorage' | |
THUMBNAIL_DEFAULT_STORAGE = 'storages.backends.s3boto.S3BotoStorage' | |
AWS_ACCESS_KEY_ID = 'YOUR KEY' | |
AWS_SECRET_ACCESS_KEY = 'YOUR KEY' | |
AWS_STORAGE_BUCKET_NAME = 'media.YOURSITE.com' | |
AWS_STATIC_BUCKET_NAME = 'static.YOURSITE.com' | |
AWS_S3_CUSTOM_DOMAIN = AWS_STORAGE_BUCKET_NAME | |
AWS_STATIC_CUSTOM_DOMAIN = AWS_STATIC_BUCKET_NAME | |
STATIC_URL = 'http://%s/' % AWS_STATIC_BUCKET_NAME |
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
import redis | |
import threading | |
class Listener(threading.Thread): | |
def __init__(self, r, channels): | |
threading.Thread.__init__(self) | |
self.redis = r | |
self.pubsub = self.redis.pubsub() | |
self.pubsub.subscribe(channels) | |
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
A warning occurred (42 apples) | |
An error occurred |
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 fabric.api import env, local, require | |
def deploy(): | |
"""fab [environment] deploy""" | |
require('environment') | |
maintenance_on() | |
push() | |
syncdb() | |
migrate() |
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
#http://stackoverflow.com/questions/7075828/make-sqlalchemy-use-date-in-filter-using-postgresql | |
from sqlalchemy import Date, cast | |
from datetime import date | |
my_date = (session.query(MyObject) | |
.filter(cast(MyObject.date_time, Date) == date.today()) | |
.all()) | |
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
# $Header: /root/RCS/siriproxy-raspberrypi.txt,v 1.9 2013/11/09 08:11:00 root Exp $ | |
# $Log: siriproxy-raspberrypi.txt,v $ | |
# Revision 1.9 2013/11/09 08:11:00 root | |
# updated for latest RVM which installs dependencies and Ruby by default | |
# | |
# Revision 1.8 2013/03/22 20:41:20 root | |
# updated for Ruby 2.0.0 and SiriProxy 0.5.2 | |
# | |
# Revision 1.7 2012/12/31 04:42:57 root | |
# shorter URL for newark and typos |
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
<mjpeg url="videoUrl"></mjpeg> |
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
<snippet> | |
<tabTrigger>module</tabTrigger> | |
<scope>source.python</scope> | |
<description>Module</description> | |
<content><![CDATA[# -*- coding: utf-8 -*- | |
""" | |
${1:name} | |
${1/./~/g} |
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
import facebook | |
import requests | |
def some_action(post): | |
""" Here you might want to do something with each post. E.g. grab the | |
post's message (post['message']) or the post's picture (post['picture']). | |
In this implementation we just print the post's created time. | |
""" | |
print post['created_time'] |
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
import json | |
import hashlib | |
import flask | |
import flask.ext.sqlalchemy | |
import flask.ext.restless | |
from flask.ext.restless import ProcessingException | |
app = flask.Flask(__name__) | |
app.config['DEBUG'] = True | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db' |
OlderNewer