Skip to content

Instantly share code, notes, and snippets.

View pierrealexaline's full-sized avatar

Pierre Alexaline pierrealexaline

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<title>FindThePrecious</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
@pierrealexaline
pierrealexaline / indiana_jones.php
Last active October 9, 2018 07:42
exercice php variables
<?php
// This is my way !
$nameFilm = "Indiana Jones et la dernière croisade";
$viewFilm = true;
$dateFilm = 1989;
$noteFilm = 8.3;
$o = "<p>\n";
$o .= "Titre du film : " . $nameFilm . "\n";
$o .= "Date de sortie : " . $dateFilm . "\n";
@pierrealexaline
pierrealexaline / regex.php
Last active October 8, 2018 23:03
Regex - expressions régulières exercices
<?php
$string = "
Thomas A. Anderson (Keanu Reeves), un jeune informaticien connu dans le monde du hacking sous le pseudonyme de Neo, est contacté via son ordinateur par ce qu’il pense être un groupe de hackers. Ils lui font découvrir que le monde dans lequel il vit n’est qu’un monde virtuel, la matrice, dans lequel les êtres humains sont gardés sous contrôle.
Morpheus (Laurence Fishburne), le capitaine du Nebuchadnezzar, contacte Néo et pense que celui-ci est l’Élu qui peut libérer les êtres humains du joug des machines et prendre le contrôle de la matrice
";
$patern = "#(^[A-Z]+\.)#";
if(preg_match($patern,$string,$match)!==false) {print_r($match);}
@pierrealexaline
pierrealexaline / string.php
Created October 11, 2018 15:06
travail sur les chaînes en php
<?php
$chaines[0] = "0@sn9sirppa@#?ia'jgtvryko1";
$chaines[1] = "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj";
$chaines[2] = "aopi?sgnirts@#?sedhtg+p9l!";
foreach ($chaines as $key=>$value)
{
$longuerChaine = strlen($value)/2;
$sousChaines = substr($value, 5,$longuerChaine);
@pierrealexaline
pierrealexaline / index.html
Created October 12, 2018 15:48
page index findthe precious
<!DOCTYPE html>
<html lang="en">
<head>
<title>FindThePrecious</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
@pierrealexaline
pierrealexaline / index.html
Created October 14, 2018 23:36
Exercice - css
<!DOCTYPE html>
<html lang="en">
<head>
<title>FindThePrecious</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="style.css">
@pierrealexaline
pierrealexaline / index.html
Last active October 15, 2018 11:32
Exercice 1 bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<title>FindThePrecious</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
@pierrealexaline
pierrealexaline / array.php
Last active October 15, 2018 12:39
exercice php array 1
<?php
$indiana_films[] = array( 'Raiders of the Lost Ark2','Harrison Ford','Karen Allen','Paul Freeman');
$indiana_films[] = array( 'Indiana Jones and the Temple of Doom','Harrison Ford','Kate Capshaw','Amrish Puri');
$indiana_films[] = array( 'Indiana Jones and the Last Crusade','Harrison Ford','Sean Connery','Denholm Elliott');
//print_r( $array['indiana'] );
$o = '';
@pierrealexaline
pierrealexaline / conditions.php
Created October 15, 2018 13:03
Php conditions 1
<?php
$weapons = ['fists', 'whip', 'gun'];
$opponentWeapon = $weapons[rand(0,2)]; // Cela permet de choisir une arme de manière aléatoire.
if($opponentWeapon == 0){ $indyWeapon = 2; }
elseif($opponentWeapon == 1){ $indyWeapon = 0; }
elseif($opponentWeapon == 2){ $indyWeapon = 1; }
@pierrealexaline
pierrealexaline / functions.php
Created October 15, 2018 15:29
Php functions 1
<?php
function writeSecretSentence( string $para1 = "", string $para2 = "" ):string
{
$retour = $para1." s'incline face à ".$para2."<br>\n";
return $retour;
}
$environnement = array('lune','terre','univers','galaxy');
$animaux = array('lion','tigre','panthère');