Skip to content

Instantly share code, notes, and snippets.

View mfairchild365's full-sized avatar

Michael Fairchild mfairchild365

View GitHub Profile
@mfairchild365
mfairchild365 / test.php
Created August 30, 2012 16:54 — forked from saltybeagle/test.php
Simple, configureable and lightweight Spam Detector
<?php
$spamChecker = new SpamChecker();
$spamChecker->addRule(function($spam){
if (strpos($spam, 'test') !== false) {
return true;
}
});
echo "The following should be true" . PHP_EOL;
var_dump($spamChecker->isSpam('this is a test'));
@mfairchild365
mfairchild365 / src_Home_Router.php
Created September 1, 2011 02:30 — forked from saltybeagle/Router.php
Simple router idea, uses array of routes
<?php
class Home_Router extends Router_Template
{
public static function getViewRoutes()
{
return array('/^home$/i' => 'Home_View');
}
public static function getEditRoutes()
{