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
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*- | |
%% ex: ts=4 sw=4 et | |
[ | |
%% Riak Core config | |
{riak_core, [ | |
%% Default location of ringstate | |
{ring_state_dir, "data/ring"}, | |
%% http is a list of IP addresses and TCP ports that the Riak | |
%% HTTP interface will bind. |
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 | |
$ordersForShipping=new CActiveDataProvider( Orders::model()->with(array( | |
'cart'=>array( | |
/* | |
* Ensure occurs in same query | |
*/ | |
'together'=>true, | |
'joinType'=>'INNER JOIN', | |
'with'=>array( |
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 | |
# In response to: https://www.facebook.com/groups/61355672149/10150626399467150/ | |
$hiddenFields = array('field1'=>'value1', 'field2'=>'value2'); | |
array_map('echo', array_map(array('CHtml', 'hiddenField'), array_keys($hiddenFields), $hiddenFields)); | |
# OR same solution as previous, but with the addition of common html options | |
$hiddenFields = array('field1'=>'value1', 'field2'=>'value2'); |
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 | |
use \ext\activedocument\Criteria; | |
$criteria = new Criteria; | |
$criteria->addColumnCondition(array('slug'=>$slug)); | |
$category = Category::model()->find($criteria); | |
$criteria = new Criteria; | |
$criteria->order='updated ASC'; |
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 | |
use \ext\activedocument\Criteria; | |
$criteria = new Criteria; | |
$criteria->addColumnCondition(array('slug'=>$slug)); | |
$category = Category::model()->find($criteria); | |
$criteria = new Criteria; | |
$criteria->order='updated ASC'; |
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 TestController extends Controller { | |
public function actionIndex() { | |
$person = TestPerson::model()->findByAttributes(array('name' => 'Parent')); | |
if ($person) { | |
CVarDumper::dump(array('person FROM ACTIVEDOCUMENT' => $person->object->data), 10, true); | |
CVarDumper::dump(array('person stepchildren LASTNAME ASC (relation criteria)' => array_map(function($c) { | |
/** |
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 | |
$criteria = new \ext\activedocument\Criteria; | |
$criteria->addMapPhase(' | |
function(value, keyData, arg) { | |
if(!value["not_found"]) { | |
var object = Riak.mapValuesJson(value)[0]; | |
if(object.hasOwnProperty(arg.col) && object[arg.col] instanceof Array) { | |
if(object[arg.col].indexOf(arg.val) != -1) | |
return [[value.bucket,value.key]]; | |
} |
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 Available extends CQueue { | |
} | |
class Booked extends CQueue { | |
} | |
class Unavailable extends CQueue { | |
} |
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
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
x := make([]uint8, dx) | |
y := make([][]uint8, dy) | |
for n := range y { | |
y[n] = x |
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 | |
// components/WidgetFactory.php | |
/** | |
* Custom WidgetFactory class | |
* Provides two new events: | |
* - onBeforeCreateWidget | |
* - onAfterCreateWidget | |
* |
OlderNewer