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
{"lastUpload":"2018-12-08T16:28:24.522Z","extensionVersion":"v3.2.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
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 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 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 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 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
Country,City,AccentCity,Region,Population,Latitude,Longitude | |
ad,aixas,Aixàs,06,,42.4833333,1.4666667 | |
ad,aixirivali,Aixirivali,06,,42.4666667,1.5 | |
ad,aixirivall,Aixirivall,06,,42.4666667,1.5 | |
ad,aixirvall,Aixirvall,06,,42.4666667,1.5 | |
ad,aixovall,Aixovall,06,,42.4666667,1.4833333 | |
ad,andorra,Andorra,07,,42.5,1.5166667 | |
ad,andorra la vella,Andorra la Vella,07,20430,42.5,1.5166667 | |
ad,andorra-vieille,Andorra-Vieille,07,,42.5,1.5166667 | |
ad,andorre,Andorre,07,,42.5,1.5166667 |
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
/*! Socket.IO.min.js build:0.9.16, production. Copyright(c) 2011 LearnBoost <[email protected]> MIT Licensed */ | |
var io="undefined"==typeof module?{}:module.exports;(function(){(function(a,b){var c=a;c.version="0.9.16",c.protocol=1,c.transports=[],c.j=[],c.sockets={},c.connect=function(a,d){var e=c.util.parseUri(a),f,g;b&&b.location&&(e.protocol=e.protocol||b.location.protocol.slice(0,-1),e.host=e.host||(b.document?b.document.domain:b.location.hostname),e.port=e.port||b.location.port),f=c.util.uniqueUri(e);var h={host:e.host,secure:"https"==e.protocol,port:e.port||("https"==e.protocol?443:80),query:e.query||""};c.util.merge(h,d);if(h["force new connection"]||!c.sockets[f])g=new c.Socket(h);return!h["force new connection"]&&g&&(c.sockets[f]=g),g=g||c.sockets[f],g.of(e.path.length>1?e.path:"")}})("object"==typeof module?module.exports:this.io={},this),function(a,b){var c=a.util={},d=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\. |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.
# Ensure system is in ship-shape.
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev
NewerOlder