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 / 3.chaines-carac-php.php
Created February 1, 2021 16:06
Small exercise to experiment different types of variables and their use for strings
<?php
$firstMessage = '0@sn9sirppa@#?ia\'jgtvryko1';
function decodeFirstMessage($string) {
$keyNumber = strlen($string) / 2;
$array = str_split($string);
$subString = implode(array_splice($array, 5, $keyNumber));
$speCarac = str_replace('@#?', ' ', $subString);
@clarade
clarade / shell1.txt
Created December 8, 2019 17:37
Testing basic commands on shell
[claradesp@Air-de-Clara-2] ~ $ pwd
/Users/claradesp
[claradesp@Air-de-Clara-2] ~ $ cd pictures/
[claradesp@Air-de-Clara-2] ~/pictures $ cd ..
[claradesp@Air-de-Clara-2] ~ $ pwd
/Users/claradesp
[claradesp@Air-de-Clara-2] ~ $ cd /bin
[claradesp@Air-de-Clara-2] /bin $ cd ../Users/claradesp
[claradesp@Air-de-Clara-2] ~ $ cd /usr/bin/
[claradesp@Air-de-Clara-2] /usr/bin $ ls
@clarade
clarade / requests.http
Last active December 8, 2019 16:09
Testing different methods about HTTP protocol
### GET application status without any filter
GET https://http-practice.herokuapp.com/wilders
### GET application status with page number and language filters
GET https://http-practice.herokuapp.com/wilders?page=4&language=Java
### POST wilder with url encoded method
POST https://http-practice.herokuapp.com/wilders
Content-Type: application/x-www-form-urlencoded
@clarade
clarade / server.js
Created December 6, 2019 15:06
Exercise about testing url and url.parse on Node.js
const http = require("http");
const url = require("url");
const port = 8001;
const requestHandler = (request, response) => {
console.log(request.url);
const parsedUrl = url.parse(request.url, true);
const parsedUrlQuery = parsedUrl.query;
console.log(parsedUrlQuery);
if (parsedUrlQuery.name && parsedUrlQuery.city) {
@clarade
clarade / express-quest-1.js
Created November 29, 2019 16:30
Testing req and res on Express
const express = require("express");
const app = express();
const port = 3000;
app.listen(port, err => {
if (err) {
throw new Error("Something bad happened...");
}
console.log(`Server is listening on ${port}`);
@clarade
clarade / UPDATE_DELETE.sql
Created November 20, 2019 11:06
Exercise about Update, Delete and Like features on mysql
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)
@clarade
clarade / SELECT.sql
Created November 20, 2019 09:51
Small exercise to learn different features on mysql
mysql> SELECT id, firstname, lastname, birthday, birth_place, biography, is_muggle
FROM wizard
WHERE birthday BETWEEN '1975-01-01' AND '1985-12-31';
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| id | firstname | lastname | birthday | birth_place | biography | is_muggle |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| 1 | harry | potter | 1980-07-31 | london | | 0 |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
@clarade
clarade / index.html
Created November 2, 2019 16:43
Small challenge about CSS responsive web design
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Find the precious!</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav>
<ul>
@clarade
clarade / favorite-movie.js
Created September 23, 2019 09:45
Working on js basics, adding some informations about our favorite movie
const movieTitle = 'Las Vegas Parano';
const realisedBy = 'Terry Gilliam';
const releaseDate = '1998';
alert('Mon film favori est ' + movieTitle + ', réalisé par ' + realisedBy + ' en ' + releaseDate +'!');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="A legendary Odyssey where you'll have to create your army, cloaking yourself with special friends,
goblins, orcs, dwarfs and wizards.">
<meta name="author" content="Clarade">
<title>Find the Precious</title>
</head>