Skip to content

Instantly share code, notes, and snippets.

View stephanBerger's full-sized avatar
💭
I may be slow to respond.

sBerger stephanBerger

💭
I may be slow to respond.
  • CAF des Bouches-du-Rhône
  • Marseille
View GitHub Profile
@stephanBerger
stephanBerger / qcm.txt
Created January 28, 2020 21:49
2.2 [Basics] Injections SQL : prévenir
1B
2B
3B
4B
5B
6A
7B
8A
9C
@stephanBerger
stephanBerger / sqli.txt
Last active January 28, 2020 21:50
2.1 [Basics] Injections SQL : découvrir
Solution 1:
login : bob' or '1'='1
password: ' or' 1' =' 1
Solution 2:
login : bob' or '1'='1
password : OR "=
@stephanBerger
stephanBerger / Commit Formatting.md
Created November 30, 2019 20:44 — forked from brianclements/Commit Formatting.md
Angular Commit Format Reference Sheet

Git Commit Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the AngularJS change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

@stephanBerger
stephanBerger / challenge.txt
Last active October 28, 2019 10:24
06 - SQL Avancé
mysql> SELECT t.name,COUNT(*) as players FROM player p
JOIN team t
ON t.id=p.team_id
GROUP BY t.name;
+------------+---------+
| name | players |
+------------+---------+
| Gryffindor | 36 |
| Hufflepuff | 12 |
| Ravenclaw | 15 |
@stephanBerger
stephanBerger / decrypt.php
Created October 18, 2019 11:31
3. Les chaînes de caractères en PHP
<?php
function decrypt(string $chaine) : string {
$keyNumber = strlen($chaine)/2;
$sousChaine = substr($chaine,5,$keyNumber);
$resultat = str_replace('@#?',' ',$sousChaine);
return strrev($resultat);
}
@stephanBerger
stephanBerger / index.php
Created October 17, 2019 20:14
7. Debug toi même en PHP
<?php
$characters = [
"Negan" => [
"city" => "The Sanctuary",
"weapon" => "Lucille"
],
"Daryl" => [
"city" => "Alexandria",
"weapon" => "crossbow"
@stephanBerger
stephanBerger / index.php
Last active October 18, 2019 10:57
6. Les fonctions avec PHP
<?php
function writeSecretSentence(string $param1,string $param2) : string {
return $param1. " s'incline devant ". $param2 .".\n";
}
echo (writeSecretSentence("Le loup","la lune"));
@stephanBerger
stephanBerger / condition.php
Last active October 17, 2019 13:18
5. Les conditions en PHP
<?php
$weapons = ['fists', 'whip', 'gun'];
$opponentWeapon = $weapons[rand(0,2)]; // Cela permet de choisir une arme de manière aléatoire.
if ($opponentWeapon=='gun') {
$indyWeapon= $weapons[1];
} elseif ($opponentWeapon=='fists') {
$indyWeapon= $weapons[2];
} else {
@stephanBerger
stephanBerger / indiana4.php
Created October 17, 2019 09:02
4. Les tableaux && boucles en PHP
<?php
$indianaMovies = [
"Indiana Jones and the Kingdom of the Crystal Skul" => [
"Harrison Ford",
"Cate Blanchette",
"Karen Allen"],
"Indiana Jones and the Last Crusade" => [
"Harrison Ford",
"Sean Connery",
@stephanBerger
stephanBerger / indiana.php
Created October 16, 2019 19:42
Quête 2 php
<?php
$movieTitle = "Indiana Jones et la dernière croisade";
$isSeen = true;
$releaseYear = 1989;
$userRatings = 8.2;
echo $isSeen ? "j'ai vu le film: " . $movieTitle : "je n'ai pas vu le film: " . $movieTitle;
echo "\n";
echo "l'année de sortie du film est: ". $releaseYear . "\n";