Skip to content

Instantly share code, notes, and snippets.

View DSARRAZY's full-sized avatar
🏠
Working from home

DSARRAZY DSARRAZY

🏠
Working from home
View GitHub Profile
@DSARRAZY
DSARRAZY / Wizarding schools
Created March 22, 2020 14:40
03 - Manipulation des données
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)
@DSARRAZY
DSARRAZY / Récupération des sorciers
Last active March 21, 2020 15:53
02 - Récupérer des informations avec SELECT
Le prénom, nom et date de naissance du plus vieux sorcier (doit fonctionner quelque soit le contenu de la table) :
mysql> select firstname, lastname, birthday from wizard order by birthday asc limit 1;
+-----------+------------+------------+
| firstname | lastname | birthday |
+-----------+------------+------------+
| albus | dumbledore | 1881-07-01 |
+-----------+------------+------------+
1 row in set (0.00 sec)
@DSARRAZY
DSARRAZY / Enquête à Terminal City
Created March 17, 2020 17:47
Introduction à Unix
1 cd Dev
8 cat crimescene
16 grep CLUE crimescene
19 grep Annabel people
38 cd interviews
39 grep Annabel Sun
40 grep Annabel
41 ls
42 cat interview-5782759
44 grep New Zealand *
@DSARRAZY
DSARRAZY / bonjour.sh
Last active April 12, 2020 13:08
Introduction au Shell
#!/bin/bash
if [ $1 ]
then
echo " Bonjour $1"
else
echo "Bonjour" $USER
fi
@DSARRAZY
DSARRAZY / Montre-nous ton plus beau débug
Last active March 16, 2020 14:54
7. Debug toi même en PHP
<?php
$characters = [
"Negan" => [
"city" => "The Sanctuary",
"weapon" => "Lucille"
],
"Daryl" => [
"city" => "Alexandria",
"weapon" => "crossbow"
@DSARRAZY
DSARRAZY / Poings, fouet, pistolet
Last active March 17, 2020 13:37
5. Les conditions en PHP
<?php
$weapons = ['fists', 'whip', 'gun'];
$opponentWeapon = $weapons[rand(0,2)];
echo "Arme de l'adversaire : $opponentWeapon.</br>";
switch ($opponentWeapon) {
case 'whip':
$indyWeapon='fists';
@DSARRAZY
DSARRAZY / 4. Les tableaux && boucles en PHP
Last active March 17, 2020 12:36
4. Les tableaux && boucles en PHP
<?php
$indianaMovies = array(
'Indiana Jones et le Royaume du Crâne de Cristal' => array('Harrison Ford','Cate Blanchett','Karen Allen'),
'Indiana Jones et la Dernière Croisade' => array('Harrison Ford','Sean Connery','Denholm Elliott'),
'Indiana Jones et le Temple maudit' => array('Harrison Ford','Kate Capshaw','Jonathan Ke Quan'));
foreach ($indianaMovies as $key => $value)
{
echo '~~~' . '<br/>';
<?php
$message1="0@sn9sirppa@#?ia'jgtvryko1" ;
$message2="q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj";
$message3="aopi?sgnirts@#?sedhtg+p9l!";
$chiffreCle1 = strlen($message1)/2;
$sousChaine1 = substr($message1, 5,$chiffreCle1);
$message1 = str_replace("@#?",' ',$sousChaine1);
echo strrev($message1),' ';
<?php
$nameFilm="Indiana Jones and the Last Crusade" ;
$haveSeen=true;
$releaseYear="1989";
$scoringImdb="8.2";
echo $nameFilm ."<br/>\n";
if($haveSeen){
echo "oui" ."<br/>\n";
}
****HMTL****
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Hello Wilder</title>
</head>
<body>
<script src="hello-wilder.js"></script>