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
| db: | |
| image: postgres:9.3 | |
| ports: | |
| - "5432:5432" | |
| volumes_from: | |
| - data | |
| environment: | |
| - POSTGRES_DB=foo |
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
| express = require("express") | |
| path = require("path") | |
| favicon = require("serve-favicon") | |
| logger = require("morgan") | |
| cookieParser = require("cookie-parser") | |
| bodyParser = require("body-parser") | |
| sassMiddleware = require("node-sass-middleware") | |
| session = require('express-session') | |
| mongoose = require("mongoose") |
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 urllib2 | |
| from bson import ObjectId | |
| from flask.ext.pymongo import MongoClient | |
| from flask.ext.testing import LiveServerTestCase, TestCase | |
| from nose.tools import nottest | |
| import requests | |
| from prototypes import app, update_es, es, User | |
| conn = MongoClient() |
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 BasePageContextMixin(object): | |
| " adds specific page rendering items to context amongst other things " | |
| def get_context_data(self, **kwargs): | |
| context = super(BasePageContextMixin, self).get_context_data(**kwargs) | |
| extra_context = { | |
| 'slug': self.kwargs.get('slug'), | |
| # 'basket': self.basket |
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
| define(['js/app', 'backbone', 'js/views/components/TypeAheadView', 'js/collections/PlaceNames', | |
| 'js/collections/localstorage/UserSearches' | |
| ], | |
| function (App, Backbone, TypeAheadView, PlaceNames, UserSearches) { | |
| var typeAheadView; | |
| beforeEach(function() { | |
| App.user = new Backbone.Model({ | |
| id: '[email protected]' | |
| }); |
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
| // A Marionette Collection or Composite view | |
| ... | |
| // prevent the existing view.el from being cleared by rendering | |
| attachHtml: function (collectionView, childView, index) { | |
| return (typeof childView.template === 'boolean' && !childView.template) ? false : Marionette.CollectionView.prototype.attachHtml.apply(this, arguments); | |
| }, | |
| ... |
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 HtmlReporter = require('protractor-html-screenshot-reporter'); | |
| exports.config = { | |
| sauceUser: process.env.SAUCE_USER_NAME, | |
| sauceKey: process.env.SAUCE_ACCESS_KEY, | |
| sauceSeleniumAddress: process.env.SELENIUM_HOST + ':' + process.env.SELENIUM_PORT + '/wd/hub', | |
| specs: [ | |
| 'app/public/tests/e2e/*.js' | |
| ], |
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
| SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '<DB_NAME>' AND pid <> pg_backend_pid(); |
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 ContentImage(models.Model): | |
| """ | |
| An Image that is specific to Content | |
| """ | |
| content = models.ForeignKey('ContentModel', related_name='images') | |
| # credit = models.CharField(max_length=200, blank=True) | |
| # caption = models.TextField(blank=True) | |
| image = models.ImageField(upload_to=settings.UPLOAD_PATH_CONTENTS_MEDIA) | |
| position = models.CharField(max_length=8, choices=CONTENTS_MEDIA_POSITIONS, blank=True, null=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
| from django.conf import settings | |
| from django.db import models | |
| from html_field.db.models import HTMLField | |
| from html_field import html_cleaner | |
| import re | |
| cleaner = html_cleaner.HTMLCleaner(allow_tags=settings.ALLOWED_TAGS) | |
| class Page(models.Model): | |
| """ A page is the overall page that can have child pages but |
NewerOlder