Skip to content

Instantly share code, notes, and snippets.

@zircote
zircote / snip.conf
Created May 16, 2011
Ignore for Zend Studio/Eclipse
View snip.conf
global-ignores = \.settings \.buildpath \.project
@zircote
zircote / Metadata.php
Created May 31, 2011
A Zend Framework class to fetch EC2 instance meta-data
View Metadata.php
<?php
require_once 'Zend/Service/Abstract.php';
/**
*
*
* @author zircote@zircote.com
*
* <code>
* <?php
* $metadata = new Zircote_Service_Ec2_Metadata;
@zircote
zircote / build.xml.diff
Created Jun 2, 2011
DocBlox from PHPDocumenter
View build.xml.diff
diff --git build.xml build.xml
index 0342c23..2608ddf 100644
--- build.xml
+++ build.xml
@@ -26,7 +26,7 @@
</target>
<target name="parallelTasks"
- description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc and phploc tasks in parallel using a maximum of 2 threads.">
+ description="Run the pdepend, phpmd, phpcpd, phpcs, docblox and phploc tasks in parallel using a maximum of 2 threads.">
@zircote
zircote / Jeffe.php
Created Jun 3, 2011
Rediska Worker/Queue Pair for Recurring Tasks
View Jeffe.php
<?php
$options = array('namespace' => 'WorkerProcess_',
'servers' => array(array('host' => '127.0.0.1', 'port' => 6380)));
/* el Jeffe */
$redis = new Rediska($options);
while (true) {
$first_url = $redis->popFromListBlocking(SRC_QUEUE, 0, SRC_QUEUE);
if($first_url){
$redis->appendToList(WORK_QUEUE, $first_url);
}
@zircote
zircote / Api.php
Created Jun 4, 2011
Unit Testing Web-Services With Zend Framework
View Api.php
<?php
class Api extends Zend_Http_Client
{
/**
*
* @group Account
*/
public function accountStatus()
{
@zircote
zircote / Model_BugsServiceAcl.php
Created Jun 10, 2011
Redis/Rediska Backed Zend_Acl Container
View Model_BugsServiceAcl.php
<?php
/**
*
* This could be a mechanism that builds acl lists from the database or file
* based storage.
* @author zircote
*
*/
class Model_BugsServiceAcl
{
@zircote
zircote / PrivateIPAssertion.php
Created Jun 13, 2011
Private IP address Zend_Acl Assertion
View PrivateIPAssertion.php
<?php
require_once 'Zend/Acl/Assert/Interface.php';
/**
*
* Assert the REMOTE_ADDR of the reqeust is from a private IP address
* @author zircote
*
*/
class PrivateIPAssertion implements Zend_Acl_Assert_Interface
{
@zircote
zircote / prowl-logging.php
Created Jul 2, 2011
A Prowl Log Writer for Zend_Log
View prowl-logging.php
<?php
$prowl = array(
'apikey' => '072a7159e...e36ebe57',
// 'apikey' => array('072a7159e...e36ebe57','072a7159e...e36ebe57','072a7159e...e36ebe57'), //for multi-keys
'priority' => Skulk_Client_Message::PRIORITY_EMERGENCY, // optional
'url' => 'http://www.zircote.com/admin/console', // optional url to forward the user to.
'event' => 'Error logging via Prowl with Zend_Log', // optional Your message header
// 'providerkey' => '072a7159e9e8f......e7765cd11c229e36ebe57' // optional
);
@zircote
zircote / Bayuex.php
Created Jul 27, 2011
BayueX Client for PHP utlizing Zend_Service_Abstract
View Bayuex.php
<?php
require_once 'Zend/Service/Abstract.php';
require_once 'Zend/Json.php';
/**
* A PHP CometD Publisher
* @author zircote / Robert Allen
* Publishing:
* <code>
* $bayuex = new Bayuex('http://localhost:8080');
* $i = 0;
@zircote
zircote / ssh.sh
Created Sep 26, 2011
Convert a AWS PEM into a ssh pub key
View ssh.sh
ssh-keygen -y -f private_key1.pem > public_key1.pub
You can’t perform that action at this time.