Skip to content

Instantly share code, notes, and snippets.

View Dreyer's full-sized avatar

Matthew Dreyer Dreyer

View GitHub Profile
@Dreyer
Dreyer / mail-test.php
Created June 20, 2012 09:06
Quick & Dirty PHP Mail Test Script
<?php
/*
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED!
*/
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = 'webmaster@example.com';
@Dreyer
Dreyer / random-string.js
Created April 12, 2012 15:24
Generate random alphanumeric string in JavaScript
// @source: http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript
function randomStr(m) {
var m = m || 9; s = '', r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (var i=0; i < m; i++) { s += r.charAt(Math.floor(Math.random()*r.length)); }
return s;
};