title | subtitle | author | date | source |
---|---|---|---|---|
Docker Compose Cheatsheet |
Quick reference for Docker Compose commands and config files |
Jon LaBelle |
April 7, 2019 |
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
let x = 1 | |
var y = 1 | |
console.log("\nInitial Values") | |
console.log("x: ", x) | |
console.log("y: ", y) | |
/* OUTPUT: | |
* x: 2 | |
* y: 2 | |
*/ |
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
App.findById(id, (err, app) => { | |
Object.assign(app.config, req.body) // Aca mutamos el objeto app original. | |
app.save(err => { | |
if(err) return res.status(500) | |
if(!app) => return res.status(404) | |
res.status(200).send(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
function addWhiteSpaceAtTheEnd(str, len) { | |
if(str.length >= len) return str; | |
var delta = len - str.length; | |
var res = str; | |
for(var i = 0 ; i < delta ; i++) { | |
res = res + " "; | |
} | |
return res; | |
} |
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
var request = require('request'); | |
var URL = 'https://jsonplaceholder.typicode.com/posts/'; | |
var requestHandler = function(err, res, body) { | |
if(err) { | |
// aca controlas el error. | |
console.log('ERROR:' + err); | |
return; |
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
var myController = { | |
root: function(req, res) { | |
if(req.session().algo) { | |
res.view('index', { | |
foo: 'bar' | |
}); | |
} | |
else { | |
res.view('login') | |
} |