Skip to content

Instantly share code, notes, and snippets.

View fordnox's full-sized avatar
🍕
Eating pizza

Andrius Putna fordnox

🍕
Eating pizza
View GitHub Profile
@fordnox
fordnox / autoloader.php
Created August 9, 2011 19:52
Simplest possible autoloader for PHP classes. Can be used and for namespaces
<?php
spl_autoload_register('autoloader');
function autoloader($className)
{
if(strpos($className, '\\') !== false) {
$className = str_replace('\\', DIRECTORY_SEPARATOR, $className);
}
if(strpos($className, '_') !== false) {
@fordnox
fordnox / Facebook.php
Created July 29, 2011 08:25
Very simple Facebook graph executor
<?php
namespace Ai;
class Facebook
{
private $token;
public function __construct($token)
{
$this->token = $token;