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')) { |
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 ConfigRenderer extends CComponent | |
{ | |
/** | |
* @var string | |
*/ | |
public $tab = ' '; | |
/** |
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 | |
Yii::import('system.cli.commands.MigrateCommand'); | |
class MigratePathCommand extends MigrateCommand | |
{ | |
/** | |
* @var string | |
*/ | |
public $migrationTable = 'migration'; |
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 | |
/** | |
* Web user component with support for loading the associated model. | |
* | |
* You can request attributes on the model object the following way: | |
* Yii::app()->user->model->username; | |
*/ | |
class WebUser extends CWebUser | |
{ | |
/** |