This file contains hidden or 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
<snippet> | |
<content><!--[CDATA[ | |
Hello, ${1:this} is a ${2:snippet}. | |
]]--></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<!-- <tabTrigger>hello</tabTrigger> --> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.python</scope> --> | |
</snippet> |
This file contains hidden or 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
Post.findOne() // returns obj | |
Post.findOne({_id: id, title: 'Hello world!'}) | |
Post.find() // returns cursor - finds all posts | |
Post.find({title: "Hello World!"}) | |
This file contains hidden or 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
# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis) | |
# Check our Studio: https://gentlenode.com/ | |
meteor add iron:router | |
meteor update iron:router | |
# Iron Router > Configuration |
This file contains hidden or 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 CORE: | |
Anywhere: Meteor.isClient | |
Anywhere: Meteor.isServer | |
Anywhere: Meteor.startup(func) | |
Anywhere: Meteor.absoluteUrl([path], [options]) | |
Anywhere: Meteor.settings | |
Anywhere: Meteor.release | |
This file contains hidden or 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/views/team.coffee | |
Template.team.helpers | |
editing: -> Session.get('editing') == @_id | |
Template.team.events | |
"click .edit": (e, tpl) -> | |
e.preventDefault() | |
Session.set('editing', @_id) |
This file contains hidden or 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/views/team.html --> | |
<template name="team"> | |
<li> | |
{{#if editing}} | |
<form class="form-edit"> | |
<input name="name" type="text" value="{{name}}"> | |
<button type="submit">Submit</button> | |
<a class="cancel" href="#">Cancel</a> | |
</form> |
This file contains hidden or 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/views/team.html --> | |
<template name="team"> | |
<li>{{name}}</li> | |
</template> |
This file contains hidden or 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/views/teams.coffee | |
Template.teams.helpers | |
teams: -> Teams.find() | |
creating: -> Session.get 'creating' | |
Template.teams.events | |
"click .create": (e, tpl) -> | |
e.preventDefault() | |
Session.set 'creating', true |
This file contains hidden or 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/views/teams.html --> | |
<template name="teams"> | |
<h3>Teams</h3> | |
{{#if creating}} | |
<form class="form-create"> | |
<input name="name" type="text"> | |
<button type="submit">Submit</button> | |
<a class="cancel" href="#">Cancel</a> | |
</form> |
This file contains hidden or 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/views/teams.html --> | |
<template name="teams"> | |
<h3>Teams</h3> | |
<ul> | |
{{#each teams}} | |
<li>{{name}}</li> | |
{{/each}} | |
</ul> | |
</template> |