Skip to content

Instantly share code, notes, and snippets.

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Quote from "./Quote";
import Lamp from "./Lamp";
import Newlogo from "./Newlogo";
class App extends Component {
constructor(props) {
.App {
text-align: center;
}
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}
@bapHyv
bapHyv / index.js
Created March 20, 2019 10:55
Express 1 - Decouverte d'express
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (request, response) => {
response.send('Bienvenue sur Express');
});
app.get('/api/movies', (req, res) => {
res.send('Recuperation de tous les films')
});
@bapHyv
bapHyv / index.js
Created March 18, 2019 17:40
NodeJS - Créer un serveur HTTP
const http = require("http");
const port = 3000;
const requestHandler = (request, response) => {
let arrUrl = request.url.split("/");
console.log(arrUrl);
console.log("je suis request.url " + request.url);
if (request.url === "/") {
response.end("Bienvenue sur votre serveur !!");
} else if (request.url === "/contact") {
@bapHyv
bapHyv / cowsay.js
Created March 18, 2019 16:51
installation et utilisation d'un module
let cowsay = require("cowsay");
console.log(
cowsay.say({
text: "hello boy"
})
);
@bapHyv
bapHyv / app.js
Last active March 18, 2019 15:40
Decouverte de node JS quest
process.stdin.resume();
process.stdin.setEncoding("utf8");
console.log("What's your age ? ");
process.stdin.on("data", age => {
if (typeof Number(age) === "number" && age < 99 && age > 0) {
console.log("You were born in " + (2019 - Number(age)));
} else if (age < 0) {
console.log("Wrong format");
}
@bapHyv
bapHyv / bankCustomerPrivate.js
Last active March 18, 2019 08:26
POO part 2 quest
class BankCustomer {
constructor(name, privatePin) {
let customersName = name;
let customersPin = privatePin;
this.getName = () => customersName;
this.verifyPinInput = privatePin => {
if (privatePin == customersPin) {
return true;
@bapHyv
bapHyv / Person.js
Last active March 14, 2019 20:57
POO part 1 quest
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
tellMyName() {
return `I am ${this.name}`;
}
@bapHyv
bapHyv / index.html
Created March 13, 2019 08:28
Réalisation de la quête Javascripting
<!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>Document</title>
<script src="script.js"></script>
</head>
<body>
let myArr = ['Hannah', 'Guilhem', 'Louis', 'Laura', 'Amine', 'Baptiste', 'Cloé', 'Enzo', 'Fabien', 'Florian', 'Guillaume', 'Jean-Baptiste', 'Jean-Maxime', 'Jim', 'Jonathan', 'Kevin', 'Marlene', 'Nathalie', 'Nicolas', 'Nizar', 'Perrine', 'Sarah', 'Stephane Vivier', 'Stephane Jacot', 'Stephane Van Pe', 'Stephane Barucq', 'Sylène Manusset', 'Vanessa', 'Yann'];
let arrSuj = [];
let arrLen = myArr.length;
let compteur = 0;
let compteurGroupeDeQuatre = 1;
console.log('GROUPE 1');
console.log(' ');
function inputTopic() {