Skip to content

Instantly share code, notes, and snippets.

View cba85's full-sized avatar
🌊

Clément Barbaza cba85

🌊
View GitHub Profile
@cba85
cba85 / array.php
Created March 15, 2021 06:43
PHP array (For demonstration purpose only)
<?php
// For demonstration purpose only
// Arrays
$names = ['clement', 'tomy', 'jacques'];
print_r($names);
echo $names[0];
$people = [
@cba85
cba85 / passwordHashing.php
Created October 19, 2022 15:43
Password hashing in PHP (For demonstration purpose only)
<?php
// For demonstration purpose only
// Tester de trouver les mots de passe sur https://crackstation.net
$password = 'webstart';
// MD5
echo md5($password);
@cba85
cba85 / datetime.php
Created October 19, 2022 15:46
Datetime in PHP (For demonstration purpose only)
<?php
// For demonstration purpose only
// Datetime
// http://php.net/manual/en/class.datetime.php
$date = new Datetime;
// 1. Date object
@cba85
cba85 / curl.php
Created October 19, 2022 15:49
PHP Curl (For demonstration purpose only)
<?php
// For demonstration purpose only
// API using CURL
// Get
$ch = curl_init();
@cba85
cba85 / node-jawsdb-mariadb.js
Created January 24, 2023 10:24
Connect MariaDB or JawsDB MariaDB with Heroku and MariaDB node connector
// https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/connection-options.md
require("dotenv").config();
const mariadb = require("mariadb");
(async () => {
let conn;
if (process.env.APP_ENV == "heroku") {
conn = await mariadb.createConnection(
@cba85
cba85 / app.js
Created October 26, 2023 06:59
IPI Toulouse - TSTN2 Dev - 2023/2024 - Exercice TD
function load() {
document.querySelector(".message").textContent =
"Le texte est chargé c'est bon";
//document.querySelector(".loading").style.display = "none";
document.querySelector(".loading").remove();
document.querySelector("h1").style.backgroundColor = "yellow";
const text = document.querySelector("h1").textContent;
console.log(text);
/*
@cba85
cba85 / app.js
Created October 26, 2023 07:02
IPI Toulouse - TSTN2A Dev - 2023/2024 - Todolist
function addTaskInDom(task) {
const taskElement = document.createElement("div");
const taskCheckbox = document.createElement("input");
taskCheckbox.type = "checkbox";
const id = `checkbox-${task.id}`; // const id = "checkbox-" + task.id;
taskCheckbox.id = id;
const taskLabelElement = document.createElement("label");
taskLabelElement.textContent = task.text;
@cba85
cba85 / app.js
Created October 26, 2023 09:53
IPI Toulouse - TSTN2 - 2023/2024 - Liste de recettes
let recipes = [];
const form = document.querySelector("form");
form.addEventListener("submit", function (e) {
e.preventDefault();
if (
!form.name.value ||
form.time.value < 1 ||
@cba85
cba85 / index.html
Created November 9, 2023 12:09
IPI Toulouse 2023-2024 - IJVS010
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
<script src="scripts.js" defer></script>
</head>
<body>
@cba85
cba85 / app.js
Created November 16, 2023 14:44
Fetch / XmlHttpRequest example
document.querySelector("form").addEventListener("submit", async (e) => {
e.preventDefault();
document.querySelector(".loading").style.display = "block";
const results = document.querySelector("#results");
results.innerHTML = "";
let response;