// jQuery
$(document).ready(function() {
// code
})
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
class Counter extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { count: 0 } | |
} | |
render() { | |
return( | |
<div> | |
<h1>{this.state.count}</h1> |
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 calculate({operands = [1, 2], type = 'addition'} = {}) { | |
return operands.reduce((acc, val) => { | |
switch(type) { | |
case 'addition': | |
return acc + val | |
case 'subtraction': | |
return acc - val | |
case 'multiplication': | |
return acc * val | |
case 'division': |
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
import axios from 'axios' | |
let myData = [{id: 0}, {id: 1}, {id: 2}, {id: 3}] | |
async function fetchData(dataSet) { | |
const pokemonPromises = dataSet.map(entry => { | |
return axios.get(`https://ironhack-pokeapi.herokuapp.com/pokemon/${entry.id}`) | |
}) | |
const results = await Promise.all(pokemonPromises) |
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
import axios from 'axios' | |
let myData = [{id: 0}, {id: 1}, {id: 2}, {id: 3}] | |
async function fetchData(dataSet) { | |
for(entry of dataSet) { | |
const result = await axios.get(`https://ironhack-pokeapi.herokuapp.com/pokemon/${entry.id}`) | |
const newData = result.data | |
updateData(newData) | |
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 getData() { | |
const result = await axios.get('https://dube.io/service/ping') | |
const data = result.data | |
console.log('data', data) | |
return data | |
} | |
getData() |
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
#!/bin/sh | |
# Homebrew Script for OSX | |
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh` | |
echo "Installing brew..." | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
echo "Installing brew cask..." | |
brew tap homebrew/cask |