Skip to content

Instantly share code, notes, and snippets.

View cba85's full-sized avatar
🌊

ClΓ©ment Barbaza cba85

🌊
View GitHub Profile
@cba85
cba85 / app.js
Created November 18, 2023 16:35
Jours fΓ©riΓ©s API - IPI Toulouse IJVS020
(async () => {
const response = await fetch(
"https://calendrier.api.gouv.fr/jours-feries/metropole/2025.json"
);
const data = await response.json();
for (const day in data) {
const date = new Date(day);
console.log(
date.toLocaleDateString("fr-FR", {
@cba85
cba85 / app.js
Created November 23, 2023 10:56
Application MΓ©tΓ©o - IPI Toulouse TSTN2A 2023-2024
// https://openweathermap.org/
const apiKey = ""; // Insert your OpenWeatherMap API Key
const form = document.querySelector("form");
function displayErrorMessage(message) {
document.querySelector("article").style.display = "none";
const notice = document.querySelector(".notice");
notice.textContent = message;
notice.style.display = "block";
@cba85
cba85 / snippet.css
Last active November 29, 2023 13:41
Obsidian css snippet
h1 {
margin-bottom: 1em !important;
font-size: 2em !important;
}
h2 {
padding-bottom: 0.5em;
border-bottom: 1px solid #999;
margin: 1em 0 !important;
}
@cba85
cba85 / app.js
Created November 30, 2023 12:14
TV Maze JS - TSTN2A IPI Toulouse 2023-2024
const form = document.querySelector("form");
form.addEventListener("submit", async (e) => {
e.preventDefault();
document.querySelector("#results").textContent = "";
const q = form.q.value;
if (!q) {
@cba85
cba85 / app.js
Created December 3, 2023 11:00
Vue 3 Todolist - IPI Toulouse CDAN SOPRA 2023-2024
const options = {
data() {
return {
taskInput: "",
tasks: [],
error: false,
};
},
methods: {
addTask() {
@cba85
cba85 / app.js
Created December 14, 2023 14:43
jQuery Jikan - IPI Toulouse TSTN2A 2023/2024
function convertDateInFrench(datetime) {
if (!datetime) {
return "-";
}
const date = new Date(datetime);
return date.toLocaleDateString("fr-FR", {
year: "numeric",
month: "long",
day: "numeric",
@cba85
cba85 / api.json
Created December 21, 2023 18:05
IPI Toulouse 2023-2024 - Fruity
[
{
"name": "Persimmon",
"id": 52,
"family": "Ebenaceae",
"order": "Rosales",
"genus": "Diospyros",
"nutritions": {
"calories": 81,
"fat": 0.0,
@cba85
cba85 / app.js
Created December 27, 2023 16:51
Vue 3 TV Maze (no components) - IPI Toulouse - CDAN SOPRA
Vue.createApp({
data() {
return {
q: "",
error: "",
shows: [],
};
},
methods: {
async search() {
@cba85
cba85 / index.html
Created December 27, 2023 16:53
Vue 3 TV Maze (with components) - IPI Toulouse - CDAN SOPRA
let Search = {
data() {
return {
q: "",
};
},
methods: {
async search() {
if (!this.q) {
this.$emit("updateError", "Veuillez entrer une sΓ©rie");
@cba85
cba85 / app.js
Created January 11, 2024 12:49
jQuery Giphy - IPI Toulouse TSTN2A 2023-2024
const apiKey = "7DM9xWMcFqBNGWzapWk6d7e5FdsBkwe9";
const limit = 10;
// Get results (gifs, stickers) from Giphy API
function getGiphyResults(url) {
$.get(url)
.done((response) => {
$.each(response.data, (index, value) => {
$(
`<img src="${value.images.fixed_height.webp}" alt="${value.title}" loading="lazy">`