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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CodeConCat - Firebase Example</title> | |
<script src="https://cdn.firebase.com/js/client/2.4.2/firebase.js"></script> | |
<script src="https://code.jquery.com/jquery-2.2.3.min.js" integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=" crossorigin="anonymous"></script> | |
</head> | |
<body> | |
<textarea id="text-area" cols="100" rows="10"></textarea> |
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 mqtt = require('mqtt'); | |
// Connect to Broker | |
var client = mqtt.connect('mqtt://test.mosquitto.org'); | |
client.on('connect', function () { | |
client.subscribe('chatroom'); // Subcribre to a `chatroom` topic | |
client.publish('chatroom', 'Hello mqtt'); // Publish a message to `chatroom` topic | |
}); | |
client.on('message', function (topic, message) { |
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
getListFilms() | |
.then(getListGais) | |
.then(guiListFilmChoListGai) | |
.then(traVeKetQuaCuoiCungNe) | |
.catch(err){ | |
console.log('Chi phai xu li err 1 lan ne') | |
} | |
function getListFilms(){ | |
return new Promise(function(fulfill, reject) { |
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
request('http://getListFilms.com', function(err, listFilms) { | |
if (err) console.log('xu li loi di ne pa'); | |
request('http://getListGai.net', function(err, listGais) { | |
if (err) console.log('xu li loi nua di ne pa'); | |
request('http://guiListFilmChoListGai', function(err, listGaiOkDiXemFilmDeBanLuaChon){ | |
if (err) console.log('xu li cai nay nua la xong'); | |
if (listGaiOkDiXemFilmDeBanLuaChon.length == 0) { | |
// Nhu cai bui trau | |
} else { | |
return listGaiOkDiXemFilmDeBanLuaChon; |
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 listConcats = []; | |
request('http://100concat.com/getconcats', function(err, res, body){ | |
listConcats = JSON.parse(body); | |
}) | |
console.log(listConcats); // [] <== undefined |
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
// Check companyAccessToken | |
var jwtAuth = require('../../../libs/jwt-auth')(myApp); | |
router.all('/*' , jwtAuth.companyAuth); | |
// Company -> Product API | |
router.get ('/:companyId/products/:productId' , productApi.getProductDetail); | |
router.post ('/:companyId/products' , productApi.createProduct); | |
router.put ('/:companyId/products/:productId' , productApi.updateProduct); | |
router.delete('/:companyId/products/:productId' , productApi.deleteProduct); |
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
// Check companyAccessToken | |
var jwtAuth = require('../../../libs/jwt-auth')(myApp); | |
router.all('/*' , jwtAuth.companyAuth); | |
// Company -> Product API | |
router.get ('/:companyId/products/:productId' , productApi.getProductDetail); | |
router.post('/:companyId/products' , productApi.createProduct); | |
router.post('/:companyId/products/:productId/update' , productApi.updateProduct); | |
router.post('/:companyId/products/delete' , productApi.deleteProducts); |
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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>F19 to F19</name> | |
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix> | |
<identifier>private.f192f19_escape</identifier> | |
<autogen> | |
--KeyOverlaidModifier-- | |
KeyCode::F19, | |
KeyCode::COMMAND_L, |
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
// Company API | |
router.post('signUp', signUp) | |
router.get('confirmByEmail/:id', confirmByEmail) | |
router.post('signIn', signIn) | |
router.post('update', update) | |
router.post('getCompanyAccessToken', getCompanyAccessToken) | |
// Company -> Product API | |
router.post('getProductDetail', getProductDetail) | |
router.post('createProduct', createProduct) |