Skip to content

Instantly share code, notes, and snippets.

View sele-nap's full-sized avatar
🐱
n o p e

Séléna sele-nap

🐱
n o p e
View GitHub Profile
@sele-nap
sele-nap / movies.php
Created March 24, 2022 21:53
WCS quest // 4.2. Les tableaux multidimensionnels en PHP
<?php
$movies=[
'Les aventuriers de l\'Arche perdue' => ['Harrison Ford', 'Karen Allen', 'John Rhys-Davies'],
'Le temple maudit' => ['Harrison Ford', 'Kate Capshaw', 'Jonathan Ke Quan'],
'La dernière Croisade' => ['Harrison Ford', 'Sean Connery', 'Alison Doody']
];
foreach($movies as $movie => $actors){
echo "Dans le film $movie, les principaux acteurs sont:<br>";
@sele-nap
sele-nap / weapons.php
Created March 24, 2022 21:55
WCS quest // 5. Les conditions en PHP
<?php
$weapons = ['fists', 'whip', 'gun'];
$opponentWeapon = $weapons[rand(0,2)];
switch ($opponentWeapon) {
case 'fists' :
$indyWeapon = 'gun';
@sele-nap
sele-nap / animal.php
Created March 24, 2022 21:57
WCS quest // 6. Les fonctions avec PHP
<?php
function writeSecretSentence (string $animal ,string $object ) : string
{
return $secretSentence = "$animal s'incline face à $object";
}
echo writeSecretSentence ("le chat" , "la terre");
@sele-nap
sele-nap / debug.php
Last active March 24, 2022 22:22
WCS quest // 7. Debug toi même en PHP
<?php
$characters = [
"Negan" => [
"city" => "The Sanctuary",
"weapon" => "Lucille"
],
"Daryl" => [
"city" => "Alexandria",
"weapon" => "crossbow"
@sele-nap
sele-nap / Bicycle.php
Last active March 25, 2022 11:11
WCS quest // POO - Basics | Part 1: Faire ses premières classes
<?php
class Bicycle
{
private $color;
private $currentSpeed;
private $nbSeats = 1;
private $nbWheels = 2;
@sele-nap
sele-nap / data.js
Created March 29, 2022 13:27
WCS quest // Vue.js - welcome aboard
var db = {
dreamTeam: {
1: { name: 'Jerôme' },
2: { name: 'Mathieu' },
3: { name: 'Julien' },
4: { name: 'Etienne' }
},
columns: {
1: { title: 'todo', order: 1 },