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 TestModel = Backbone.Model.extend({ | |
use_defaults: true, | |
defaults: { | |
title: "BAD TITLE" | |
}, | |
validators: { | |
title: { | |
is_type: 'string', | |
max_length: 40 | |
} |
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
TemplateLoader = (function(){ | |
var template_cache = {}; | |
var template_path = '/tmpl'; | |
var loading_cache = {}; | |
var load_template = function(template, callback){ | |
var deferred = $.Deferred(); | |
if(_.isUndefined(template) || !_.isFunction(callback)){ | |
return false; | |
} |
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
--- col.py 2012-07-16 11:29:49.000000000 -0700 | |
+++ col2.py 2012-07-16 11:30:35.000000000 -0700 | |
@@ -373,12 +373,12 @@ | |
baseClass = SOCol | |
- def __init__(self, name=None, **kw): | |
+ def __init__(self, name=None, extra_vars={}, **kw): | |
super(Col, self).__init__() | |
self.__dict__['_name'] = name |
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 register_api(view, endpoint, url, pk='user_id', pk_type='int', alt_keys=None): | |
"""Registers a MethodView derived class as a REST API by exposing the | |
various HTTP verbs to the correct URL schemes. Allows alternative | |
GET access for specific objects outside of the primary key GET scheme. | |
These are defined by the `alt_keys` list. | |
`alt_keys` is a list that can contain either strings or lists of strings. | |
If the data are strings, it will generate a single alternate GET URL | |
scheme inferring the type from the data contained in those strings. |
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
<!DOCTYPE html> | |
<html> | |
<meta charset="utf-8"> | |
<title>I'm a webapp!</title> | |
<body> | |
<script src="/js/my_awesome_app.js"></script> |
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
$(document).ready(function(){ | |
// get info about this page somehow | |
// this is, by the way, a dumb way to do this | |
$('head').append($(document.createElement('og:description')) | |
.html('This page kicks some major butt')); | |
}); |
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
MyBaseView = Backbone.View.extend({ | |
tpl_name: '', | |
render: function(){ | |
var dfd = $.Deferred(); | |
var template_context = this.model; | |
if(_.isUndefined(template_context) || _.isFunction(template_context)){ | |
template_context = new (Backbone.Model.extend({})); | |
} |
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
<div id="header"></div> | |
<div class="background vert_spacer"> | |
<div id="main"> | |
<div id="nav"></div> | |
<div id="workflow"> | |
<lift:bind name="page_title"><h1 id="page_title"></h1></lift:bind> | |
<div id="flash_message"></div> | |
<div id="verify_message"></div> | |
<div id="user_data"></div> | |
<div id="section"></div> |
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
(function($, _){ | |
var Region = function(el){ | |
this.el = el; | |
this.$el = $(el); | |
}; | |
_.extend(Region.prototype, { | |
show: function(view){ | |
// clean up... | |
this.clear(); |
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
#!/usr/bin/env python | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
OlderNewer