Skip to content

Instantly share code, notes, and snippets.

View primitive-type's full-sized avatar

Percy Hatcherson primitive-type

View GitHub Profile
@grabbou
grabbou / gist:ead3e217a5e445929f14
Last active March 24, 2017 02:13
How to use ES6 generators with Hapi.js <3
import co from 'co'
// Generator controller,
// this.models refers to Sequelize models added with server.bind()
function* loginController(request) {
let user = yield this.models.User.find({
where: {
email: request.payload.email
}
@weierophinney
weierophinney / Module.php
Created July 18, 2013 15:22
Module-conditional setup in ZF2
<?php
namespace MyFunnyValentine;
// Detect if the currently matched route belongs to this module.
// The assumption is that the controller name includes the module namespace.
class Module
{
public function onBootstrap($e)