Skip to content

Instantly share code, notes, and snippets.

View clarade's full-sized avatar
:shipit:
Creatin some stuff

Clara Desp clarade

:shipit:
Creatin some stuff
View GitHub Profile
@clarade
clarade / screenshot-var_dump.txt
Last active March 12, 2021 10:30
Testing php code with XdBug
https://imgur.com/a/NzGAdyq
// var_dump result
@clarade
clarade / indyMessage.php
Created March 11, 2021 16:39
Php exercise about functions and string parameters
<?php
function writeSecretSentence(string $animal , string $naturalElement) :string
{
return "The $animal bends over the $naturalElement";
}
echo writeSecretSentence('squirrel', 'moon');
@clarade
clarade / function.php
Last active March 11, 2021 11:55
Small dojo about php basics (functions, arrays, and if statements)
<?php
/* numeric array compunded of strings, representing watchmen or
villains from the comics */
$watchmen = ['Dr. Manhattan', 'Ozymandias', 'Silk Spectre', 'Roschach', 'The comedian', 'Nite Owl'];
/* first function to define a message model using custom name in index.php function,
or can be replaced by default value "Dr Manhanttan" */
function sayHello(string $name = "Dr Manhattan") :string
{
@clarade
clarade / indyWeapons.php
Created March 10, 2021 21:46
Exercices about php's conditions
<?php
$weapons = ['fists', 'whip', 'gun'];
$opponentWeapon = $weapons[rand(0,2)];
$indyWeapon = $weapons[rand(0,2)];
if($opponentWeapon == 'gun')
{
$indyWeapon == 'whip';
@clarade
clarade / index.php
Created March 10, 2021 14:53
PHP-Dojo about PHP basics with Liudmylla, Clara & Daniela
<?php
for($i = 0; $i<10; $i++) {
echo $i;
}
echo PHP_EOL ."</br>";
for($i = 0; $i<11; $i++) {
echo $i;
}
@clarade
clarade / indiana-movies.php
Created March 9, 2021 22:49
Exercise about multidimensionnal arrays & loops
<?php
$moviesList = [
'Indiana Jones & the lost Ark' => ['Harrison Ford', 'Kate Capshaw', 'Jonathan Ke Quan'],
'Indiana Jones & the last crusade' => ['Harrison Ford', 'Sean Connery', 'Denholm Elliott'],
'Indiana Jones & the kindgom of the crystal skull' => ['Harrison Ford', 'Shia LaBeouf', 'Karen Allen'],
];
foreach($moviesList as $key => $value){
echo "Dans le film " . $key . " les acteurs sont : ";
@clarade
clarade / indiana-movies.php
Created March 8, 2021 17:30
Small exercise about php basics arrays / sortings / loops
<?php
$moviesList['Raiders Of the Lost Ark'] = 1981;
$moviesList['Indiana Jones and the Temple of Doom'] = 1984;
$moviesList['Indiana Jones and the Last Crusade'] = 1989;
asort($moviesList);
foreach($moviesList as $title => $date) {
echo " " . $date . " - " . $title;
@clarade
clarade / 2ndGitQuest.txt
Created March 4, 2021 21:08
Testing basic git commands with shell
History file deleted.
commit 8c3ff44484823c6a1e91211a45b4a77a2f097f07 (HEAD -> master)
Author: clarade <c*********@yahoo.fr>
Date: Thu Mar 4 22:06:16 2021 +0100
At Wild Code School, we code without shoes.
diff --git a/wild.html b/wild.html
new file mode 100644
index 0000000..e69de29
@clarade
clarade / planets.txt
Last active March 3, 2021 11:33
Testing more complex commands on shell with planets
 │  ~/w/planets find . ✔ │ 12:32:50 
.
./fictionnal
./fictionnal/arrakis.jpeg
./fictionnal/cybertron.jpeg
./fictionnal/coruscant.jpeg
./real
./real/ice_giants
./real/ice_giants/uranus.jpeg
./real/ice_giants/neptune.jpeg
@clarade
clarade / Shell2.txt
Created March 2, 2021 14:58
Testing basic unix commands in shell
 │  / pwd ✔ │ 15:54:41 
/
 │  / ls ✔ │ 15:54:43 
Applications bin net
Library cores private
Network dev sbin
System etc tmp
Users home usr
Volumes installer.failurerequests var
 │  / cd Users/claradesp/work ✔ │ 15:54:48 