Skip to content

Instantly share code, notes, and snippets.

View DominicGBauer's full-sized avatar

Dominic Gunther Bauer DominicGBauer

View GitHub Profile
@DominicGBauer
DominicGBauer / master.js
Last active January 15, 2019 14:35
Master
class Master {
tenThousandHours(sweat) {
this.sweat = sweat;
}
grind() {
console.log(this.sweat);
}
}
@DominicGBauer
DominicGBauer / newMaster.js
Last active January 16, 2019 12:38
newMaster
class Master {
tenThousandHours(sweat) {
this.sweat = sweat;
}
grind() {
console.log(this.sweat);
}
}
@DominicGBauer
DominicGBauer / error.js
Last active January 16, 2019 12:40
error
class Master {
tenThousandHours(sweat) {
this.sweat = sweat;
}
grind() {
console.log(this.sweat);
}
}
class Master {
tenThousandHours(sweat) {
this.sweat = sweat;
}
grind() {
console.log(this.sweat);
}
}
// Change this
grind() {
console.log(this.sweat);
};
// into this
grind = () => {
console.log(this.sweat);
};
class Master {
tenThousandHours(sweat) {
this.sweat = sweat;
}
grind = () => {
console.log(this.sweat);
}
}
// to the left of .grind is yoda so yoda is this
const grind = yoda.grind;
// grind is now an arrow function and therefore
// looks to the above to find out what this is
grind();
// Use the following line in your CLI to initilize
// a React app called Nasa
create-react-app Nasa
// Use the following line in your CLI
// Make sure you're in your app directory
// That would be Nasa for me
npm install axios
import axios from 'axios'
// Create a KEY variable for the NASA API key you received earlier
// Make sure it's in quotations
const KEY = 'YOUR KEY'
// Create a nasa variable that we will use to perform our API request
// Axios is going to create a url for us that conforms to NASA's
// specifications
let nasa = axios.create({