Skip to content

Instantly share code, notes, and snippets.

View ludndev's full-sized avatar
💭
I may be slow to respond.

Judicaël AHYI ludndev

💭
I may be slow to respond.
View GitHub Profile
@bradtraversy
bradtraversy / pdo_db.php
Created February 21, 2018 12:56
PDO Class
<?php
/*
* PDO DATABASE CLASS
* Connects Database Using PDO
* Creates Prepeared Statements
* Binds params to values
* Returns rows and results
*/
class Database {
private $host = DB_HOST;
@bobbyiliev
bobbyiliev / gist:f026d47c6cd62c544ef9ca2d5f4692c7
Created July 9, 2020 13:40 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@kitihounel
kitihounel / genpw.js
Created July 15, 2024 20:04
Funny little NodeJS script to generate passwords
/**
* This is a small program used to generate passwords given an alphabet and a target length.
*
* A bit of math and programming.
* We have an alphabet of size A and we want a password of length P.
* We need to generate an integer bound by (A^P) and convert it to base A using the standard base
* conversion algorithm with our alphabet symbols as the digits.
*
* (A^P) is our upper bound because (A^P) has P+1 digits in base A and we need P digits (symbols).
* For example, in base 10, 10^2 = 100 has 3 digits. In base 2, 16 = 2^4 = 10000 has 5 symbols, etc.