Skip to content

Instantly share code, notes, and snippets.

{% if app.session.flashbag.peekAll|length > 0 %}
{% set flashbag = app.session.flashbag.all %}
<script>
init.push(function () {
{% for type,messages in flashbag %}
{% for message in messages %}
PixelAdmin.plugins.alerts.add('<strong>{{ message[0]|trans }}</strong> {{ message[1]|trans(message[2], 'backend')|raw }}', {
type: '{{ type }}',
var chart = c3.generate({
data: {
columns: [
['data3', 19, 17, 10, 15, 12, 11],
['data1', 11, 15, 14, 13, 17, 17],
['data2', 17, 12, 18, 13, 15, 23],
['data4', 14, 11, 19, 18, 12, 15]
],
type: 'bar',
groups: [
/sbin/ip route|awk '/default/ { print $3 }'
docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' | xargs -L1 docker pull
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
@grachevko
grachevko / symfony
Created February 5, 2017 21:09 — forked from danielhauck/symfony
Symfony Bash Completion
## add me to /etc/bash_completion.d/
## cp FILE /etc/bash_completion.d/
## reload completion
## exec bash
_available_commands()
{
bin/console list --raw | awk '{print $1}'
}
<?php
declare(strict_types=1);
namespace App\Command;
use App\Symfony\EventDispatcher;
use Doctrine\DBAL\Driver\Connection;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\ConsoleEvents;
test -z $(find -name "*.php" -type f -not -path "./src/Migrations/*" -not -path "./tests/*" | while read -r file; do cat $file | grep '.\{121\}'; done) || ((find -name "*.php" -type f -not -path "./src/Migrations/*" -not -path "./tests/*" | while read -r file; do cat $file | grep '.\{121\}'; done) && exit 1)
<?php
namespace AppBundle\Extensions\Doctrine\ORM;
use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Connections\MasterSlaveConnection;
use Doctrine\DBAL\DBALException;
class ReopeningConnectionWrapper extends MasterSlaveConnection
{
<?php
declare(strict_types=1);
namespace App\Product\Quality;
use App\Entity\Product\Segment;
use Generator;
use InvalidArgumentException;
use Money\Money;