This file contains hidden or 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
Steps: | |
0. Checkout your git repo from the server | |
1. Upload both of these files to the same directory on your server | |
2. chmod +x restart_node.sh | |
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log & | |
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/ | |
5. Make a commit to your repo | |
6. Point a browser at http://<your host>:8080/ and you should see the commit |
This file contains hidden or 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
//to use call getOrders.sum().then(function(sum){console.log(sum)}); | |
angular.service('getOrders',function ($http,$q) { | |
return { | |
sum: function () { | |
var d = $q.defer(); | |
//can add try method here | |
$http.get('/orders').success(function (data) { | |
//assuming data is just json array of orders. | |
var orders = data; | |
var sumOfOrders = 0; |
This file contains hidden or 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 x = ['10','10','10'].map(parseInt); | |
//x === [10,Nan,2] | |
/* | |
map returns a callback with 3 arugments | |
arg[0] = elem; | |
arg[1] = index; | |
parseint takes 2 arguments | |
arg[0] = string; |
This file contains hidden or 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 makeErrorHandler = function (msg) { | |
//msg is the string passed via the call | |
//the return anonyumous function is what is passed back to the callback of getData | |
return function (error) { | |
sendErrorToServer(error); | |
showMessage(msg); | |
}; | |
}; | |
getData(query, function (result) { |
This file contains hidden or 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
{"lastUpload":"2018-12-08T16:28:24.522Z","extensionVersion":"v3.2.2"} |
OlderNewer