Requirements:
- lodash (or underscore, you may need to change your _ functions to suit)
- Meteor email package
Meteor.startup(function () {
var sendEmail = _.bind(Email.send, Email);
# pull the official mongo docker container | |
docker pull mongo | |
# create network | |
docker network create my-mongo-cluster | |
# create mongos | |
docker run -d --net my-mongo-cluster -p 27017:27017 --name mongo1 mongo mongod --replSet my-mongo-set --port 27017 | |
docker run -d --net my-mongo-cluster -p 27018:27018 --name mongo2 mongo mongod --replSet my-mongo-set --port 27018 | |
docker run -d --net my-mongo-cluster -p 27019:27019 --name mongo3 mongo mongod --replSet my-mongo-set --port 27019 |
import React from 'react'; | |
import { pure, branch, renderComponent, compose } from 'recompose'; | |
import gql from 'graphql-tag'; | |
import { graphql } from 'react-apollo'; | |
import { Link } from 'react-router'; | |
// Define a very basic loading state component - you could make this | |
// a nice animation or something | |
const Loading = () => ( | |
<div>Loading</div> |
var uniqueArray = function(arrArg) { | |
return arrArg.filter(function(elem, pos,arr) { | |
return arr.indexOf(elem) == pos; | |
}); | |
}; | |
var uniqEs6 = (arrArg) => { | |
return arrArg.filter((elem, pos, arr) => { | |
return arr.indexOf(elem) == pos; | |
}); |
function replaceAt(string, index, replace) { | |
return string.substring(0, index) + replace + string.substring(index + 1); | |
} |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"