Skip to content

Instantly share code, notes, and snippets.

available, learning

Nicholas Kimuli NicholasKimuli

available, learning
Block or report user

Report or block NicholasKimuli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
NicholasKimuli /
Created Nov 19, 2019 — forked from NARKOZ/
MySQL backup shell script
# Shell script to backup MySQL database
# Set these variables
# Backup Dest directory
DEST="" # /home/username/backups/DB
NicholasKimuli / passwordHashFunction.php
Created Jun 11, 2019
Doorstep Password Hash Function -- depreciated from php7.0
View passwordHashFunction.php
// Encrypting the password
$cost = 10;
$salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');
$salt = sprintf("$2a$%02d$", $cost) . $salt;
$hash = crypt('User Input Password', $salt);
// Decrypting password
if(hash_equals('User Input Password', crypt('Hash stored in database', 'User Input password'))) {
// Password matches. Proceed.
NicholasKimuli / countryCodes.html
Created May 9, 2019
Country Codes HTML [East African Countries]
View countryCodes.html
<select class="input-block-level" id="countryCode" name="countryCode">
<option data-countryCode="KE" value="254" Selected>Kenya (+254)</option>
<option data-countryCode="TZ" value="255">Tanzania (+255)</option>
<option data-countryCode="UG" value="256">Uganda (+256)</option>
<option data-countryCode="RW" value="250">Rwanda (+250)</option>
<option data-countryCode="MW" value="265">Malawi (+265)</option>
<option data-countryCode="ZM" value="260">Zambia (+260)</option>
<option data-countryCode="ZW" value="263">Zimbabwe (+263)</option>
<option data-countryCode="GB" value="44">UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
You can’t perform that action at this time.