Skip to content

Instantly share code, notes, and snippets.

@CuzImBisonratte
Last active July 1, 2022 16:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save CuzImBisonratte/108650c3c28f9706cb7df67f2b59b814 to your computer and use it in GitHub Desktop.
Snippets
/* Center all elements vertically and horizontally */
display: flex;
align-items: center;
justify-content: center;
// Functions to generate an ID
function generateIDsection($length){
$id_charset = "abcdefghijklmnopqrstuvwxyz123465789";
$generated = "";
for ($i=0; $i < $length; $i++) {
$new_char = substr($id_charset, mt_rand(0, strlen($id_charset)),1);
$generated .= $new_char;
}
return $generated;
}
function generateID(){
$gen_id = generateIDsection(8) . "-";
$gen_id .= generateIDsection(4) . "-";
$gen_id .= generateIDsection(4) . "-";
$gen_id .= generateIDsection(4) . "-";
$gen_id .= generateIDsection(12);
return $gen_id;
}
const readline = require("readline");
// Create the readline interface
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
// Get all needed modules
var readline = require('readline');
// Create a readline interface
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment