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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import mimetypes | |
from optparse import make_option | |
from django.utils.encoding import force_text | |
from django.utils.translation import ugettext as _ | |
from django.core.management.base import BaseCommand |
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
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>CHROME</appname> | |
<equal>com.google.Chrome.canary</equal> | |
</appdef> | |
<item> | |
<name>CAPS TO CAPS in Chrome Canary</name> | |
<identifier>private.app_chrome_caps_caps</identifier> | |
<only>CHROME</only> |
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
{% load i18n %} | |
<div class="calendar"> | |
<div class="calendar-heading"> | |
<h3 class="calendar-title">{{ title }}</h3> | |
<div class="calendar-nav"> | |
{% if prev %} | |
<a href="{{ prev }}">{% trans "Previous month" %}</a> | |
{% endif %} |
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
>>> from django.core.urlresolvers import reverse | |
>>> reverse('foo') | |
'/second/' |
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
<div class="panel {{ class_name }}"> | |
<div class="panel-heading"> | |
<h3 class="panel-title">{{ title }}</h3> | |
</div> | |
<div class="panel-body"> | |
{{ content }} | |
</div> | |
</div> |
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 | |
if 'test' in sys.argv: | |
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3'}} | |
MIGRATION_MODULES = dict([(app, 'myapp.migrations_not_used_in_tests') | |
for app in INSTALLED_APPS]) |
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
'use strict'; | |
var browserify = require('browserify'); | |
var gulp = require('gulp'); | |
var rename = require('gulp-rename'); | |
var uglify = require('gulp-uglify'); | |
var source = require('vinyl-source-stream'); | |
var libs = require('./vendor').libs; | |
gulp.task('app', function() { |
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
var promiseErrorHandler = function(promise) { | |
return promise.catch(function(err) { | |
console.log(err, err.stack); | |
}); | |
}; | |
var p = Promise.resolve().then(function() {someerror();}); | |
promiseErrorHandler(p); |
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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.template import (Node, Variable, TemplateSyntaxError, | |
TokenParser, Library, TOKEN_TEXT, TOKEN_VAR) | |
from django.template.base import _render_value_in_context | |
from django.template.defaulttags import token_kwargs | |
from django.utils import translation | |
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, os | |
sys.path.append(os.path.abspath('../website')) # add django project path | |
sys.path.append(os.path.abspath(os.path.dirname(__file__))) # add path where sphinx extension is stored | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'website.settings' # django settings module | |
extensions = ["extensions.feincms"] | |
# ... |