Skip to content

Instantly share code, notes, and snippets.

View fritz-gerneth's full-sized avatar

Fritz Gerneth fritz-gerneth

  • funct GmbH
  • Munich
View GitHub Profile
@fritz-gerneth
fritz-gerneth / Advanced use
Created March 16, 2013 09:44
Suggested router API/Interface
class MVCRoute
{
public function getController();
}
class MVCDispatcher
{
var template = router.match(request).getController();
// render template into view, or pass it to view-package, ...
}
// Very simple controller
var AboutController = function () {
this.dispatch = function (route) {
if (route.url == '/about') {
return Template['about'];
}
};
};
// Init Router
Handlebars.registerHelper('currentUserName', function () {
var user = Meteor.user();
if (_.isUndefined(user) || _.isNull(user)) {
return new Handlebars.SafeString("<i class='icon-spin icon-spinner'></i> Login");
}
return user.emails[0].address;
});
#!/usr/bin/env bash
cd /home/meteor/xxx
export MONGO_URL='mongodb://meteor:xxxx@localhost:27017/xxx-core'
export ROOT_URL='http://xxx.xxx.de'
export PORT=20000
export MAIL_URL='jenkins:[email protected]:25'
function start_app {
NODE_ENV=production nohup "node" "/home/meteor/xxx/main.js" 1>>"/home/meteor/xxx/log/xxx.log" 2>&1 &
echo $! > "/home/meteor/xxx/bin/innoaccel.pid"
Installing smart packages
fs.js:561
return binding.symlink(preprocessSymlinkDestination(destination, type),
^
TypeError: dest path must be a string
at Object.fs.symlinkSync (fs.js:561:18)
at Package.installInto (/usr/local/lib/node_modules/meteorite/lib/dependencies/package.js:118:10)
at LocalSource.fetch (/usr/local/lib/node_modules/meteorite/lib/sources/local.js:25:3)
at Package.fetch (/usr/local/lib/node_modules/meteorite/lib/dependencies/package.js:79:15)
class F
{
public $a = false;
public $b = false;
public function __construct($a)
{
$this->a = true;
}
return array(
'di' => array(
'instance' => array(
'alias' => array(
'feedaggregator' => 'Fge\Aggregator'
),
'Fge\Aggregator' => array(
'parameters' => array(
'feeds' => array(
'sdd',
<?php
namespace Test;
use \Zend\EventManager\EventCollection,
\Zend\EventManager\EventManagerAware,
\Zend\Di\Locator,
\Zend\EventManager\SharedEventCollectionAware,
\Zend\EventManager\SharedEventCollection;
<?php
class MyController extends Zend_Controller_Action
{
private $_modelA;
private $_modelB;
public function doSomethingAction()
{
$this->_modelA->create();
}
class Module
{
public function init(Manager $moduleManager)
{
$events = $moduleManager->events();
$sharedEvents = $events->getSharedCollections();
$sharedEvents->attach('Zend\Mvc\Bootstrap', 'bootstrap', array($this, 'test'), 900);
}
public function test($e)