Skip to content

Instantly share code, notes, and snippets.

View yostane's full-sized avatar

Yassine Benabbas yostane

View GitHub Profile
@yostane
yostane / 01-chsarp-examples.cs
Last active March 29, 2023 14:47
Bouts de code c#
Console.Write("Hello");
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Query
interface TerminalService {
@GET("login.php")
fun login(@Query("login") login: String, @Query("mdp") password: String): Call<ResponseBody>
@GET("reservations.php")
@yostane
yostane / test.php
Last active February 18, 2021 13:47
<?php
$reservation = Array("id" => 1, "date_debut" => "2021-02-21", "date_fin" => "2021-02-28", "id_client" => 1);
$json = json_encode($reservation);
echo $json;
@yostane
yostane / body.html
Last active February 17, 2021 15:43
<body>
<div id="vue_root">
Counter: {{ counter }}
</div>
</body>
@yostane
yostane / configure-mariadb.js
Last active February 17, 2021 11:17
mysql node
const mariadb = require('mariadb');
const pool = mariadb.createPool({
host: 'mydb.com',
user:'myUser',
password: 'myPassword',
connectionLimit: 5
});
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
GET http://localhost:3000/test
###
POST http://localhost:3000/test
###
PUT http://localhost:3000/test
###
DELETE http://localhost:3000/test
@yostane
yostane / client-random.js
Last active February 16, 2021 14:21
webapp fiels
async function retreiveNumbers() {
const response = await fetch("/random");
const numbers = await response.json();
// suite du code
}
app.get("/rondoudou", (req, res) => {
res.send(`<html>
<body>
<img src="/test_static/rondoudou.gif" >
</body>
</html>`);
});
app.get("/rondoudou", (req, res) => {
res.send(`<html>
<body>
<img src="https://www.pokepedia.fr/images/thumb/c/cd/Rondoudou-RFVF.png/636px-Rondoudou-RFVF.png" >
</body>
</html>`);
});