Skip to content

Instantly share code, notes, and snippets.

View brendaMan's full-sized avatar
🎯
Focusing

Brenda brendaMan

🎯
Focusing
View GitHub Profile
@brendaMan
brendaMan / SignUp.js
Created July 8, 2019 09:22
Quest 010 - Homer-s-odyssey
import React, { Component } from 'react';
class SignUp extends Component {
constructor(props){
super(props);
this.state = {
mail: ""
};
this.handleChange = this.handleChange.bind(this);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Counter Redux</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.1/redux.min.js"></script>
</head>
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./conf');
const bodyParser = require('body-parser');
app.use(bodyParser.json());
//To support url-encoded bodies
app.use(bodyParser.urlencoded({
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./conf');
const bodyParser = require('body-parser');
app.use(bodyParser.json());
//To support url-encoded bodies
app.use(bodyParser.urlencoded({
@brendaMan
brendaMan / gist:eedede4ef672b392be490523911540b2
Created June 7, 2019 09:41
Express 3 - POST method and inserting data
const express = require('express');
const app = express();
const connection = require('./conf');
const bodyParser = require('body-parser');
const port = 3000;
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
@brendaMan
brendaMan / Index.js
Created June 5, 2019 09:43
Express 2 - Express, SQL - MySQL, Postman
const connection = require('./conf');
const express = require('express');
const app = express();
const port = 3000;
app.get('/api/movies', (req, res) => {
connection.query('SELECT * from movie', (err, results) => {
if (err) {
console.log(err)
res.status(500).send('Error lors de la récupération des movies');
const express = require('express');
const server = express();
const port = 3000;
// A route answering the url /api/movies which sends as information a string containing "All films"
server.get('/api/movies', function(req, res) {
res.end('All films');
});
update school set country='Sweden' where id=3;
+----+----------------------------------------------+----------+----------------+
| id | name | capacity | country |
+----+----------------------------------------------+----------+----------------+
| 1 | Beauxbatons Academy of Magic | 550 | France |
| 2 | Casteloburgo | 380 | Brazil |
| 3 | Durmstrang Institute | 570 | Sweden |
| 4 | Hogwarts School of Witchcraft and Wizardry | 450 | United Kingdom |
| 5 | Ilvermorny School of Witchcraft and Wizardry | 300 | USA |
@brendaMan
brendaMan / All the files of wizards...
Last active May 21, 2019 13:57
Sql - Retrieving info with SELECT 0
Select * from wizard where birthday between '1975-01-01' and '1985-31-12';
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');
INSERT INTO `wild_db_quest`.`wizard` (`firstname`, `lastname`, `birthday`, `birth_place`, `biography`, `is_muggle`) VALUES ('ginny', 'weasley', '1981-08-11', '', 'Sister of Ron and girlfriend of Harry', '0');
INSERT INTO `wild_db_quest`.`wizard` (`firstname`, `lastname`, `birthday`, `birth_place`, `biography`, `is_muggle`) VALUES ('fred', 'weasley', '1978-04-01', '', '', '0');
INSE
@brendaMan
brendaMan / CSS
Created April 8, 2019 08:42
The great eye of Sauron - Bootstrap
body{
background-color: whitesmoke;
}
.container{
max-width: 100vh;
max-height: 100vh;
}
.row{
margin: 0%;