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 getRandomNumber(min, max) { | |
return Math.floor(min + (Math.random() * max)); | |
} | |
function createArray(size) { | |
var array = []; | |
for (var i = 0; i < size; i++) { | |
array.push(getRandomNumber(1,100)); | |
} | |
return array; |
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 express = require('express'); | |
const app = express(); | |
app.get('/', function(req, res) { | |
res.send({hi: 'there'}); | |
}); | |
app.listen(1337, console.log('Server listening on http://localhost:1337')); |
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
<!doctype HTML> | |
<html> | |
<head> | |
<title>React Ecosystem</title> | |
</head> | |
<body> | |
<div id="react-root"></div> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
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
{ | |
"value":{ | |
"id":"b4ac7745e840", | |
"versionId":"5f51946f3d19", | |
"creatorId":"43d651f03342", | |
"creator":{ | |
"userId":"43d651f03342", | |
"name":"Ian Wilson", | |
"username":"ianwilson_2240", | |
"createdAt":1464557414338, |
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 React from ‘react’ | |
import { StyleSheet, Text, View } from ‘react-native’ | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>Open up App.js to start working on your app!</Text> | |
</View> | |
) | |
} |
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 React, { Component } from ‘react’ | |
import { View, Text } from ‘react-native’ | |
import { MapView } from ‘expo’ | |
const Marker = MapView.Marker | |
export default class Map extends Component { | |
renderMarkers() { | |
return this.props.places.map((place, i) => ( | |
<Marker key={i} title={place.name} coordinate={place.coords} /> |
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 React from ‘react’; | |
import { Text, SafeAreaView } from ‘react-native’; | |
import Map from ‘./app/components/Map’ | |
// A placeholder until we get our own location | |
const region = { | |
latitude: 37.321996988, | |
longitude: -122.0325472123455, | |
latitudeDelta: 0.0922, | |
longitudeDelta: 0.0421 |
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 { Location, Permissions } from 'expo' | |
const deltas = { | |
latitudeDelta: 0.0922, | |
longitudeDelta: 0.0421 | |
}; | |
export default App extends Component { | |
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
import axios from 'axios' | |
const YELP_API_KEY = '<YOUR_API_KEY>' | |
const api = axios.create({ | |
baseURL: 'https://api.yelp.com/v3', | |
headers: { | |
Authorization: `Bearer ${YELP_API_KEY}`, | |
}, | |
}) |
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 YelpService from './app/services/yelp' | |
export default App extends Component { | |
/* ... */ | |
getCoffeeShops = async () => { | |
const { latitude, longitude } = this.state.region; | |
const userLocation = { latitude, longitude }; |
OlderNewer