Last active
July 1, 2022 16:06
-
-
Save CuzImBisonratte/108650c3c28f9706cb7df67f2b59b814 to your computer and use it in GitHub Desktop.
Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Center all elements vertically and horizontally */ | |
display: flex; | |
align-items: center; | |
justify-content: center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readline = require("readline"); | |
// Create the readline interface | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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