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
// needs underscore and Backbone.Events( really didn't want to code that stuff up :P) | |
window.sandBoxFactory = function () { | |
var vent = _.extend({}, Backbone.Events); // The event aggregator for the sandbox | |
var communicatorEvents = []; | |
var broadCasters = {}; | |
var sandBox = { |
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
http://vimeo.com/53221560 | |
http://vimeo.com/53221558 | |
http://vimeo.com/49718712 | |
http://www.youtube.com/watch?v=f6kdp27TYZs |
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 definition + constructor | |
function FooFactory(bar, baz) { | |
/* return an object with a set of properties and functionalities | |
tied together using closuers and lexical scoping */ | |
} | |
// actual object construction | |
var foo = FooFactory(bar, baz); | |
//inheritance (via as many object as you want) |
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
""" | |
for a given instalment, interest, and number of years, calculate the compounded amount. | |
USAGE: | |
python compound.py instalment interest, years | |
""" | |
import sys |
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 | |
Event::listen('illuminate.query', function($query, $bindings, $time) { | |
static $count; | |
if(App::make('env') === 'local') | |
{ | |
$logFile = __DIR__.'/../storage/logs/queries'; | |
ob_start(); | |
var_dump($bindings, $query); | |
$str = ob_get_clean(); | |
if($count === null) |
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 | |
Route::get('/', function() | |
{ | |
return View::make('home.index'); | |
}); | |
Route::controller('home'); |
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
public class Gen { | |
public static void main(String[] args) { | |
Foo<Integer> a = new Foo<Integer>(123); | |
// Baz b = new Baz("aha"); | |
System.out.println(a.bar.toString()); | |
// System.out.println(b.bar); |
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
angular.module('sorter').config(function ($routeProvider, $locationProvider) { | |
// code fuplicated here, cos can't find a way to use custom service in config | |
var $uri = (function () { | |
var pageBase = '/admin/classification/sorter/app/', tmplBase = '/js/sorter/tmpls/', | |
apiBase = '/admin/classification/sorter/api/' | |
return { | |
page: function (uri) { return pageBase + uri; }, | |
tmpl: function (uri) { return tmplBase + uri; }, | |
api: function (uri) { return apiBase + uri; } |
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
<div class="row sorter-container" ng-app="sorter" ng-controller="AppCtrl"> | |
<div class="span10"> | |
<div class="row"> | |
<div class="span10"> | |
<ul class="nav nav-pills"> | |
<li ng-repeat="item in navItems" ng-class="item.isActive() && 'active' || ''"> | |
<a href="{{item.uri}}">{{item.title}}</a> | |
</li> | |
</ul> | |
</div> |
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
angular.module('sorter').controller('AppCtrl', function ($scope, $uri, $route, $location, $window) { | |
var navItem = function (slug) { | |
var item = { | |
title : slug[0].toUpperCase() + slug.slice(1), | |
slug : slug, | |
uri : $uri.page(slug) | |
}; | |
item.isActive = function () { |
OlderNewer