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
| npm install cors | |
| // in app.js | |
| var cors = require('cors') | |
| app.use(cors()); |
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
| npm install xml2js | |
| var parseString = require('xml2js').parseString; | |
| var xml = "<root>Hello xml2js!</root>" | |
| parseString(xml, function (err, result) { | |
| console.dir(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
| $ npm install unirest | |
| var unirest = require('unirest'); | |
| var Request = unirest.get('http://httpbin.org/get'); | |
| Request.end(function(response){ | |
| console.log(response); | |
| }) |
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
| // download postgres loacally here | |
| // https://gist.github.com/50aaa1299db83dbef14c | |
| // click the blue elphant to star the server | |
| // you can see if its running in activity monitor | |
| // create table | |
| CREATE TABLE article ( | |
| article_id bigserial primary key, | |
| article_name varchar(20) NOT NULL, | |
| article_desc text NOT NULL, |
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
| // conneect to database | |
| heroku addons:add heroku-postgresql:dev | |
| // add dependcy to json | |
| "dependencies": { | |
| "pg": "2.x", | |
| "express": "~4.9.x", | |
| "cool-ascii-faces": "~1.3.x" | |
| } |
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
| git branch -m <newname> | |
| git branch -m <oldname> <newname> |
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
| git stash list | |
| git stash apply | |
| git stash apply --index | |
| git stash drop stash@{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
| browser.wait(function() { | |
| return ptor.isElementPresent(showInfoButton); | |
| }, 30000); | |
| expect(ptor.isElementPresent(showInfoButton)).toBeTruthy(); |
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 deferred = protractor.promise.defer(); | |
| var promise = deferred.promise; | |
| promise.then(function() { | |
| ... | |
| }); | |
| promise.then(function() { | |
| ... | |
| }).then(function() { |
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
| // conneect to database | |
| heroku addons:add heroku-postgresql:dev | |
| // add dependcy | |
| "dependencies": { | |
| "pg": "2.x", | |
| "express": "~4.9.x", | |
| "cool-ascii-faces": "~1.3.x" | |
| } |