Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Working from home...

Massimiliano Arione garak

:octocat:
Working from home...
View GitHub Profile
@lsv
lsv / README.md
Last active Oct 6, 2021
KNP Menu Bundle - Bootstrap 4 and Font Awesome 4
View README.md
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active Jan 19, 2022
How to add a collapsible section in markdown.
View markdown-details-collapsible.md

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@JusteLeblanc
JusteLeblanc / materialize_form_theme.html.twig
Created Feb 27, 2017
Symfony2 form theme to integrate Materialize in your Symfony2 forms
View materialize_form_theme.html.twig
{% extends 'form_div_layout.html.twig' %}
{% block form_row -%}
<div class="row{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}">
<div class="input-field col s12">
{{- form_widget(form) -}}
{{- form_label(form) -}}
{{- form_errors(form) -}}
</div>
</div>
@JusteLeblanc
JusteLeblanc / materialize_layout.html.twig
Created Dec 16, 2016
Symfony2 Form Theme for Materialize
View materialize_layout.html.twig
{% extends 'form_div_layout.html.twig' %}
{% block form_row -%}
<div class="row{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}">
<div class="input-field col s12">
{{- form_widget(form) -}}
{{- form_label(form) -}}
{{- form_errors(form) -}}
</div>
</div>
@bastman
bastman / docker-cleanup-resources.md
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@nateevans
nateevans / MenuBuilder.php
Created Apr 3, 2014
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (see http://bit.ly/1sd1rJr , thanks to Niels Mouthaan!)
View MenuBuilder.php
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@bksunday
bksunday / test-run-failed
Last active Dec 14, 2017
When using phpunit and logging output using TAP (from command line but easier from phpunit xml configuration), this script will re-run phpunit with only Wailed tests from last test.
View test-run-failed
#!/bin/bash
# parses a tap log file from phpunit to find failed tests
#
# This assumes you setup a phpunit.xml (or .dist.xml) so simply add something like the following under <phpunit>
# <logging>
# <log type="tap" target="/tmp/.projectname-phpunit-test-log.tap" />
# </logging>
#
# tap is used instead of json and xml because these log files get big
@Sitebase
Sitebase / Doctrine.php
Created Feb 22, 2013
Custom doctrine type to store uuid's as binary(16) values in a MySQL database. Set the column type that you want to use as BINARY(16) in MySQL and your good to go.
View Doctrine.php
\Doctrine\DBAL\Types\Type::addType('uuid', 'BuboBox\Doctrine2\DBAL\Types\UuidType');
@jmather
jmather / deploy.rb
Created Aug 30, 2012
Remove dev only files in production via capifony
View deploy.rb
set :dev_only_files, [web_path + "/app_dev.php", web_path + "/check.php", web_path + "/config.php"]
set :production, true
after 'symfony:cache:warmup', 'pff:productify'
namespace :pff do
desc "Remove app_dev.php, check.php and config.php from production deployment"
task :productify, :except => { :production => false } do
if dev_only_files
pretty_print "--> Removing app_dev.php, config.php, and check.php from web"
@cgmartin
cgmartin / pre-commit
Last active Oct 9, 2015
ZF2 Git pre-commit hook
View pre-commit
#!/usr/bin/env php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP errors (lint), and make sure the
* code is PSR-2 compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*/