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 | |
LOCK=/home/user/wm.lock | |
if [ -f $LOCK ]; then | |
exit 0 | |
fi | |
PAGE=$(curl -s http://www.whiskeymilitia.com/) | |
FOUND=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 Phergie_Plugin_PushMessage extends Phergie_Plugin_Cron | |
{ | |
public function onLoad() | |
{ | |
$settings = $this->config['push_message.listen']; | |
foreach ($settings as $listen) { | |
$host = $listen['host']; |
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
# gearman client that sends no data to the "ping" function | |
gearman -f ping -s | |
# gearman client that sends the string "pong" to the "ping" function | |
echo "pong" | gearman -f ping | |
# gearman client that sends a json string to the "process" function | |
echo '{"order":4985343}' | gearman -f process | |
# gearman client that reads data from a order.json file |
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(); | |
$processor = new Processor; | |
$gmw->addFunction("process", function(GearmanJob $job) { | |
$data = json_decode($job->workload()); | |
$processor->process($data); | |
}); |
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
$items = array( | |
array( | |
'name' => 'Pants', | |
'available' => 1, | |
'sold' => 1, | |
), | |
array( | |
'name' => 'Shoes', | |
'available' => 1, | |
'sold' => 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
function invite() { | |
var url = '/people/~/mailbox', | |
body = { | |
recipients: { | |
values: [{ | |
person: { |
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
<?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
// 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 | |
// client | |
$gmc= new GearmanClient(); | |
$gmc->addServer(); | |
$gmc->setExceptionCallback(function(GearmanTask $task) { | |
$m = $task->data(); | |
echo "Exception: {$m}\n"; |