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 PointCollection = Backbone.Collection.extend(); | |
/** | |
* Graph Canvas | |
*/ | |
var Graph = Backbone.View.extend({ | |
el: '#viewport-graph', | |
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 | |
$user = ORM::factory('user'); | |
$user->landlord->first_name = 'Merrick Christensen'; | |
$user->settings->public = TRUE; | |
$user->save(); // Runs validation on the landlord model, settings model, user model, and saves them all in the proper order of dependency for has-* relationships. | |
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 | |
$user = Cascade::factory(ORM::factory('user')); // Add functionality to the ORM class by decorating it with Cascade. | |
$user->username = 'iamauser'; | |
$user->profile->first_name = 'Merrick'; | |
$user->profile->last_name = 'Christensen'; | |
try |
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 Awesome_Functionality{ | |
protected $_awesome; | |
public function awesomeify(){ | |
echo $this->_awesome.' is awesome.'; | |
} | |
} |
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 defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* We Extend Controller_Template to have instant access to a template. | |
* | |
* @package default | |
* @author Merrick Christensen | |
*/ | |
class Controller_Welcome extends Controller_Template { |
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 defined('SYSPATH') or die('No direct script access.'); | |
abstract class Controller_Application extends Controller_Template { | |
public $template = 'templates/application'; | |
public function before() | |
{ | |
/* Called before so we have access to $this->template */ | |
parent::before(); |
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 defined('SYSPATH') or die('No direct script access.'); | |
class Model_Role extends Model_AutoModeler_ORM_Role{ | |
public static function get_role_by_name($name) | |
{ | |
$role = new self(); | |
$role->load(DB::select()->where('name', '=', $name)); | |
return $role; | |
} | |
} |
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 WordStache extends Mustache{ | |
public function render($template = null, $view = null, $partials = null) { | |
if (preg_match("/^!path/", $template)) | |
{ | |
$template = file_get_contents(TEMPLATE_PATH.substr($template, 5)); | |
} |
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 PluginStache extends WordStache{ | |
protected $_data = array(); | |
protected $_partials = array(); | |
protected $_template = '!path/stormtrap.mustache'; | |
public function render(){ | |
return parent::render($this->_template, $this->_data, $this->_partials); |
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
define(function(){ | |
return Backbone.View.extend({ | |
el: "#bone-navigation", | |
events: { | |
"click a.toggle" : "toggleView" | |
}, | |
initialize: function(){ | |
_.bindAll(this, "toggleView", "windowScroll", "windowResize"); |