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 to automate detecting if an open graph page has errors | |
* Requires the dom php extension to be enabled | |
* | |
* @param string $url | |
* @return array with keys 'hasError', 'errorType', and 'errorMessage' | |
*/ | |
function facebookLinterErrors($url) | |
{ | |
$errorType = ""; |
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
// in one of your bootstrap files... possibly config/bootstrap/media.php | |
use lithium\net\http\Media; | |
Media::type('default', null, array( | |
'view' => 'lithium\template\View', | |
'loader' => 'Mustache', | |
'renderer' => 'Mustache', | |
'paths' => array( | |
'template' => '{:library}/views/{:controller}/{:template}.{:type}', |
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(){var a=document.activeElement,b=document.getSelection().toString(),c="",d=b.split("\n");indent=" ",i=0,total=d.length;if(b==""){return}for(i=0;i<total;i++){c+=indent+d[i]+"\n"}a.value=a.value.split(b).join(c)}()) |
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 | |
namespace app\analysis; | |
use lithium\action\Request; | |
use lithium\console\Request as ConsoleRequest; | |
use lithium\core\Environment; | |
use lithium\data\Connections; | |
use lithium\util\String; | |
use MongoDate; |
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 | |
use lithium\storage\Session; | |
$methods = array('read', 'write', 'delete', 'clear', 'check'); | |
foreach ($methods as $method) { | |
$filter = function($self, $params, $chain) use ($method) { | |
if ($params['options']['name'] === null) { | |
if ($params['configuration'] !== 'default') { | |
// dump("returning false for {$params['configuration']} for {$method}"); |
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
/** | |
* Sample usage - note that the trailing slash on the watch directory is important! | |
* | |
* node uglify.js /path/to/my/src/directory/ /path/to/my/output/file.js | |
*/ | |
var jsp = require('uglify-js').parser, | |
pro = require('uglify-js').uglify, | |
fs = require('fs'); |
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 | |
use lithium\action\Response; | |
use lithium\core\Environment; | |
use lithium\core\ErrorHandler; | |
use lithium\core\Libraries; | |
use lithium\console\Response as ConsoleResponse; | |
use lithium\net\http\Media; | |
use lithium\analysis\Logger; | |
use lithium\net\http\Service; |
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 | |
namespace li3_common\analysis; | |
use lithium\action\Request; | |
use lithium\console\Request as ConsoleRequest; | |
use lithium\core\Environment; | |
use lithium\data\Connections; | |
use lithium\util\String; | |
use MongoDate; |
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 | |
namespace app\controllers; | |
use app\models\Downloads; | |
class DownloadsController extends \lithium\action\Controller { | |
public function index() { | |
$this->request->privateKeys = array('id', 'user_id'); |
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 readline = require('readline'), | |
shotgun = require('shotgun'), | |
shell = new shotgun.Shell(), | |
context = {}; // Declare empty context object. | |
// Create interface that reads from console and outputs to console. | |
var rl = readline.createInterface(process.stdin, process.stdout); | |
// Configure shotgun. | |
shell |
OlderNewer