This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Zend Framework (http://framework.zend.com/) | |
* | |
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository | |
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
*/ | |
namespace DTUXFixture; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router: | |
routes: | |
home: | |
type: Zend\Mvc\Router\Http\Literal | |
options: | |
route: / | |
defaults: | |
controller: Application\Controller\Index | |
action: index | |
application: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrantfile | |
# -*- mode: ruby; -*- | |
Vagrant.configure("2") do |config| | |
config.vm.guest = :freebsd | |
config.vm.box_url = "http://files.wunki.org/freebsd-10.0-amd64-wunki.box" | |
config.vm.box = "freebsd-10.0-amd64-wunki" | |
config.vm.network "private_network", ip: "10.0.1.10" | |
# Use NFS as a shared folder | |
config.vm.synced_folder ".", "/vagrant", :nfs => true, id: "vagrant-root" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mongod -f /etc/mongodb.conf --smallfiles & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host.findOne({nome: req.body.host}) | |
.populate('dominio') | |
.exec(function (err, host) { | |
console.log(host); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\View\Helper; | |
//use Zend\View\Helper\AbstractHelper; | |
use Zend\Form\View\Helper\AbstractHelper; | |
use Zend\Form\Form; | |
class RenderForm extends AbstractHelper { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Hydrator; | |
use DoctrineModule\Stdlib\Hydrator\DoctrineObject; | |
class DateHydrator extends DoctrineObject { | |
protected function handleTypeConversions($value, $typeOfField) { | |
if ($typeOfField == 'date') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Doctrine\Common\DataFixtures\Loader; | |
use Doctrine\Common\DataFixtures\Executor\MongoDBExecutor; | |
use Doctrine\Common\DataFixtures\Purger\MongoDBPurger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Grooscript Angular.js TODO example from https://angularjs.org/ | |
//You need next release of grooscript to run it (1.0.1) | |
class TodoController implements AngularController { | |
def todos = [ | |
[text:'learn angular', done: true], | |
[text:'build an angular app', done: false] | |
] | |
def addTodo() { | |
scope.todos << [text: scope.todoText, done: false] | |
scope.todoText = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp') | |
.factory('Traits', function() { | |
return { | |
apply: function (_class, _trait) { | |
_.each(_trait, function (method, name) { | |
_class.prototype[name] = method; | |
}); | |
} | |
} | |
}); |
OlderNewer