Skip to content

Instantly share code, notes, and snippets.

@damianociarla
damianociarla / DoctrineQueryPart.php
Created August 16, 2017 13:14
Helps you not duplicate DQL parts in your queries
<?php
namespace Helper;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
class DoctrineQueryPart
{
/**
@damianociarla
damianociarla / remove-suffix-class.js
Last active October 28, 2015 11:22
Remove all suffix-classes from selected elements
jQuery.fn.extend({
removeSuffixClass: function(prefix) {
return this.removeClass(function (index, css) {
var pattern = '\\b'+prefix+'\\S+';
var re = new RegExp(pattern, 'g');
return (css.match(re) || []).join(' ');
});
}
});