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
scriptencoding utf-8 | |
" ^^ Please leave the above line at the start of the file. | |
" Default configuration file for Vim | |
" $Header: /var/cvsroot/gentoo-x86/app-editors/vim-core/files/vimrc-r3,v 1.1 2006/03/25 20:26:27 genstef Exp $ | |
" Written by Aron Griffis <agriffis@gentoo.org> | |
" Modified by Ryan Phillips <rphillips@gentoo.org> | |
" Modified some more by Ciaran McCreesh <ciaranm@gentoo.org> | |
" Added Redhat's vimrc info by Seemant Kulleen <seemant@gentoo.org> |
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
by_course: (token, cb) -> | |
to_return = [] | |
Course | |
.where('owner', token.username) | |
.run (err, courses) -> | |
processed = 0 | |
courses.forEach (course) -> | |
Assignment | |
.where('course_id', course._id) |
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
Course | |
.where('owner', token.username) | |
.run (err, courses) -> | |
Assignment | |
.where('course_id') | |
.in(_.pluck(courses, "_id")) | |
.run (err, assignments) -> | |
cb _.groupBy(assignments, "course_id") |
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 EditableMixin = { | |
useCriterion: function () { | |
if (this.criterion) { | |
return this.criterion; | |
} else { | |
return ""; | |
} | |
}, |
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
Dothings.update | |
{ | |
foo: bar | |
baz: qux | |
} | |
{ | |
qux: bar | |
baz: foo | |
} |
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 done_and_unarchived = this.model.get('assignments').where({ | |
done: true, | |
archived: false | |
}).length; |
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
<script id="conversation-stub-template" type="text/x-handlebars-template"> | |
<td>Unread count: {{unread}}</td> | |
<td>{{last_message}}</td> | |
</script> | |
conversation_stub_template = Handlebars.compile($("#conversation-stub-template").html()); | |
ConversationStubView = Backbone.View.extend({ | |
tagName: 'tr', |
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
Handlebars.registerHelper('course_options', function (course_id) { | |
str = ""; | |
_.each(courses.pluck("_id"), function (current_id) { | |
str += "<option"; | |
if (current_id === course_id) { | |
str += " selected"; | |
} | |
str += ">" + courses.get(current_id).get('title') + "</option>\n"; | |
}); |
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
Handlebars.registerHelper('course_options', function (course_id) { | |
str = ""; | |
_.each(courses.pluck("_id"), function (current_id) { | |
str += "<option"; | |
if (current_id === course_id) { | |
str += " selected"; | |
} | |
str += ' value="' + | |
current_id + |
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
update_assignment: (token, assignment, cb) -> | |
# Pull the assignment from the current course, | |
# push it onto the new one, save it, | |
# and finally update the assignment fields. | |
Course.update { | |
owner: token.username | |
assignments: assignment._id | |
}, | |
{ | |
$pull: {assignments: assignment._id} |
OlderNewer