Skip to content

Instantly share code, notes, and snippets.

# 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
// $("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() {
@stephentcannon
stephentcannon / meteorcountries
Created October 23, 2014 22:22
meteor Countries
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: "",
@stephentcannon
stephentcannon / meteor-nginx.conf
Created March 8, 2014 02:44
Meteor nginx conf
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;
@stephentcannon
stephentcannon / gist:9042903
Created February 17, 2014 00:55
meteor content router
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];
@stephentcannon
stephentcannon / gist:9042875
Created February 17, 2014 00:52
a meteor pattern for a generic event handler
<body>
{{> eventhandler}}
</body>
<template name="eventhandler">
{{> template1 }}
{{> template2 }}
{{> template3 }}
cd /path/to/project/
mrt install
meteor
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
@stephentcannon
stephentcannon / gist:8982954
Created February 13, 2014 20:14
Cordova Phonegap Deviceready
document.addEventListener('deviceready', function(){
Session.set('deviceready', true);
}, false);
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();