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
# Promise to load a file from the file system | |
# Requirements: | |
# it "should load aliased files correctly", (done) -> | |
# app.load("@lib/Invoke.coffee") | |
# .then (contents) -> | |
# contents.should.contain "this unique text that you are reading right now" | |
# done() | |
# .otherwise (err) -> | |
# throw err | |
# |
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 | |
/** | |
* Provides a wrapper for the CKEditor wysiwyg html editor | |
* @author Charles Pick | |
* @package packages.ckeditor | |
*/ | |
class ACKEditorWidget extends CInputWidget { | |
/** | |
* The options for the editor | |
* @var 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
function d(b){e=function(c){return c.replace(/"/,'\\"')};g=function(c){var b=[];for(i=0;i<c.length;i++)b.push(d(c[i]));return b};h=function(b){var f=[];for(a in b)f.push('"'+e(a)+'": '+d(b[a]));return"{"+f.join(",")+"}"};r=Object.prototype.toString.call(b).split(" ").pop().charAt(0);return"S"==r?'"'+e(b)+'"':"N"==r?b:"A"==r?"["+g(b).join(",")+"]":h(b)} |
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 ActiveRecord { | |
public static function generateCacheKey($field, $id = null) | |
{ | |
return get_class(static::model()).($id !== null ? ':'.$id : '').':'.$field; | |
} | |
public function getCacheKey($field) | |
{ | |
return self::generateCacheKey($field,$this->getPrimaryKey()); |
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 Eventable { | |
/** | |
* The events attached to this class | |
* @var Event[] | |
*/ | |
protected $_events = array(); | |
/** | |
* Determines whether an event is defined. |
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
/** | |
* Runs before the action | |
* @param CAction $action The action to be run | |
* @return boolean Whether to run the action or not | |
*/ | |
public function beforeAction($action) { | |
Yii::beginProfile("Run Action"); | |
return parent::beforeAction($action); | |
} | |
/** |
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
{ | |
"Webapp":{ | |
"properties":{ | |
"tags":{ | |
"index_name":"tag", | |
"type":"string" | |
}, | |
"id":{ | |
"type":"integer" | |
}, |
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
{ | |
"_index":"main", | |
"_type":"Webapp", | |
"_id":"34", | |
"_version":13, | |
"_source":{ | |
"id":"34", | |
"name":"Seriesly!", | |
"title":"Seriesly!", | |
"description":"Seriesly provides you with torrent\/streaming links for your favorite TV shows.", |
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
{ | |
"fields": [ | |
"id", | |
"name", | |
"title", | |
"description", | |
"url", | |
"domain" | |
], | |
"query": { |
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
{ | |
"fields":["id","name","title","description","url","domain"], | |
"query": { | |
"custom_score": { | |
"query": { | |
"match_all":{} | |
}, | |
"filter": { | |
"terms":{ | |
"tags":["twitter"] |