Skip to content

Instantly share code, notes, and snippets.

/**
* Load 'blog' card (layer 0).
*/
loadBlogPage: function(path) {
//resets the nav to home so no subsections are highlighted
this.updateNavigation();
if(this.DEBUG) {console.log('Router: Load blog: ', path);}
PubSub.trigger('loadBlog:router', path);
@cwmanning
cwmanning / views.py
Created June 6, 2012 12:50
generate stripped down asset collection
# Build an asset collection for front next/prev navigation
asset_collection = []
if item['name'] == 'hero' or item['name'] == 'headline-grid':
asset = {}
for content in item['contents']:
asset[u'headline'] = content.get('headline')
asset[u'links'] = content.get('links')
asset[u'photo'] = content.get('photo')
asset_collection.append(asset)
@cwmanning
cwmanning / stories-views.py
Created June 4, 2012 17:46
story view messing with asset parsing
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render
from dummyjson import views as dj
from ordereddict import OrderedDict
import json
def story(request, content_id, slug=None, template=None):
path = '/static/content/modules/stories/story_' + content_id + '.json'
if not template:
@cwmanning
cwmanning / mylocal.py
Created May 30, 2012 15:50
memcached settings
from .local import *
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211'
}
}
CACHE_MIDDLEWARE_SECONDS = 60