This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyParsedown extends \Parsedown | |
{ | |
function __construct() | |
{ | |
$this->InlineTypes['@'][]= 'UserMention'; | |
$this->inlineMarkerList .= '@'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\EventListener; | |
use Symfony\Component\Console\Event\ConsoleErrorEvent; | |
use Psr\Log\LoggerInterface; | |
class ConsoleExceptionListener | |
{ | |
private $logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Twig; | |
use Symfony\Component\Routing\RouterInterface; | |
use Symfony\Component\Templating\EngineInterface; | |
use Symfony\Component\Translation\TranslatorInterface; | |
class PaginationExtension extends \Twig_Extension | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Util; | |
use Gedmo\Sluggable\Util as Sluggable; | |
use Swift_Events_SendEvent; | |
use Swift_Events_SendListener; | |
use Symfony\Component\Filesystem\Exception\IOExceptionInterface; | |
use Symfony\Component\Filesystem\Filesystem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Twig; | |
/** | |
* Class InlineSvgExtension. | |
* | |
* Filter which converts svg file and returns an inline svg string | |
* | |
* Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function htmlConstraintValidation(e, el) { | |
var form = $(el).closest('form'); | |
$(form).find('[required]').each(function (i, input) { | |
if (input.validity.valueMissing) { | |
console.log('Please fill in all required fields!'); | |
e.preventDefault(); | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Form; | |
use AppBundle\Form\DataTransformer\NumberToStringTransformer; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\Extension\Core\Type\TextType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$finder = PhpCsFixer\Finder::create() | |
->in(__DIR__.'/src') | |
; | |
return PhpCsFixer\Config::create() | |
->setRules([ | |
'@Symfony' => true, | |
'array_indentation' => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"keys": ["ctrl+7"], | |
"command": "toggle_comment", | |
"args": { | |
"block": false | |
} | |
}, | |
{ | |
"keys": ["ctrl+shift+7"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#idForm").on('submit', function (e) { | |
$.ajax({ | |
type: $(this).attr('method'), | |
url: $(this).attr('action'), | |
data: $(this).serialize() | |
}).done(function(data) { | |
console.log(data); | |
}).fail(function(XMLHttpRequest, textStatus, errorThrown) { | |
console.log('Error'); | |
}); |