Skip to content

Instantly share code, notes, and snippets.

(function($) {
return $.fn.extend({
findLabel: function() {
var matched;
matched = [];
this.each(function() {
var $label, $this, id;
$this = $(this);
id = $this.attr('id');
if (id != null) {
(function($) {
return $.fn.resetInput = function(callback) {
return this.each(function() {
var $el, type;
$el = $(this);
type = this.type;
switch (type) {
case 'select-one':
case 'select-multiple':
$el.find('option').each(function() {
<?php
namespace CommonBundle\Form\Type;
use CommonBundle\Entity\Country;
use Doctrine\Common\Persistence\ManagerRegistry;
use Geocoder\ProviderAggregator;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
SELECT id, ST_Distance_Sphere(Point(-73.951368, 40.716743), geom) as distance_in_meters, tags, ST_AsText(geom)
FROM nodes
WHERE ST_Contains( ST_MakeEnvelope(
Point((-73.951368+(20/111)), (40.716743+(20/111))),
Point((-73.951368-(20/111)), (40.716743-(20/111)))
), geom )
AND match(tags) against ("+thai +restaurant" IN BOOLEAN MODE)
ORDER BY distance_in_meters LIMIT 10
@ABM-Dan
ABM-Dan / gist:1cc33b82806a203b68f955c2a290d8b6
Created June 8, 2016 17:07
Daniele for russian/belarusian speakers
даніэлe <- pronounce the last e as if there was a consonant after. (like the е in шея)
<?php
/**
* Get service.
*/
public function getService()
{
if (null === $this->service) {
$this->service = $this->container->get($this->serviceName);
}
<?php
// *Snip*
class CreditCardType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
/**
* @var Entity\CreditCard $data
SELECT
w.customer_id,
b.*
FROM l
INNER JOIN b ON l.id = b.lot_id
LEFT JOIN w ON l.id = w.lot_id
AND w.customer_id = b.customer_id
WHERE b.customer_id = 17
# AND b.active = 1
<?php
// AccountingInvoiceItem Entity
/**
* Transactions used to pay for this invoice item.
*
* @var AccountingTransaction[]
*
* @ORM\OneToMany(targetEntity="CommonBundle\Entity\AccountingTransaction", mappedBy="invoice_item", cascade={"persist"})
*/
private $transactions;
# php app/console doctrine:generate:entity --entity=xyz
Welcome to the Doctrine2 entity generator
This command helps you generate Doctrine2 entities.
First, you need to give the entity name you want to generate.