Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
#!/bin/bash -x | |
# useradd -m digilord # Uncomment and change digilord to your username if you want to add a user for yourself | |
sudo apt-get install build-essential -y | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get update -y | |
sudo apt-get install nodejs -y | |
sudo apt-get install mongodb -y |
#!/bin/bash -x | |
# useradd -m digilord # Uncomment and change digilord to your username if you want to add a user for yourself | |
sudo apt-get install build-essential -y | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get update -y | |
sudo apt-get install nodejs -y | |
sudo apt-get install mongodb -y |
Template.foo.helpers({ | |
data1: function(){ | |
var array = []; | |
var storedData = Session.get("data"); | |
//underscore | |
_.each(Object.keys(storedData),function(key){ | |
array.push(storedData[key]); | |
}); | |
return array; | |
}, |
.factory('genericCollectionFactory',function(){ | |
function Collection() { | |
var _items = []; | |
function get () { | |
return _items; | |
} | |
function add (item) { |
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#428bca, 6.5%)", | |
"@brand-success": "#5cb85c", |
Meteor is great at sharing code between different builds for different platforms. You can use the same source for your browser builds, server builds, your builds for iOS, Android, ... But how to organize your project to be able to orchestrate your builds for different apps and services from the same source? This post elaborates on the reasons why you need these different builds and how you could accomplish this with Meteor easily.
Say you have an app with completely different end user experiences depending on their role. It is common practice to have the user logged in, check her authorization (role) and then setup different routes or load different templates to serve that type of user’s needs. While doing so, all types of users load the same build and the app decides what portions of the build to use and what not to use.
// #1 ES6: if passing one argument you don't need to include parenthesis around parameter. | |
var kitty = name => name; | |
// same as ES5: | |
var kitty = function(name) { | |
return name; | |
}; | |
// #2 ES6: no parameters example. | |
var add = () => 3 + 2; |
var defaults = { | |
number: 1, | |
bool: true, | |
magic: 'real', | |
animal: 'whale', | |
croutons: 'delicious' | |
}; | |
var options = { | |
number: 2, |
files: | |
"/tmp/proxy.conf": | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; |