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 Fetcher from "./Fetcher"; | |
const Table = ({ data }) => { | |
return ( | |
<table> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Poulation</th> |
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 Fetcher from "./Fetcher"; | |
const Table = props => { | |
return ( | |
<table> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Poulation</th> |
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 axios from "axios"; | |
class Fetcher extends React.Component { | |
state = { | |
fetching: false, | |
data: [] | |
}; | |
componentDidMount = () => { |
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 { BrowserRouter as Router, Route, Switch, Link } from "react-router-dom"; | |
import Countries from "./Countries"; | |
import Languages from "./Languages"; | |
const App = () => { | |
return ( | |
<div className="App"> | |
<Router> | |
<nav> |
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 NumberInput extends Component { | |
state = { | |
value: "" | |
}; | |
handleChange = e => { | |
this.setState({ value: e.target.value }); | |
}; | |
render() { |
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
require('json') | |
require_relative('./country_functions') | |
countries_file = File.read('countries.json') | |
countries = JSON.parse(countries_file) | |
##Name of first country -> Afghanistan | |
country_name = name_of_first_country( countries ) | |
puts "Name of first country -> #{ country_name }" |
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
[ | |
{ | |
"name": "Afghanistan", | |
"topLevelDomain": [ | |
".af" | |
], | |
"alpha2Code": "AF", | |
"alpha3Code": "AFG", | |
"callingCodes": [ | |
"93" |
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
country = { | |
"name"=> "Mauritius", | |
"capital"=> "Port Louis", | |
"altSpellings"=> [ | |
"MU", | |
"Republic of Mauritius", | |
"République de Maurice" | |
], | |
"relevance"=> "0", | |
"region"=> "Africa", |
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
# Shopping Basket Lab | |
- Items should have a name, price and boolean value that determines whether or not they are eligible for a buy one get one free discount. | |
- A shopping basket can have multiple items. | |
- It should be able to add and remove items. | |
Extensions: | |
- 10% discount for all shopping baskets over £20 | |
- If the customer has a valid discount card then they get an additional 5% off. |
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 'https://fonts.googleapis.com/css?family=Open+Sans'; | |
@import 'https://fonts.googleapis.com/css?family=Montserrat'; | |
body { | |
margin: 0; | |
font-family: 'Open Sans', sans-serif; | |
font-weight: 100; | |
} | |
h1 { |
NewerOlder