Skip to content

Instantly share code, notes, and snippets.

View localheinz's full-sized avatar

Andreas Möller localheinz

View GitHub Profile
### Keybase proof
I hereby claim:
* I am localheinz on github.
* I am localheinz (https://keybase.io/localheinz) on keybase.
* I have a public key whose fingerprint is 988E 9FE9 A7F1 3DD6 9FD2 9F0F 3A04 5C98 08E7 46DD
To claim this, I am signing this object:
#!/usr/bin/env php
<?php
$changes = [];
exec(
'git diff --cached --name-status --diff-filter=ACM',
$changes
);
@localheinz
localheinz / example.html
Created February 7, 2013 12:22
As in your email.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/asset/css/styles.less">
</head>
<body>
<div class="container">
<div class="row">
<div class="span4">
@localheinz
localheinz / User.php
Last active December 10, 2015 01:34
Translation of validation error messages
<?php
/**
* Please be aware that __($messageId) is just as function that returns $messageId - it is used for gettext to pick up
* message ids.
*/
$this->inputFilter
->add(array(
'name' => 'firstname',
'validators' => array(
@localheinz
localheinz / Module.php
Created December 20, 2012 20:25
Example of how to wire up a database adapter with ZF2
<?php
// module/MyNamespace/Module.php
namespace MyNamespace;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
use Zend\ServiceManager\ServiceManager;
@localheinz
localheinz / menu.phtml
Created December 11, 2012 15:18
Navigation view helper plugin prepends the normalised name of the plugin to the id of a page, if specified
<?php /* @var $container Zend\Navigation\Navigation */ ?>
<?php if ($container->hasPages()): ?>
<ul>
<?php foreach ($container->getPages() as $page): ?>
<?php /* @var $page Zend\Navigation\Page\AbstractPage */ ?>
<?php if ($page->isVisible()): ?>
<li><?php echo $this->navigation()->menu()->htmlify($page); ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>