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
Hey, folks. Below, the steps that I followed (after a little search on the web) to deploy my application | |
(website) using GIT, on the cleanest and easiest way. The advantage of this method is that any small | |
change pushed to remote repo will be published in your live website. | |
Step 1: Create the local GIT repository | |
$ cd /var/www/project/ | |
$ git init | |
$ git add * |
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
/* A little snippet to see how to integrate another ajax request data with Google Chart API using JQuery */ | |
var = DOM { | |
/** | |
* Function that initialize all | |
* @return {[void]} | |
*/ | |
onReady: function() { | |
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
async function myAsyncFunction() { | |
const result = await somethingThatReturnsAPromise(); | |
console.log(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
async function myAsyncFunction() { | |
try { | |
const result = await somethingThatReturnsAPromise(); | |
console.log(result); | |
} catch (error) { | |
console.log(error); | |
} | |
} |
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
function makeRequest() { | |
return fetch('foo') | |
.then(response => { | |
if (data.doesItNeedAnotherRequest) { | |
return makeAnotherRequest(response) | |
.then(secondResponse => { | |
console.log(secondResponse); | |
return secondResponse; | |
}); |
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
async function makeRequest() { | |
const response = await fetch('foo'); | |
if (response.doestItNeedAnotherRequest) { | |
const secondResponse = await makeAnotherRequest(response); | |
console.log(secondResponse); | |
return secondResponse; | |
} | |
console.log(response); | |
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
let promise = Promise.resolve(); | |
const posts = [{}, {}, {}]; | |
posts.forEach(post => { | |
promise = promise.then(() => { | |
return db.insert(post); | |
}); | |
}); | |
promise.then(() => { |
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
posts.forEach(post => { | |
promise = promise.then(db.insert(post)); | |
}); |
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
const posts = [{}, {}, {}]; | |
async function insertPosts(posts) { | |
for (let post of posts) { | |
await db.insert(post); | |
} | |
} |
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
const posts = [{}, {}, {}]; | |
async function insertPosts(posts) { | |
posts.forEach(post => { | |
await db.insert(post); | |
}); | |
} |
OlderNewer