This file contains hidden or 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 DataStore | |
{ | |
public function __call($methodName, $args) { | |
if (preg_match('~^(set|get)([A-Z])(.*)$~', $methodName, $matches)) { | |
$property = strtolower($matches[2]) . $matches[3]; | |
if (!property_exists($this, $property)) { | |
throw new Exception("Error Processing Request",1); | |
} |
This file contains hidden or 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 | |
h::html( | |
h::head( | |
h::title('Hi!') | |
), | |
h::body( | |
h::h1('Hello')->id('oi'), | |
h::ul( |
This file contains hidden or 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
dscacheutil -flushcache |
This file contains hidden or 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
// includes bindings for fetching/fetched | |
PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
this.page = 1; | |
}, | |
fetch: function(options) { | |
options || (options = {}); | |
this.trigger("fetching"); |
This file contains hidden or 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
class Pager | |
constructor: (collection, attributes) -> | |
@collection = collection | |
@currentPage = attributes.current_page | |
@totalPages = attributes.total_pages | |
@perPage = attributes.per_page | |
@totalEntries = attributes.total_entries | |
@pages = @visiblePageNumbers().map (page) => | |
page: page | |
path: @buildPath page |
This file contains hidden or 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 FlashMessages { | |
private $messages = array(); | |
private $now = false; | |
private function __construct() { | |
// Save all messages | |
$this->messages = $_SESSION['flash_messages']; | |
NewerOlder