Skip to content

Instantly share code, notes, and snippets.

View davidmintz's full-sized avatar

David Mintz davidmintz

View GitHub Profile
@davidmintz
davidmintz / attaching-Doctrine-entity-listener.php
Last active March 1, 2017 22:03
just a snippet for discussion purposes
<?php
namespace MyAwesomeModule;
use Zend\Mvc\MvcEvent;
use Doctrine\ORM\Events;
class Module
{
@davidmintz
davidmintz / display_validation_errors.js
Created December 29, 2016 17:34
a js function that displays validation error messages from an object whose structure matches that returned by Zend\Form\Form::getMessages()
displayValidationErrors = function(validationErrors) {
$('.validation-error').empty();
for (var field in validationErrors) {
//console.log("examining field "+field);
for (var key in validationErrors[field]) {
// console.log("examining key "+key);
var message = validationErrors[field][key];
var element = $('#' +field);
var errorDiv = $('#error_'+field);
if (! errorDiv.length) { errorDiv = null;}
@davidmintz
davidmintz / drush-turn-off-aggregate-assets.txt
Last active September 9, 2015 12:21 — forked from chrisl8888/drush-turn-off-aggregate-assets.txt
drush disable js/css aggregation
// To turn on JS Aggregation
drush vset preprocess_js 1 --yes
// To clear all Cache
drush cc all
// To disable JS Aggregation
drush vset preprocess_js 0 --yes
// To clear cache of JS and CSS only