Skip to content

Instantly share code, notes, and snippets.

@zircote
zircote / rpoplpush
Created September 21, 2012 02:32
Redis rpoplpush example for circular queue
redis 127.0.0.1:6379> LPUSH t vox1
(integer) 1
redis 127.0.0.1:6379> LPUSH t vox2
(integer) 2
redis 127.0.0.1:6379> LPUSH t vox3
(integer) 3
redis 127.0.0.1:6379> LPUSH t vox4
(integer) 4
redis 127.0.0.1:6379> LPUSH t vox5
(integer) 5
@zircote
zircote / Ssh2Test.php
Created September 3, 2012 19:56
Functional testing php-ssh2 commands with PHPUnit and Vagrant
<?php
/**
*
*/
class Ssh2Test extends PHPUnit_Framework_TestCase
{
/**
* @var resource
*/
@zircote
zircote / ZendJobQueue.php
Last active October 7, 2015 15:48
Autocompletion file for ZendJobQueue
<?php
/**
* The ZendJobQueue is a PHP class that implements a connection to the Job Queue Daemon
*
*/
class ZendJobQueue
{
/**
@zircote
zircote / build.xml
Created July 13, 2012 00:01
Ant file for php CI/Dev
<?xml version="1.0" encoding="UTF-8"?>
<project name="Project Name" default="build" basedir=".">
<property environment="env"/>
<!--<property name="env.APPLICATION_ENV" value="development"/>-->
<property name="source" value="."/>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
@zircote
zircote / OAuth2\ZendDb.php
Created July 12, 2012 20:39
An example of using Zend_Db_Adapter_* as the storage connector for OAuth2 library at https://github.com/zircote/oauth2-php
<?php
/**
* @category Cautela
* @package Auth
* @subpackage OAuth2
*/
namespace Auth\OAuth2;
use OAuth2\Grant\GrantCodeInterface;
use OAuth2\RefreshTokensInterface;
use Zend_Db_Adapter_Abstract;
@zircote
zircote / deployment-descriptor-1.0.xsd
Created July 12, 2012 20:31
Zend Server/Cluster Manager Deployment XSD schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.zend.com/server/deployment-descriptor/1.0"
targetNamespace="http://www.zend.com/server/deployment-descriptor/1.0"
elementFormDefault="qualified">
<xs:element name="package">
<xs:annotation>
<xs:documentation></xs:documentation>
</xs:annotation>
<xs:complexType>
@zircote
zircote / commandline.sh
Created July 8, 2012 17:31
Swagger-PHP example output from tests/fixtures/*
$ ./bin/swagger -p tests/fixtures/ -f
/usr/local/zend/apache2/htdocs/Swagger-PHP/resources.json created
/usr/local/zend/apache2/htdocs/Swagger-PHP//leadresponder.json created
$
@zircote
zircote / composer.json
Created May 19, 2012 02:28
Example Composer utlizing Zend Framework 1.11.9 via SVN
{
"name": "zircote/Org",
"type": "library",
"version": "0.2.0",
"time" : "2012-04-21",
"description": "New world API Order",
"keywords": ["api"],
"homepage": "http://github.com/zircote/Org/",
"repositories": [
{
@zircote
zircote / Zend_Application_Resource_Mongo.php
Created May 11, 2012 13:19
A Mongo Zend Application Resource
<?php
/**
*
* @category Zend
* @package Zend_Application
* @subpackage Resource
*/
/**
* @see Zend_Application_Resource_ResourceAbstract
@zircote
zircote / index.php
Created April 28, 2012 11:51
Bootstrapping Zend Framework 1.x with composer namespaces
<?php
/**
* Bootstrap the App in an annonymous function preserving global namespace.
*/
call_user_func(function(){
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH',
realpath(dirname(__FILE__) . '/../application'));