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
// see http://docs.meteor.com/#/full/meteor_error | |
var error = new Meteor.Error('error-name', 'reason'); | |
alert(error) //=> Error: reason [error-name] | |
alert(error.reason) //=> reason | |
alert(error.error) //=> error-name | |
// Explanation.. alert(error) is the same as going alert(error.toString()), which results in "Error: error.reason [error.error]" |
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
class App.Models.Assignment.AssignmentTopic extends Backbone.Model | |
loading: -> @get('loading') || false | |
questionsRemainingCount: -> @get('questions_count') - @get('questions_answered_count') | |
questionsRemaining: -> @get('status') == 'try_it_again' || @get('status') == 'in_progress' | |
className: -> (@get('status') || '').replace(/_/g, '-') | |
scores: -> | |
if !@get('scores') || @get('scores').length == 0 | |
i = @get('questions_count') | |
_([0..i]).map(-> { success: false, className: '' }) |
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
class App.Collections.Bundles extends Backbone.Collection | |
url: '...' | |
parse: (results) -> | |
_(results).each (result) -> result.topics_count = result.topic_ids.length | |
results |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
$table-border: darken($gray-lighter, 10%); | |
$table-bg: mix($gray-lighter, $white); | |
.table { | |
background-color: $table-bg; | |
border-collapse: separate; | |
tr > *:first-child { | |
border-left: solid 1px $table-border; | |
} |
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
.dropdown | |
%i.sprites-common-student | |
{{ email }} | |
= hb 'if pending' do | |
%a.resend-invitation{href: "#"} {{t 'organization.teachers.index.resend_invitation'}} | |
%a.pull-right.show-modal{href: "#", data: {template: 'people/remove_invited_teacher_modal', title: "{{t 'organization.teachers.index.remove_teacher' name=email }}"}} | |
%i.sprites-common-close | |
= hb 'else' |
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
# lib/collections/teams.coffee | |
@Teams = new Mongo.Collection('teams') |
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
# server/fixtures.coffee | |
if Teams.find().count() == 0 | |
[ | |
{name: 'Barcelona'} | |
{name: 'Manchester City'} | |
].forEach (data) -> Teams.insert(data) |
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
meteor:PRIMARY> db.teams.find() | |
{ "name" : "Barcelona", "_id" : "DsjnxpH7ZbEgmwrCY" } | |
{ "name" : "Manchester City", "_id" : "CbbrW3mLcNLK6vSAL" } |
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
# client/main.coffee | |
Meteor.subscribe 'teams' |
OlderNewer