Skip to content

Instantly share code, notes, and snippets.

<?php
namespace MyBundle\Repository;
use MyBundle\Entity\Customer;
use Doctrine\ORM\EntityRepository;
class RecentSearchRepository extends EntityRepository
{
public function findRecentByUser(Customer $user)
<?php
namespace MyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* RecentSearch
*
* @ORM\Table("recent_search")
<?php
namespace MyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* MyEntity.
// Implements a works-as-you-expect version of .change on radio buttons
(function ($) {
$.fn.onTrueChange = function (callable) {
return this.each(function () {
var caller = $(this);
caller.data('cached-value', caller.is(':checked'));
return caller.closest('form').find('input[name="' + caller.attr('name') + '"]').change(function(){
if (caller.is(':checked') != caller.data('cached-value')){
caller.data('cached-value', caller.is(':checked'));
callable.call(caller);
// Implements a works-as-you-expect version of .change on radio buttons
(function ($) {
$.fn.fixChange = function (callable) {
return this.each(function () {
return $('[name[' + $(this).name + ']').change(callable.call($(this)))
});
};
}(jQuery));
@ABM-Dan
ABM-Dan / xdebug.sh
Last active January 14, 2016 17:06 — forked from maurotdo/xdebug.sh
Extended version of a bash script to turn xdebug on or off, it automatically restarts php-fpm after.
#!/bin/bash
#
# Script to turn xdebug on and off
# Permission to copy and modify is granted under the MIT license
# Last revised 2014-03-07
# Mauro Maggi <maurotdo (at) gmail (dot) com>
PHP=$(which php)
XDEBUG=$($PHP -i | grep -i xdebug | grep -i enabled)
INI=$($PHP -i | grep "xdebug.ini" | tr -d ',')
var selectricOptions = {
disableOnMobile: false,
onInit: function () {
var label, selectedClass, selectricWrapper;
selectricWrapper = $(this).parents('.selectric-wrapper');
selectedClass = selectricWrapper.find('option:selected').attr('class');
label = selectricWrapper.find('.label');
label.addClass(selectedClass);
if ($(this).data('placeholder')) {
return label.text($(this).data('placeholder'));
function submitRequest() {
var request = {};
if (query['sort'])
request['sort'] = query['sort'];
if (query['order'])
request['order'] = query['order'];
$.extend(request, query['parameters'], query['filters']);
request = $.param(request);
DEVICE=eth0
HWADDR=00:50:56:3e:7a:73
TYPE=Ethernet
UUID=6fb710cb-1218-42d1-b10e-454e985b2d05
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
eth0 Link encap:Ethernet HWaddr 00:50:56:3E:7A:73
inet addr:192.168.98.128 Bcast:192.168.98.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe3e:7a73/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:41 errors:0 dropped:0 overruns:0 frame:0
TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5692 (5.5 KiB) TX bytes:7350 (7.1 KiB)
lo Link encap:Local Loopback