Skip to content

Instantly share code, notes, and snippets.

View mridgway's full-sized avatar

Michael Ridgway mridgway

View GitHub Profile
<?php
class ExceptionTest extends Exception {}
$data;
try {
if (true) {
try {
throw new ExceptionTest();
} catch (ExceptionTest $e) {
<?php
$em = $this->_em = \Zend_Registry::getInstance()->get('doctrine');
$this->_tool = new \Doctrine\ORM\Tools\SchemaTool($this->_em);
$this->_classes = array (
$em->getClassMetadata('Core\Model\Module'),
$em->getClassMetadata('Core\Model\Module\Block'),
$em->getClassMetadata('Core\Model\Module\Content'),
$em->getClassMetadata('Core\Model\AbstractPage'),
<?php
// $em is d2 entity manager
//
$class = array(
'Blog\Model\Article',
'User\Model\User'
);
$tool = new \Doctrine\ORM\Tools\SchemaTool($this->_em);
<?php
interface ArrayTransformer
{
/**
* @abstract
* @param object $object
* @return array
*/
public function toArray($object);
@mridgway
mridgway / gist:2785983
Created May 25, 2012 05:37
mojito test failures
FAILURE DETAILS:
================
mojito-intl-addon-tests :: intl tests :: formatDate() delegates to Y.DataType.Date.format
TypeError: Cannot read property 'Date' of undefined
at [object Object].formatDate() delegates to Y.DataType.Date.format (/Users/mike/Projects/mojito/source/lib/tests/autoload/app/addons/ac/intl-tests.common.js:95:43)
at [object Object]._resumeTest (/Users/mike/Projects/mojito/source/node_modules/yuitest/lib/yuitest-node.js:3117:29)
at [object Object]._runTest (/Users/mike/Projects/mojito/source/node_modules/yuitest/lib/yuitest-node.js:3325:26)
at [object Object]._run (/Users/mike/Projects/mojito/source/node_modules/yuitest/lib/yuitest-node.js:3073:30)
at Timer._callback (/Users/mike/Projects/mojito/source/node_modules/yuitest/lib/yuitest-node.js:3238:44)
at Timer.<anonymous> (timers.js:172:14)
YUI.add('mojito-mu', function(Y, NAME) {
Y.mojito.addons.viewEngines.mu = Y.mojito.addons.viewEngines.hb;
}, '0.1.0', {requires: [
'mojito-hb'
]});
var async = require('async');
mysqlConnection.query(queryString, function selectCb(error, results, fields) {
var subQueryFns = [];
for (i=0; results.length; i++) {
subQueryFns.push(function (cb) {
mysqlConnection.query(deeperQueryString, function selectCb (error, results, fields) {
cb(error, results);
}
});
}
diff --git a/lib/route.js b/lib/route.js
index 673bc7c..86835f1 100644
--- a/lib/route.js
+++ b/lib/route.js
@@ -183,7 +183,8 @@ function getResourceRoute(stores) {
function postRoute(stores) {
return function (req, res) {
- var api_requests = {},
+ var timer = req.perf.start(req.id || 'td-api', 'xhr_lifetime'),
[{"id":"m_1","authorName":"Bill","text":"Hey Jing, want to give a Flux talk at ForwardJS?","timestamp":1415178357749},{"id":"m_2","authorName":"Bill","text":"Seems like a pretty cool conference.","timestamp":1415178367749},{"id":"m_3","authorName":"Jing","text":"Sounds good. Will they be serving dessert?","timestamp":1415178377749},{"id":"m_4","authorName":"Bill","text":"Hey Dave, want to get a beer after the conference?","timestamp":1415178387749},{"id":"m_5","authorName":"Dave","text":"Totally! Meet you at the hotel bar.","timestamp":1415178397749},{"id":"m_6","authorName":"Bill","text":"Hey Brian, are you going to be talking about functional stuff?","timestamp":1415178407749},{"id":"m_7","authorName":"Brian","text":"At ForwardJS? Yeah, of course. See you there!","timestamp":1415178417749}]
'use strict';
var bluebird = require('bluebird');
module.exports = function promisifyPlugin(options) {
options = options || {};
/**
* @class PromisifyPlugin
*/
return {
name: 'PromisifyPlugin',