Skip to content

Instantly share code, notes, and snippets.

View garak's full-sized avatar
:octocat:
Working from home...

Massimiliano Arione garak

:octocat:
Working from home...
View GitHub Profile
@lsv
lsv / README.md
Last active March 20, 2024 14:16
KNP Menu Bundle - Bootstrap 4 and Font Awesome 4
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active April 23, 2024 15:35
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@JusteLeblanc
JusteLeblanc / materialize_form_theme.html.twig
Created February 27, 2017 21:09
Symfony2 form theme to integrate Materialize in your Symfony2 forms
{% 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 December 16, 2016 14:19
Symfony2 Form Theme for Materialize
{% 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 March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

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 April 3, 2014 16:56
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (see http://bit.ly/1sd1rJr , thanks to Niels Mouthaan!)
<?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 December 14, 2017 10:01
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.
#!/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 February 22, 2013 13:48
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.
\Doctrine\DBAL\Types\Type::addType('uuid', 'BuboBox\Doctrine2\DBAL\Types\UuidType');
@jmather
jmather / deploy.rb
Created August 30, 2012 05:51
Remove dev only files in production via capifony
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 October 9, 2015 06:17
ZF2 Git pre-commit hook
#!/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)
*/