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
// EXERCICE WILD CODE SCHOOL | |
function hello(name: string) { | |
console.log('Hello ' + name + ' !!'); | |
} | |
const surName: string = 'Bob'; | |
hello(surName); | |
hello(surName + ' Marley'); |
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
MYSQL : | |
As you can see, the email must to be unique. | |
DESCRIBE users; | |
+-----------+--------------+------+-----+---------+----------------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-----------+--------------+------+-----+---------+----------------+ | |
| id | int | NO | PRI | NULL | auto_increment | | |
| firstName | varchar(255) | NO | | NULL | | | |
| lastName | varchar(255) | NO | | NULL | | |
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(); | |
const connection = require('./db-config'); | |
const port = process.env.PORT || 3000; | |
connection.connect((err) => { | |
if (err) { | |
console.error('error connecting: ' + err.stack); | |
} else { | |
console.log( |
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
MySQL localhost:3306 ssl wild_db_quest SQL > select t.name team_name, count(*) as nb_player | |
-> from player p | |
-> join team t on t.id=p.team_id | |
-> group by team_name | |
-> order by nb_player; | |
+------------+-----------+ | |
| team_name | nb_player | | |
+------------+-----------+ | |
| Hufflepuff | 12 | | |
| Ravenclaw | 15 | |
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
app.get('/api/allmovies', (req, res) => { | |
let sql = 'SELECT * FROM movies'; | |
const sqlValues = []; | |
if (req.query.color) { | |
sql += ' WHERE color = ?'; | |
sqlValues.push(req.query.color); | |
} | |
if (req.query.max_duration) { | |
if (req.query.color) { | |
sql += ' AND duration < ?'; |
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
MySQL localhost:3306 ssl wild_db_quest SQL > select wizard.lastname, wizard.firstname, player.role, team.name | |
-> from player | |
-> join wizard on wizard.id=player.wizard_id | |
-> join team on team.id=player.team_id | |
-> order by team.name ASC, | |
-> player.role ASC, | |
-> wizard.lastname ASC, | |
-> wizard.firstname ASC; | |
+-----------------+-------------+--------+------------+ | |
| lastname | firstname | role | 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
const express = require('express'); | |
const app = express(); | |
const connection = require('./db-config'); | |
const port = process.env.PORT || 3000; | |
connection.connect((err) => { | |
if (err) { | |
console.error('error connecting: ' + err.stack); | |
} else { | |
console.log( |
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
mysql> INSERT INTO school (name, country, capacity) | |
-> VALUES ('Beauxbatons Academy of Magic', 'France', 550), | |
-> ('Castelobruxo', 'Brazil', 380), | |
-> ('Durmstrang Institute', 'Norway', 570), | |
-> ('Hogwarts School of Witchcraft and Wizardry', 'United Kingdom', 450), | |
-> ('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300), | |
-> ('Koldovstoretz', 'Russia', 125), | |
-> ('Mahoutokoro School of Magic', 'Japan', 800), | |
-> ('Uagadou School of Magic', 'Uganda', 350); | |
Query OK, 8 rows affected (0.01 sec) |
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 http = require('http'); | |
const port = 8000; | |
const url = require('url'); | |
const exampleUrl = '/?name=Ringo&city=Liverpool'; | |
const parsedUrl = url.parse(exampleUrl, true); | |
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
LES MONTAGES DE DOCUMENTS | |
dorch@DESKTOP-STLUBST MINGW64 / | |
$ mkdir Documents | |
dorch@DESKTOP-STLUBST MINGW64 / | |
$ ls | |
Documents/ cmd/ git-cmd.exe* tmp/ usr/ | |
LICENSE.txt dev/ mingw64/ unins000.dat | |
ReleaseNotes.html etc/ planets.zip unins000.exe* |
NewerOlder