docker | docker-machine | docker-compose | docker swarm cheatsheet
Used to create VMs that run docker
docker-machine create -d virtualbox machinename
// Assuming the following directory structure | |
/* | |
app/ | |
.meteor/ | |
client/ | |
server/ | |
collections/ | |
*/ | |
// 1. Create a collection |
function getParameterByName(name, url) { | |
var a = document.createElement('a'); | |
a.href = url || location.href; | |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(a.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} |
Router.map(function () { | |
this.route('home', { | |
path: '/', | |
template: 'myTemplate' | |
}); | |
this.route('someroute', { | |
path: '/foo', | |
template: 'myTemplate' |
// A Promise is an object that represents a task with two possible outcomes (success or failure) and holds callbacks that fire | |
// when one outcome or the other has occurred. | |
// But the biggest advantage of using Promises is that you can easily derive new Promises from existing ones. | |
// You might ask two Promises representing parallel tasks to give you a Promise that will inform you of their mutual completion. | |
// Or you might ask a Promise representing the first task in a series to give you a Promise representing the final task in | |
// the series. | |
// Without Promises | |
$.get('/mydata', { |
<template name='configureYelp'> | |
<div class="container"> | |
<div class="section"> | |
<h1>Yelp API Access Configuration</h1> | |
<p class="lead">Do not change if you don't know what you are doing.</p> | |
<p>{{currentConfig}}</p> | |
{{> quickForm schema=configureYelp doc=this id='configureYelp' type='method' meteormethod='configureYelp' buttonClasses="btn btn-primary" buttonContent="Configure Yelp"}} | |
</div> | |
</div> | |
</template> |
<!-- Context should be the object you are tagging --> | |
<template name="tagInput"> | |
<select class='tag-input' name='tags[]' multiple="multiple"> | |
{{#each tags}} | |
<option value="{{this}}" selected="true">{{this}}</option> | |
{{/each}} | |
</select> | |
</template> |
Modal = function() { | |
if (! (this instanceof Modal)) { | |
return new Modal(options); | |
} | |
this.modalTemp = null; | |
this.clearTimeout = null; | |
this.inserted = false; | |
this.fixScrollPosition = true; | |
this._lastScrollTop = 0; |
# create a branch (ex. 'bug/checkout-error ' | |
# or 'feature/segment-analytics') | |
| |
git checkout -b feature/example | |
| |
# Do work, then commit your changes. | |
# To create a commit you first need to add the files | |
# you are going to commit. This is known | |
# as "staging the files". | |
# Check that the files changes are what you think. |
import pRequest from 'util/promiseRequest' | |
Object.resolve = function(path, obj) { | |
return path.split('.').reduce(function(prev, curr) { | |
return prev ? prev[curr] : undefined | |
}, obj) | |
} | |
export class RESTConnector { | |
constructor({ rootUrl, keyPath }) { |