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
/*! | |
Usage: | |
// define a base class called 'A' | |
// inheriting 'null' will inherit an empty constructor, | |
// this is convenient because you can define all your classes using the inherit method. | |
// protip: use upper case for classes, lower case for instances | |
var A = inherit(null, { | |
doSomething: 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 | |
/** | |
* TbJqueryFileUpload class file. | |
* @author Christoffer Niska <christoffer.niska@gmail.com> | |
* @copyright Copyright © Christoffer Niska 2013- | |
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |
* @package yiistrap-widgets.widgets | |
*/ | |
/** |
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
[ | |
{ | |
query: 'http://tympanus.net/codrops/?s={{term}}', | |
translate: 'parseHTML(response)', | |
icon:{ | |
selector: '.ct-row > article > .ct-latest-thumb', | |
expression: 'app.url|icons' | |
}, | |
name:{ | |
selector: '.ct-row > article > h3 > a', |
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
[ | |
{ | |
query: 'https://coderwall.com/p/search?scope=everything&search={{term}}', | |
translate: 'parseHTML(response)', | |
icon:{ | |
selector: '.avatars li:first-child a', | |
expression: 'app.url|icons' | |
}, | |
name:{ | |
selector: '.protip a.title', |
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 | |
/** | |
* Active record behavior for handling JSON attributes. | |
* | |
* @property CActiveRecord $owner | |
*/ | |
class JsonAttributeBehavior extends CActiveRecordBehavior | |
{ | |
/** |
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 maxHealth = 20, | |
criticalHealth = 5, | |
checkedBehind = false; | |
jsWarrior.turn = function(warrior) { | |
warrior.takingDamage = warrior.lastHealth > warrior.getHealth(); | |
if (warrior.check() == "enemy") { | |
warrior.attack(); | |
} |
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
/** | |
* Initializes the application. | |
*/ | |
var initialize = function() { | |
var self = this; | |
$('*[data-view]').each(function() { | |
var $el = $(this), | |
viewClass = 'app/views/' + $el.data('view'); | |
require([viewClass], function(View) { | |
new View({el: $el[0], app: self}); |
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 I18nAttributeBehavior extends CActiveRecordBehavior | |
{ | |
/** | |
* @var array a list of translatable attributes. | |
*/ | |
public $attributes = array(); | |
/** |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# VMWare | |
config.vm.box = "precise64_vmware" | |
config.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"; | |
config.vm.network :public_network |
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 | |
/** | |
* Returns the active language. | |
* @return string the locale. | |
*/ | |
public function resolveActiveLanguage() | |
{ | |
$user = user(); | |
$matches = array(); | |
if ($user->hasState('__locale')) { |