Skip to content

Instantly share code, notes, and snippets.

View timestep's full-sized avatar
:shipit:
I may be slow to respond.

Kevin timestep

:shipit:
I may be slow to respond.
View GitHub Profile
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
//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;
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;
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) {
@timestep
timestep / iterm2-solarized.md
Created July 6, 2017 17:35 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@timestep
timestep / cloudSettings
Last active December 8, 2018 16:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-12-08T16:28:24.522Z","extensionVersion":"v3.2.2"}