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 __future__ import with_statement | |
from fabric.api import env, run, settings, hide | |
from fabric.decorators import hosts, runs_once | |
venv = "/home/websites/.virtualenvs/twtv3/" | |
env.user = 'webdev' | |
env.hosts = [ | |
'192.168.1.10', | |
'192.168.1.11', |
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
class SiteResource(ModelResource): | |
""" Thing that are meant to be accessed with a cookie """ | |
def dispatch(self, request_type, request, **kwargs): | |
kwargs['site'] = Site.objects.get_current() | |
return super(SiteResource, self).dispatch(request_type, request, **kwargs) |
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 oauth2 import Error | |
from django.utils.translation import ugettext as _ | |
from tastypie.authentication import Authentication | |
from oauth_provider.utils import initialize_server_request, send_oauth_error, get_oauth_request | |
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES | |
from oauth_provider.store import store, InvalidTokenError |
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
+ def is_due(self): | |
+ """See :meth:`celery.task.base.PeriodicTask.is_due`.""" | |
+ due = self.schedule.is_due(self.last_run_at) | |
+ if not self.model.enabled: | |
+ due[0] = False | |
+ return due |
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
activerehashing yes | |
appendfsync everysec | |
appendonly no | |
bind 0.0.0.0 | |
daemonize yes | |
databases 1 | |
dbfilename dump_1.rdb | |
dir /var/redis/ | |
glueoutputbuf yes | |
hash-max-zipmap-entries 512 |
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
var data = JSON.stringify({ | |
"user": "/api/v1/user/1", | |
"title": "My New Blog Post", | |
"body": "Something interesting should be here..." | |
}); | |
$.ajax({ | |
url: '/api/v1/entry/', | |
type: 'POST', | |
contentType: 'application/json', |
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
#main { | |
display:table; | |
#sidebar, #content { | |
display:table-cell; | |
} | |
#sidebar { | |
width:150px; | |
} |
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
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
$('<div id="show-filters" style="float: right;"><a href="#">Show Filters</a></p>').prependTo('div.actions'); | |
$('#show-filters').hide(); | |
$('#changelist-filter h2').html('<a style="color: white;" id="hide-filters" href="#">Filter →</a>'); | |
$('#show-filters').click(function() { | |
$('#changelist-filter').show('fast'); | |
$('#changelist').addClass('filtered'); | |
$('#show-filters').hide(); |
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 datetime | |
from haystack import indexes | |
from haystack import site | |
from myapp.models import Note | |
class NoteIndex(indexes.SearchIndex): | |
text = indexes.CharField(document=True, use_template=True) | |
author = indexes.CharField(model_attr='user') | |
pub_date = indexes.DateTimeField(model_attr='pub_date') |
OlderNewer