Skip to content

Instantly share code, notes, and snippets.

@man0ni
man0ni / TimeTravel.php
Created May 29, 2019
RetourVersLeFutur_AideDoc&Marty
View TimeTravel.php
<?php
class TimeTravel
{
public $start;
public $end;
public function __construct()
{
$this->start = new DateTime("1985-12-31");
$this->end = new DateTime();
}
@man0ni
man0ni / TimeTravel.php
Created May 23, 2019
Retour vers le futur
View TimeTravel.php
<?php
class TimeTravel
{
public $start;
public $end;
public function __construct()
{
$this->start = new DateTime('1985-12-31');
$this->end = new DateTime();
@man0ni
man0ni / index.html
Created May 23, 2019
Bases de JavaScript 1 - Découverte du langage
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Q_Javascript</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="css/styles.css?v=1.0">
</head>
<body>
@man0ni
man0ni / regex.php
Created May 22, 2019
Regex : Les expressions régulières.
View regex.php
/A\./g
/[0-9]{2}\/[0-9]{2}\/[0-9]{4}/g
/\s[0-9]{1}\/[0-9]{2}/g
/[a-z]{14}/gi
/(https:\/\/|www\.)[\w\.?&=\/]+/gi
View quidditch2.sql
mysql> SELECT team.nom, COUNT(team.nom)
-> FROM `player`
-> JOIN `wizard` ON wizard.id=player.wizard_id
-> JOIN `team` ON team.id=player.team_id
-> GROUP BY team.nom
-> ORDER BY COUNT(team.nom) DESC;
+------------+-----------------+
| nom | COUNT(team.nom) |
+------------+-----------------+
| Gryffindor | 36 |
@man0ni
man0ni / quidditch.sql
Created Apr 12, 2019
SQL : Les jointures
View quidditch.sql
mysql> SELECT wizard.lastname, wizard.firstname, player.role, team.nom
-> FROM `player`
-> JOIN `wizard` ON wizard.id=player.wizard_id
-> JOIN `team` ON team.id=player.team_id
-> ORDER BY team.nom, player.role, wizard.lastname, wizard.firstname;
+-----------------+-------------+--------+------------+
| lastname | firstname | role | nom |
+-----------------+-------------+--------+------------+
| Black | Sirius | beater | Gryffindor |
| Brown | Lavender | beater | Gryffindor |
@man0ni
man0ni / wizarding_schools.sql
Created Apr 8, 2019
SQL manipulation des données
View wizarding_schools.sql
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)
@man0ni
man0ni / wizard_table.sql
Last active Mar 28, 2019
Récupération des sorciers.
View wizard_table.sql
mysql> SELECT * FROM wizard WHERE birthday BETWEEN "1975-01-01" AND "1985-01-01" AND is_muggle = 0;
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| id | firstname | lastname | birthday | birth_place | biography | is_muggle |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| 1 | harry | potter | 1980-07-31 | london | | 0 |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
| 6 | fred | weasley | 1978-04-01 | | | 0 |
| 7 | george | weasley | 1978-04-01 |
@man0ni
man0ni / index.php
Created Mar 27, 2019
Réaliser mes premières classes en PHP Orienté Objet, et ma première instance.
View index.php
<?php
const BR = "<br/>";
require_once 'person.php';
$gaston = new person("Lagaffe", "Gaston", "Belgique", "28/02/1957");
echo "Je m'appelle " . $gaston->getNom() . " " . $gaston->getPrenom() . ".";
echo BR;
echo "J'habite en " . $gaston->getAdresse() . ".";
echo BR;
echo "J'ai " . $gaston->setAnniv("28/02/1957") . " ans.";
echo BR;
@man0ni
man0ni / form.php
Last active Mar 26, 2019
Mon premier formulaire
View form.php
<!DOCTYPE doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<!-- Bootstrap CSS -->
<link crossorigin="anonymous" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" rel="stylesheet">
<title>
My first form - MH.
You can’t perform that action at this time.