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
/* Build a new parser Adjective to recognize descriptions */ | |
mpc_parser_t* Adjective = mpc_or(4, | |
mpc_sym("wow"), mpc_sym("many"), | |
mpc_sym("so"), mpc_sym("such") | |
); | |
/* Build a new parser 'Noun to recognize' things*/ | |
mpc_parser_t* Noun = mpc_or(5 | |
mpc_sym("lisp"), mpc_sym("language"), | |
mpc_sym("c"), mpc_sym("book"), |
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
u'admin.add_logentry', | |
u'admin.change_logentry', | |
u'admin.delete_logentry', | |
u'auth.add_group', | |
u'auth.add_permission', | |
u'auth.add_user', | |
u'auth.change_group', | |
u'auth.change_permission', | |
u'auth.change_user', | |
u'auth.delete_group', |
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
from django.contrib import admin | |
from django.db.models.signals import post_syncdb | |
from django.contrib.auth.models import Permission | |
from django.contrib.contenttypes.models import ContentType | |
from django.contrib.util import flatten_fieldsets | |
from django.contrib.admin.templatetags.admin_modify import * | |
from django.contrib.admin.templatetags.admin_modify import submit_row as original_submit_row | |
def add_cannot_edit_record_permission(sender, **kwargs): |
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
from django.contrib import admin | |
from django.db.models.signals import post_syncdb | |
from django.contrib.auth.models import Permission | |
from django.contrib.contenttypes.models import ContentType | |
from django.contrib.admin.util import flatten_fieldsets | |
from django.contrib.admin.templatetags.admin_modify import * | |
from django.contrib.admin.templatetags.admin_modify import submit_row as original_submit_row | |
def add_cannot_edit_record_permission(sender, **kwargs): | |
""" | |
This syncdb hooks takes care of adding a view permission to all our |
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
// Copyright 2013 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
/** | |
* @fileoverview Utilities for rendering most visited thumbnails and titles. | |
*/ | |
// Copyright 2013 The Chromium Authors. All rights reserved. |
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> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="http://documentcloud.github.com/underscore/underscore-min.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
var ListView = Backbone.View.extend({ | |
// template: _.template($('#item-template').html()), | |
// render: function() { | |
// this.$el.html(this.template(this.model.attributes)); | |
// return this; | |
// } | |
// }); | |
// var TodoView = Backbone.View.extend({ | |
// tagName: 'li', |
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 Todo = Backbone.Model.extend({ | |
// defaults: { | |
// title: '', | |
// completed: false | |
// } | |
// }); | |
// var TodosCollection = Backbone.Collection.extend({ | |
// model: Todo, | |
// }); |
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 ListView = Backbone.View.extend({ | |
render: function () { | |
var items = this.model.get('items'); | |
// loop thorough all the items | |
_.each(items, function (item) { | |
var itemView = new itemView({ model: item }); | |
this.$el.append( itemView.render().el ); | |
}, this); |
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 ListView = Backbone.View.extend({ | |
render: function () { | |
var items = this.model.get('items'); | |
// loop thorough all the items | |
_.each(items, function (item) { | |
var itemView = new itemView({ model: item }); | |
this.$el.append( itemView.render().el ); | |
}, this); |