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 | |
$email = '[email protected]'; | |
$password = 'secret'; | |
$url = "https://www.google.com/accounts/ClientLogin?service=reader&Email={$email}&Passwd={$password}"; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$output = curl_exec($ch); |
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
INFO [ main ] Accepted connection from 127.0.0.1:38684 | |
INFO [ 2 ] Received CON wakeup event | |
DEBUG [ 2 ] Received OPTION_REQ 127.0.0.1:525643377 -> libgearman-server/thread.c:294 | |
DEBUG [ proc ] 'exceptions' -> libgearman-server/server.c:360 | |
DEBUG [ 2 ] Received RUN wakeup event -> libgearman-server/gearmand_thread.cc:409 | |
DEBUG [ 2 ] Sent OPTION_RES to 127.0.0.1:525643377 -> libgearman-server/thread.c:339 | |
DEBUG [ 2 ] Received CAN_DO 127.0.0.1:525643377 -> libgearman-server/thread.c:294 | |
DEBUG [ 2 ] Received GEARMAN_COMMAND_GRAB_JOB_ALL 127.0.0.1:525643377 -> libgearman-server/thread.c:294 | |
DEBUG [ proc ] Jobs available 0 -> libgearman-server/job.c:462 | |
DEBUG [ 2 ] Received RUN wakeup event -> libgearman-server/gearmand_thread.cc:409 |
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 | |
$gmc= new GearmanClient(); | |
$gmc->addServer(); | |
$gmc->setExceptionCallback(function(GearmanTask $task) { | |
$m = $task->data(); | |
echo "Exception: {$m}\n"; |
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 | |
$gmw = new GearmanWorker(); | |
$gmw->addServer(); | |
$gmw->addFunction('test', function(GearmanJob $job) { | |
throw new Exception('Boom'); | |
}); | |
while(1) $gmw->work(); |
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 | |
$complete = 0; | |
$fail = 0; | |
$gmc = new GearmanClient; | |
$gmc->addServer(); | |
$gmc->setCompleteCallback(function() use (&$complete) { | |
$complete++; |
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 | |
// client | |
$gmc= new GearmanClient(); | |
$gmc->addServer(); | |
$gmc->setExceptionCallback(function(GearmanTask $task) { | |
$m = $task->data(); | |
echo "Exception: {$m}\n"; |
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
// macro.php | |
<?php | |
$gmw = new GearmanWorker(); | |
$gmw->addServer(); | |
$gmw->addFunction('macro', function(GearmanJob $job) { | |
$gmc = new GearmanClient; |
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 | |
/** | |
* Manage responses from gearman workers and pass data along to the report | |
*/ | |
class Status | |
{ | |
protected $id; | |
protected $status; |
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
#!/bin/bash | |
## | |
# Package multiple javascript/css files into a single file. | |
# | |
# This script will search a file for @PACKAGE-START and @PACKAGE-END annotations | |
# and merge all references files between those annotations into a single file. | |
# The first file in the list will be treated as the master file. References to | |
# the subsequent files will be removed. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
function invite() { | |
var url = '/people/~/mailbox', | |
body = { | |
recipients: { | |
values: [{ | |
person: { |
OlderNewer