This file contains hidden or 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'; | |
class SignUp extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state= { | |
email: "" | |
}; | |
this.handleChange = this.handleChange.bind(this); |
This file contains hidden or 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
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Counter Redux</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Redux CDN --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.1/redux.min.js"></script> | |
</head> |
This file contains hidden or 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 mysql = require('mysql'); | |
var express = require('express'); | |
const connection = mysql.createConnection({ | |
host : 'localhost', // address of the server | |
user : 'blablabla', // username | |
password : 'blablabla', | |
database : 'express_2', | |
}); | |
const app = express(); | |
const port = 3000 |
This file contains hidden or 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 DB from the following script: | |
https://gist.github.com/sblondeau/5cdc304b160960bb20c1cd0ba314cf3e | |
Once the tables are created, write the queries to display: | |
1. The first name, name and age of the characters | |
mysql> SELECT firstname, lastname, age FROM Person; | |
2. The first name, name of the characters and their kingdom, only for those connected to a kingdom | |
mysql> SELECT ch.firstname, ch.lastname, ki.name |
This file contains hidden or 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
## Wizardry schools | |
Insert in the school table the following data... | |
mysql> INSERT INTO school (name, country, capacity) VALUES | |
-> ('Beauxbatons Academy of Magic', 'France', 550), | |
-> ('Castelobruxo', 'France', 380), | |
-> ('Durmstrang Institute', 'Norway', 570), | |
-> ('Hogwarts School of Witchcraft and Wizardry', 'United Kindom', 450), | |
-> ('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300), | |
-> ('Koldovstoretz', 'Russia', 125), |
This file contains hidden or 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(); | |
const port = 3000; | |
//Quest- You will create some GET routes on your server: | |
//1.1 A route answering the url /api/movies which | |
//sends as information a string containing "All films" | |
app.get(`/api/movies`, (req, res) => { |
This file contains hidden or 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
Retrieving wizards Challenge from https://images.innoveduc.fr/bdd/data2.sql | |
Retrieve all the fields for wizards born between 1975 and 1985... | |
mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-12-31'; | |
INSERT INTO `wild_db_quest`.`wizard` (`firstname`, `lastname`, `birthday`, `birth_place`, `biography`, `is_muggle`) VALUES | |
('harry', 'potter', '1980-07-31', 'london', '', '0'); | |
INSERT INTO `wild_db_quest`.`wizard` (`firstname`, `lastname`, `birthday`, `birth_place`, `biography`, `is_muggle`) VALUES | |
('hermione', 'granger', '1979-09-19', '', 'Friend of Harry Potter', '0'); | |
INSERT INTO `wild_db_quest`.`wizard` (`firstname`, `lastname`, `birthday`, `birth_place`, `biography`, `is_muggle`) VALUES | |
('ron', 'weasley', '1980-03-01', '', 'Best friend of Harry', '0'); |
This file contains hidden or 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
process.stdin.resume() | |
process.stdin.setEncoding('utf8') | |
console.log('Computer: How old are you? ') | |
process.stdout.write('Me: '); | |
process.stdin.on('data', (age) => { | |
console.log('Computer: Tienes ' + age.trim()+ ' años.'); | |
if (!Number(age)){ | |
console.log('¿eh?') | |
} else if (age > 99) { |