Skip to content

Instantly share code, notes, and snippets.

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

Jefferson Raga Salunga jrsalunga

💭
I may be slow to respond.
View GitHub Profile
@jrsalunga
jrsalunga / gist:3705662
Created September 12, 2012 09:56
php random password generator
// string of random a-z, A-Z, 0-9
function generatePassword($length = 8) {
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$count = mb_strlen($chars);
for ($i = 0, $result = ''; $i < $length; $i++) {
$index = rand(0, $count - 1);
$result .= mb_substr($chars, $index, 1);
}
@jrsalunga
jrsalunga / gist:3705639
Created September 12, 2012 09:53
random password generator for mysql
SELECT SUBSTRING(MD5(RAND()) FROM 1 FOR 6) AS password
@jrsalunga
jrsalunga / hi
Created September 3, 2012 00:17
hello
hello world