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 | |
private function query($method, $authorized = false) { | |
if ($authorized) { | |
$context = stream_context_create(array( | |
'http' => array( | |
'method' => 'POST', | |
'header' => sprintf("Content-type: application/x-www-form-urlencoded\r\n"), | |
'content' => http_build_query(array( | |
'login' => $this->username, | |
'token' => $this->token |
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 | |
function timeAgo($difference) { | |
static $timeConf = array( | |
'Seconds' => 60, | |
'Minutes' => 60, | |
'Hours' => 24, | |
'Days' => 0 | |
); |
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 queueTwitterscrapeTask extends Shell { | |
/** | |
* @var array | |
*/ | |
public $uses = array( | |
'Tweet', | |
'Queue.QueuedTask' | |
); |
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 QueueHelloworldTask extends Shell { | |
/** | |
* Adding the QueueTask Model. | |
* There is no magic here.. | |
* | |
* @var array | |
*/ | |
public $uses = 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
<?php | |
/* SVN FILE: $Id$ */ | |
/** | |
* Zend Data Cache storage engine for cache. | |
* | |
* | |
* PHP versions 4 and 5 | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) | |
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) |
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 | |
/** | |
* @author [email protected] | |
* @package QueuePlugin | |
* @subpackage QueuePlugin.Tasks | |
*/ | |
abstract class FlickrShell extends Shell { | |
protected $perms = 'write'; | |
protected $token; |
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 | |
function imagetrim(&$im) { | |
$width = imagesx($im); | |
$height = imagesy($im); | |
$imcopy = imagecreatetruecolor($width, $height); | |
imagecopy($imcopy, $im, 0, 0, 0, 0, $width, $height); | |
imagefilter($imcopy, IMG_FILTER_GAUSSIAN_BLUR); |
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
{- | | |
The claims of United States Patent 5,893,120 may be reduced to a set | |
of mathematical formulae expressed in the Typed Lambda Calculus, also | |
known as System F. This file contains these formulae. The language | |
used is Haskell, which is a version of System F with extra "syntactic | |
sugar" to make it useful for practical purposes. | |
It happens that formulae expressed in Haskell can also be transated by | |
a Haskell compiler into executable computer programs. However that |
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 | |
// check if the file actually exists. | |
if (file_exists($filePath)) { | |
//everything OK, log the access and start pushing the file. | |
$info = pathinfo($filePath); | |
$fileSize = filesize($filePath) - 1; | |
$fp = fopen($filePath, 'rb'); | |
// push it. | |
header("Expires: 0"); |
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 | |
/** | |
* Return human readable sizes | |
* | |
* @author Aidan Lister <[email protected]> | |
* @version 1.3.0 | |
* @link http://aidanlister.com/2004/04/human-readable-file-sizes/ | |
* @param int $size size in bytes | |
* @param string $max maximum unit | |
* @param string $system 'si' for SI, 'bi' for binary prefixes |
OlderNewer