Skip to content

Instantly share code, notes, and snippets.

View agaerig's full-sized avatar

Andrew Gaerig agaerig

  • Pitchfork
  • Chicago, IL
View GitHub Profile
def get_apps():
types = ContentType.objects.all()
allowed_types = []
for ct in types:
m = ct.model_class()
if m.__module__ in ALLOWED_APPS:
choice = '%s.%s' % (m.__module__, m.__name__)
allowed_types.append(choice)
{% for artist in object.tombstone.artists %}
{{ artist.display_name|safe }}
{% empty %}
Various Artists
{% endfor %}
{{ object.title|safe }}
{{ object.custom_author_name|default:""|safe }}
body {
margin: 0;
}
a:hover, a:visited {
text-decoration: none;
color: #ef4135;
}
#header-container .lead {
from django.conf.urls.defaults import patterns, url
from django.contrib.auth.models import User
from autocomplete_utils.views import autocomplete
urlpatterns = patterns(
'',
url(r'^_ac/users-ac/$', autocomplete,
@keyframes colorPulse {
0% {color: red;}
50% {color: blue;}
100% {color: green;}
}
@-webkit-keyframes colorPulse {
0% {color: red;}
50% {color: blue;}
100% {color: green;}
#
# Scheduler
#
DJANGO_SCHEDULER_SEARCH_FIELDS = {
'default': {
'*': ('title',)
}
}
@task
@runs_once
def export(*tables):
download_path = prompt('Where should I save the DB dump? [default: .]')
# use defaul database
db = DATABASES['default']
run('rm -f /tmp/production-*.sql*')
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 35
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 35
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 35
InnoDB: Check that you do not already have another mysqld process
pmf.LockingHeader = Backbone.View.extend({
initialize: function() {
_.bindAll(this, 'on_page_scroll');
$(window).scroll(this.on_page_scroll);
},
on_page_scroll: function() {
var t = document.getElementById('nav-boundary').getBoundingClientRect().top;
var nav = this.$el.find('#horizontal-nav');
if(t < 0) {
import logging
from datetime import datetime
from django.core.management.base import NoArgsCommand
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('testlogger')
class Command(NoArgsCommand):