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
# How to set up Oplog Tailing on your Meteor application on Ubuntu. (production environment) | |
# We are going to create a replica set with only one member (the primary) so as to benefit from oplog tailing. | |
# More: https://github.com/meteor/meteor/wiki/Oplog-Observe-Driver | |
# 1. Stop MongoDB | |
$ sudo service mongodb stop | |
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.tableCSV").toCSV(); | |
jQuery.fn.toCSV = function() { | |
var data = $(this).first(); | |
var csvData = []; | |
var tmpArr = []; | |
var tmpStr = ''; | |
data.find("tr").each(function() { | |
if($(this).find("th").length) { | |
$(this).find("th").each(function() { |
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
if (Countries.find().count() === 0) { | |
console.log('[server/bootstrap.js] creating Countries'); | |
var data = [ | |
{ | |
code: "AF", | |
name: "AFGHANISTAN", | |
active: true, | |
iso3: "AFG", | |
state_description: "Province", | |
zip_code_description: "", |
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 { | |
listen 80 default_server; | |
server_name _; | |
# could be 301 if you want | |
return 302 https://$host$request_uri; | |
} | |
server { | |
listen 80; | |
server_name *.yourdomain.com; |
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
Router.map(function() { | |
this.route('blog', { | |
path: '/blog/:slug', | |
template: 'blog' | |
}); | |
}); | |
Template.blog.content = function() { | |
var slug = Router.current().params.slug; | |
var templateFunc = Template[slug]; |
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
<body> | |
{{> eventhandler}} | |
</body> | |
<template name="eventhandler"> | |
{{> template1 }} | |
{{> template2 }} | |
{{> template3 }} |
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
cd /path/to/project/ | |
mrt install | |
meteor |
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
https://groups.google.com/forum/#!topic/meteor-talk/ku7kvNJp8ek | |
Now then, Morten, Alan, and I have been discussing Chrome Apps as a target compilation point for mobile apps. And Google recently announced that they're bringing Chrome Apps to Cordova (thanks Alan, for that heads up!). So, if you're looking for some really interesting possibilities, check out these links: | |
Run Chrome Apps on Mobile Using Apache Cordova/Phonegap | |
Google Brings Chrome Apps to Google Play and Apple App Stores | |
Chrome Apps on Mobile Toolchain | |
What Are Chrome Apps? | |
Create Your First Chrome App |
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
document.addEventListener('deviceready', function(){ | |
Session.set('deviceready', true); | |
}, false); |
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
Session.set("resize", null); | |
Meteor.startup(function () { | |
$(window).resize(function(evt) { | |
Session.set("resize", new Date()); | |
}); | |
}); | |
Template.homePage.resized = function(){ | |
var width = $(window).width(); | |
var height = $(window).height(); | |
NewerOlder