This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = { | |
dreamTeam: { | |
1: { name: 'Jerôme' }, | |
2: { name: 'Mathieu' }, | |
3: { name: 'Julien' }, | |
4: { name: 'Etienne' } | |
}, | |
columns: { | |
1: { title: 'todo', order: 1 }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Bicycle | |
{ | |
private $color; | |
private $currentSpeed; | |
private $nbSeats = 1; | |
private $nbWheels = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$characters = [ | |
"Negan" => [ | |
"city" => "The Sanctuary", | |
"weapon" => "Lucille" | |
], | |
"Daryl" => [ | |
"city" => "Alexandria", | |
"weapon" => "crossbow" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function writeSecretSentence (string $animal ,string $object ) : string | |
{ | |
return $secretSentence = "$animal s'incline face à $object"; | |
} | |
echo writeSecretSentence ("le chat" , "la terre"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$weapons = ['fists', 'whip', 'gun']; | |
$opponentWeapon = $weapons[rand(0,2)]; | |
switch ($opponentWeapon) { | |
case 'fists' : | |
$indyWeapon = 'gun'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$movies['Indiana Jones et les Aventuriers de l\'arche perdue'] = 1981 ; | |
$movies['Indiana jones et le Temple maudit'] = 1984; | |
$movies['Indiana Jones et la Dernière Croisade'] = 1989; | |
asort($movies); | |
foreach($movies as $movie => $year){ | |
echo "$year - $movie <br>"; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$text1 = "0@sn9sirppa@#?ia'jgtvryko1"; | |
$text2 = "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj"; | |
$text3 = "aopi?sgnirts@#?sedhtg+p9l!"; | |
$keyNumber = strlen($text1)/2; | |
$subChain = substr($text1, 5,$keyNumber); | |
$secretMessage = str_replace('@#?', ' ', $subChain); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$nameMovie = "Indiana Jones et la dernière croisade"; | |
echo $nameMovie; | |
$seenMovie = false; | |
echo $seenMovie; | |
$dateMovie = 1989; | |
echo $dateMovie; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface User { | |
name: string; | |
age: number; | |
birthday?: string; | |
} | |
const prettyPrintWilder = (users: User[]): void => { | |
users.map((user) => { | |
console.log(`${user.name} is ${user.age} years old`); | |
}); |
NewerOlder