Skip to content

Instantly share code, notes, and snippets.

View RodRitter's full-sized avatar

Rod Ritter RodRitter

View GitHub Profile
@RodRitter
RodRitter / gist:5387372
Created April 15, 2013 11:12 — forked from noknokstdio/gist:4698973
HTML: HTML 5 Template
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML5 Template</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
</body>
@RodRitter
RodRitter / gist:5387416
Last active December 16, 2015 05:49
PHP: REGEX is_unique Email Check
// Add in the top level domains that you want to include, in the REGEX statement
function is_email($email) {
if(preg_match ( '/[a-zA-Z1-9\.]+\@[a-zA-Z1-9\.]+\.[com|co.za|org|co.uk|co|biz|co.au]+$/' , $email) ){
$result = true;
} else {
$result = false;
}
return $result;
}
@RodRitter
RodRitter / PDO: DB Connection Check
Created April 15, 2013 19:01
PDO: DB Connection Check
function connect($root, $pass) {
try {
$conn = new PDO('mysql:host=localhost; dbname=practice',$root, $pass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $conn;
} catch(Exception $e) {
return false;
}
}