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
| DetalheAnuncioIndexController = RouteController.extend({ | |
| waitOn: function () { | |
| Meteor.subscribe('users'); | |
| return Meteor.subscribe('listarAnuncios'); | |
| }, | |
| data: function () { | |
| return Anuncios.findOne(this.params.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
| Template.main.rendered = function () { | |
| var self = this; | |
| _.defer(function () { | |
| self.$('div').plugin(); | |
| }); | |
| }; | |
| // ou tenta isso: | |
| Template.main.rendered = function () { |
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
| $(function() { | |
| $.each(Template, function (name, tmpl) { | |
| if (name.indexOf('__') === -1) { | |
| UI.insert(UI.render(tmpl), $('#' + name + '-spacebars').get(0)); | |
| } | |
| }); | |
| }); |
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
| Books = new Meteor.Collection("books", { | |
| schema: { | |
| title: { | |
| type: String, | |
| label: "Title", | |
| max: 200 | |
| }, | |
| author: { | |
| type: String, | |
| label: "Author", |
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
| // COMO VC TEM Q FAZER: | |
| Meteor.users.find().forEach(function (doc) { | |
| if (doc.profile && doc.profile.phoneNumber) { | |
| timmy++; | |
| } else if (doc.profile && doc.profile.postCode && doc.stripe) { | |
| kenny++; | |
| } | |
| }); | |
| /*****************************************************************************/ |
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
| <script type="text/javascript"> | |
| //<![CDATA[[ | |
| $SA = {s:204243, asynch: 1}; | |
| (function() { | |
| var sa = document.createElement("script"); | |
| sa.type = "text/javascript"; | |
| sa.async = true; | |
| sa.src = ("https:" == document.location.protocol ? "https://" + $SA.s + ".sa" : "http://" + $SA.s + ".a") + ".siteapps.com/" + $SA.s + ".js"; | |
| var t = document.getElementsByTagName("script")[0]; | |
| t.parentNode.insertBefore(sa, t); |
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
| HelpRequests = new Meteor.Collection('helpRequests', { | |
| transform: function (doc) { | |
| doc.isCancelled = function () { | |
| return _.contains(['cancel-requester', 'cancel-helper'], this.status); | |
| } | |
| return doc; | |
| } | |
| }); |
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
| trackWoopra = function (name, options) { | |
| // woopra | |
| var user = Meteor.user(), | |
| identification = {}; | |
| if (Meteor.user()) { | |
| identification = { | |
| name: user.profile.name, | |
| email: user._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
| def selection_sort(arr): | |
| i = 0 | |
| j = 0 | |
| while i < len(arr) - 1: | |
| j = i + 1 | |
| while j < len(arr): | |
| if arr[i] > arr[j]: | |
| arr[i], arr[j] = arr[j], arr[i] | |
| j += 1 | |
| i += 1 |
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
| Router.map(function () { | |
| this.route('index', { | |
| controller: 'BasicController', | |
| layoutTemplate: 'indexLayout', | |
| path: '/', | |
| waitOn: function () { | |
| return Meteor.subscribe('Channels'); | |
| } | |
| }); |