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
// Create a new Github Repo | |
on Github website click + | |
// clone the Github repo on your comp | |
git clone 'url_repo_from_github' | |
// Check remotes (references to repos that are not on my comp) | |
git remote -v | |
// if you don't have an origin remote, create one |
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 fetchCatAvatars(userId) { | |
return fetch(`https://catappapi.herokuapp.com/users/${userId}`) | |
.then(response => response.json()) | |
.then(user => { | |
const promises = user.cats.map(catId => | |
fetch(`https://catappapi.herokuapp.com/cats/${catId}`) | |
.then(response => response.json()) | |
.then(catData => catData.imageUrl)) | |
return Promise.all(promises) | |
}) |
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 fetchCatAvatars(userId) { | |
return fetch(`https://catappapi.herokuapp.com/users/${userId}`) | |
.then(response => response.json()) | |
.then(user => { | |
const promises = user.cats.map(catId => | |
fetch(`https://catappapi.herokuapp.com/cats/${catId}`) | |
.then(response => response.json()) | |
.then(catData => catData.imageUrl)) | |
return Promise.all(promises) | |
}) |
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 fetch = require("node-fetch"); | |
async function showGitHubUser(handle) { // add async keyword | |
const url = `https://api.github.com/users/${handle}`; | |
const response = await fetch(url); // await takes in a promise and pauses the execution until the promise is settled | |
const user = await response.json(); // wait for the json response as well | |
console.log(user.name); | |
console.log(user.location); | |
} |
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
// MUTATIONS - Vuex mutations are essentially events: each mutation has a name and a handler - Mutations mutate the state | |
- is the only way to modify state | |
- doesn't care about business logic, it just care about "state" | |
const store = new Vuex.Store({ | |
state: { | |
count: 1 | |
}, | |
mutations: { | |
INCREMENT (state) { |
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
// Mutations- the only way to MODIFY stATE - doesn't care about business logic, it just care about "state" | |
// are essentially events: each mutation has a name and a handler. | |
const store = new Vuex.Store({ | |
state: { | |
count: 1 | |
}, | |
mutations: { | |
INCREMENT (state) { | |
// mutate state |
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
// NOTE:install node package from nodejs website. After instalation follow the instructions from this gihub page: | |
https://github.com/nodejs/help/wiki/Installation | |
Instructions step by step: | |
1. | |
Install node and then follow the instructions from point 1 in terminal | |
2. | |
// to go to .profile: |
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
// initiate a React Native App | |
react-native init ReactNativeReduxApp | |
// go to your app folder | |
cd ReactNativeReduxApp | |
// run the ios simulator | |
react-native run-ios | |
// add dependencies |
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
// initiate git (local new repo) | |
git init | |
// save all the files in your new local repo | |
git add . | |
// commit them | |
git commit -m "First commit" | |
// connect git with github repo |
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
// UPDATING NEW VERSION (from github) | |
// Clone the version from github | |
git clone (paste copied url) | |
// Add dependencies | |
cd (your_project) | |
yarn | |
// deploying a new version |
NewerOlder