This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<routes> | |
<defaultController>Default</defaultController> | |
<!-- A simple custom route --> | |
<route path="about-us"> | |
<controller callback="aboutUsPage">Company</controller> | |
</route> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 'On'); | |
error_reporting(E_ALL); | |
class InternalStore { | |
protected $store; | |
public function __construct($store = array()) { | |
$this->setStore($store); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// English | |
$arch->locale->setLocale('en-US'); | |
// Default english dict (en-US.xml) | |
echo $arch->lang->get('hello_world'); // Hello World | |
// Bork, english dict (en-US.xml) + translator module | |
$arch->locale->setTranslator('Enchefenizer'); | |
echo $arch->lang->get('hello_world'); // Hellu Vurld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I moustache you a question, but I'll shave it for later... | |
String.prototype.moustache = function(object, regex) { | |
return this.replace(regex || (/\\?\{\{([^{}]+)\}\}/g), function(match, key) { | |
if(match.charAt(0) == '\\') | |
return match.slice(1); | |
return (object[key] !== null) ? object[key] : ''; | |
}); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UploadrException extends Exception {} | |
class Uploadr { | |
public $upload_path; | |
protected $max_file_size; | |
public $max_file_count = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//ini_set('display_errors', 'On'); | |
//error_reporting(E_ALL); | |
class Stylesheet { | |
private $css_rule_regex = '/(?ims)([a-z0-9\s\.\:#_\-@]+)\{([^\}]*)\}/'; | |
public function __construct($css_data) { | |
$this->unparsed = $css_data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lex = new Lingo.Lexer(); | |
lex.setLexicon('foo', new Lingo.Dictionary({ | |
name: 'Rövarspråket', | |
description: 'Rövarspråket', | |
lexicon: { | |
characters: { | |
'B': 'Bob', 'b': 'bob', | |
'C': 'Coc', 'c': 'coc', | |
'D': 'Dod', 'd': 'dod', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var Lingo = this.Lingo = {}; | |
Lingo.Dictionary = function(dictionary) { | |
this.setDictionary(dictionary); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
this.log = function() { | |
// Really old browsers | |
if(typeof console == undefined) | |
var console = {}; | |
// Just makin' sure... | |
if(typeof console.log == undefined) | |
console.log = function() {}; | |
// Now we're talkin' | |
else if(typeof console == 'function') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 'On'); | |
error_reporting(E_ALL); | |
define('TYPEHINT_PCRE', '/^Argument (\d)+ passed to (?:(\w+)::)?(\w+)\(\) must be an instance of (\w+), (\w+) given/i'); | |
class TypeHint { | |
private static $error_handler; |