Skip to content

Instantly share code, notes, and snippets.

View lostsh's full-sized avatar
💾
Probably coding ...

Yohann Vernhes lostsh

💾
Probably coding ...
View GitHub Profile
@lostsh
lostsh / datetime.sh
Created October 29, 2021 18:02
Display current datetime in french condensed format.
COL="\033[0;31m"
RST="\033[0m"
numbers=(\
"\n ██████╗ \n██╔═████╗\n██║██╔██║\n████╔╝██║\n╚██████╔╝\n ╚═════╝ \n" \
"\n ██╗ \n ███║ \n ╚██║ \n ██║ \n ██║ \n ╚═╝ \n" \
"\n██████╗ \n╚════██╗ \n █████╔╝ \n██╔═══╝ \n███████╗ \n╚══════╝ \n" \
"\n██████╗ \n╚════██╗ \n █████╔╝ \n ╚═══██╗ \n██████╔╝ \n╚═════╝ \n" \
"\n██╗ ██╗ \n██║ ██║ \n███████║ \n╚════██║ \n ██║ \n ╚═╝ \n" \
"\n███████╗ \n██╔════╝ \n███████╗ \n╚════██║ \n███████║ \n╚══════╝ \n" \
@lostsh
lostsh / cow.c
Created October 22, 2021 13:23
Cowsay in C99/C17
#include <stdlib.h>
#include <stdio.h>
void showCow(int);
void showMessage(int, char**);
int length(char*);
int main(int argc, char **argv){
if(argc == 1){
@lostsh
lostsh / exemple.js
Created June 4, 2021 15:34
Ugly JS code to handle some url params
/**
* Return the page from the url
* like https://.../index.html#page=X : return X
* If page not found return 0
*/
function urlGetPage(){
var params = {
'page' : 0
};
var pageUrl = window.location.href;
@lostsh
lostsh / test-V0.2-Sunny
Created May 3, 2019 11:36
Test of the omnidirectional sensor of sunny ... it works pretty good !
/*Ici on a un capteur fait maison compose de quatres photoresistor
* ce programme permet de recupere les valeurs de chaque capeur
* chaque photocellules est branché sur une pine 1 2 3 et 4
* La boucle permet de les parcourir et d'inscrir leur valeur en console pour ensuite tracer le graphique
*
* pour le CNA / CAN :
* arduino 16MHz et un arduino uno donc un ATMEGA 328
* donc un CAN de resolution 10 bit allant de 0v a 5v
* soit donc 1024 points avec une sensi a 4.9mV a peut pres
* on a donc finalement environ 10 K mesures par secondes
@lostsh
lostsh / iframe-github.md
Last active May 14, 2020 03:06
Iframe gist