Skip to content

Instantly share code, notes, and snippets.

server.js
var io = require('socket.io').listen(80);
io.sockets.on('connection', function (socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
});
@Hounddog
Hounddog / build.properties
Created May 9, 2012 09:42
V5 build properties
path.build = /vol/sys/shared/htdocs/devs-v5/mshwalbe/V5
environment = development
database.name = database name here
database.host = your host
database.login = username
database.password = password
solr.hostname = host
solr.username =
@Hounddog
Hounddog / gist:2644920
Created May 9, 2012 14:33
Install new V5 Dependencies
Instructions for installation of Dependencies
Remove your Pear Path from .bashrc in your home folder and all dependencies from it
#PATH="$PATH:/home/nmartin/pear/pear"
#export PATH
#alias phpunit='php /home/nmartin/pear/pear/phpunit'
#alias pear='/home/nmartin/pear/pear/pear'
#alias phpcs='/home/nmartin/pear/pear/phpcs'
@Hounddog
Hounddog / Instructions
Created May 14, 2012 17:27
Dojo Object Harness Continuous integration
install through npm
need to include
<script src="/socket.io/socket.io.js></script> into runner.html
@Hounddog
Hounddog / gist:2916711
Created June 12, 2012 10:08
Shell script to find if composer.lock has changed
#!/bin/sh
################################################################################
#
# Script to determine if composer.lock is updated through git and run an update
#
###############################################################################
diff=`git diff origin/master composer.lock`
echo 'Checking for Dependency Updates'
@Hounddog
Hounddog / Bootstrap
Created June 19, 2012 11:05
Implementing annotations in Zf
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
....
public function _registerAnnotations() {
AnnotationRegistry::registerNamespace('Annotation');
}
}
@Hounddog
Hounddog / EntityManager.php
Created June 19, 2012 13:24
current entity resource
<?php
use Doctrine\ORM\EntityManager,
Doctrine\ORM\Configuration,
Doctrine\DBAL\Event\Listeners\MysqlSessionInit,
Doctrine\Common\Cache\ArrayCache,
Doctrine\Common\Annotations\AnnotationRegistry,
Doctrine\Common\Annotations\AnnotationReader,
Doctrine\Common\Annotations\CachedReader,
Doctrine\Common\Annotations\IndexedReader,
Doctrine\ORM\Mapping\Driver\Driver,
path: module/Application/config
<?php
return array(
'router' => array(
'routes' => array(
'default' => array(
'type' => 'Zend\Mvc\Router\Http\Segment',
'options' => array(
'route' => '/[:controller[/:action]]',
'constraints' => array(
@Hounddog
Hounddog / Bootstrap.php
Created July 2, 2012 10:35
Zf2 Module Testing
<?php
namespace SiteModuleTest;
use Zend\Loader\AutoloaderFactory;
use ApplicationModuleTest\ServiceManagerTestCase;
$basePath = __DIR__ . '/../../../../';
chdir(__DIR__);
@Hounddog
Hounddog / connector.js
Created July 30, 2012 08:02
Ci implementation for dojo doh
define(["doh/runner", "dojo/_base/xhr", "dojo/_base/connect","dojo/json", "dojo/io-query"], function(doh, xhr, connect, json, ioQuery) {
var uri = window.location.search;
var query = uri.substring(uri.indexOf("?") + 1, uri.length);
var queryObject = ioQuery.queryToObject(query);
var data = json.stringify({'doh': 'start', "browser": queryObject.browser});
xhr.post({
url: "/receiver.php",
sync:true,