Skip to content

Instantly share code, notes, and snippets.

View Michaelkodji's full-sized avatar

KODJI Michaelkodji

  • Benin,Cotonou
View GitHub Profile
@Michaelkodji
Michaelkodji / login.html
Created October 12, 2022 08:12
disable enter key to prevent submit form
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form id="myForm">
<input type="email" name="mail">
<input type="password" name="passwd">
<input type="submit" name="btn">
@Michaelkodji
Michaelkodji / acceuil.html
Created September 6, 2022 11:21
Disconnect user or session after five minutes of inactivity (déconnecter un utilisateur après 5min d'inactivité )
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="activite.js"></script>
</head>
@Michaelkodji
Michaelkodji / tp-6.cpp
Created October 6, 2020 12:17
Nombres de jours séparant deux date sous la forme 11/mm/aaaa
#include <iostream>
#include<cmath.>
using namespace std;
typedef struct DATE
{
int J,M,A;
};
bool bissectile(DATE d)
{
@Michaelkodji
Michaelkodji / tp-4.cpp
Created October 6, 2020 12:15
sous-tableau constant
#include <iostream>
using namespace std;
int main()
{
int tab[10]={0}, i=0, j=0, nombre=0, k=0;
cout<<"Entrer le nombre d'element que vous voulez mettre dans votre tableau:\n";
cin>>nombre;
cout<<"Entrer les valeurs du tableau;\n";
for(i=0; i<nombre; i++)
{
@Michaelkodji
Michaelkodji / tp-3.cpp
Last active October 6, 2020 22:50
jeu du mastermind (simplifié)
#include <iostream>
using namespace std;
int compteur=4;int combinaison_cache[5]={1,2,3,4,5}; int combinaison_entre[5] , reponse=0;
int main()
{
cout<<"Bonjour et bienvenue dans le jeu MASTERMIND"<<endl;
do{
cout<<" Entrer votre combinaison "<<endl;
@Michaelkodji
Michaelkodji / tp-2.cpp
Created October 6, 2020 12:11
Dossard et temps du second dossard
#include <iostream>
using namespace std;
int dosse,dossmt,dossec; float tc,mt,mtsec,tmp;
int main()
{
do{
cout << "Entrer le dossard du premier concurent" << endl;
cin>>dosse;
cout<<"Entrer le temps du premier concurent"<<endl;
@Michaelkodji
Michaelkodji / tp-1.cpp
Created October 6, 2020 12:08
Année bissextile
#include <iostream>
using namespace std;
int i=0, an; int mois_entre;
typedef struct date{
int j,m,a;
};
bool anneeBissextile(int an){
@Michaelkodji
Michaelkodji / code.php
Created May 27, 2020 11:45 — forked from manutheblacker/code.php
code de generation de code
<?php
function passgen2($nbChar){
return substr(str_shuffle('abcdefghijklmnopqrstuvwxyzABCEFGHIJKLMNOPQRSTUVWXYZ0123456789'),1, $nbChar);
}
function generate_code_ticket($ticket_number=1){
$ticket_disponible = array();
while($ticket_number > 0){
$ticket_code = passgen2(9);
@Michaelkodji
Michaelkodji / index.php
Created May 27, 2020 11:30
Generate a automatic code
<?php
function passgen2($nbChar){
return substr(str_shuffle('abcdefghijklmnopqrstuvwxyzABCEFGHIJKLMNOPQRSTUVWXYZ0123456789'),1, $nbChar); }
echo passgen2(9);
// Affiche un password comme : M9ytp5Pbcn
?>