Skip to content

Instantly share code, notes, and snippets.

View dbykadorov's full-sized avatar

Dmitry dbykadorov

View GitHub Profile
@dbykadorov
dbykadorov / build.xml
Created January 8, 2013 09:14 — forked from kbond/build.xml
ANT buildfile for run phpunit tests in Symfony 2 projects
<?xml version="1.0" encoding="UTF-8" ?>
<project name="[PROJECT_NAME]" default="build" basedir=".">
<property environment="env"/>
<loadfile property="version" srcfile="${basedir}/VERSION"/>
<condition property="bat" value=".bat" else="">
<os family="windows" />
</condition>
<target name="test">
<delete dir="${basedir}/build"/>
@dbykadorov
dbykadorov / labels.js
Last active December 14, 2015 05:40
Use from labels as fields hints
/**
* Label as hints magick.
*/
$.fn.labelHint = function() {
return this.each(function() {
var current = $(this);
var id = current.attr("id");
var label = $("label[for='" + id + "']:not(.error)");
var currentPosition = current.position();
if (current.val() == label.html() || current.val() == '') {
@dbykadorov
dbykadorov / HomeController.cs
Created February 17, 2014 09:26
C#: workarround to avoid incorrect subject base64 encoding (with non-ascii subjects) // using .nem mvc 5 and mvc mail and Mandrill app
using System;
using System.Net;
using System.Net.Mail;
using System.Web.Mvc;
using Mvc.Mailer;
namespace MandrilloTest.Controllers
{
public class HomeController : Controller
{
<?php
namespace Acme\DemoBundle\Form\DataTransformer;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\PersistentCollection;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
@dbykadorov
dbykadorov / README.md
Created September 14, 2016 19:44 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \