Skip to content

Instantly share code, notes, and snippets.

View hubertperron's full-sized avatar

Hubert Perron hubertperron

  • Québec, Québec, Canada
View GitHub Profile
@hubertperron
hubertperron / gist:1f6a11e75a558ccc9dab
Created June 23, 2014 14:44
Unifik controller with APYDatagrid example
<?php
/**
* Lists all Allergen entities.
*
* @return Response
*/
public function listAction()
{
$source = new Entity('AlikiSystemBundle:Allergen');
@hubertperron
hubertperron / gist:be337c8c2105b21fb671
Created June 23, 2014 14:40
Unifik list with APYDataGrid
{% extends 'AlikiSystemBundle:Backend/Allergen:layout.html.twig' %}
{% block content_header %}
<h1>{% trans %}Allergens List{% endtrans %}</h1>
{% endblock %}
{% block content_main %}
{{ grid(grid, _self) }}
{% endblock content_main %}
{% macro generate(mapping) %}
{% if mapping.type == 'route' %}
<a href="{{ path(mapping.target) }}">{{ mapping.section|default('Link'|trans) }}</a>
{% elseif mapping.type == 'render' %}
{{ render(controller(mapping.target)) }}
{% elseif mapping.type == 'include' %}
{% include mapping.target %}
{% elseif mapping.type == 'url' %}
<a href="{{ mapping.target }}">{{ mapping.section|default('Link'|trans) }}</a>
@hubertperron
hubertperron / gist:5209900
Created March 21, 2013 01:01
OS X MsSQL install
xcode
command line tools
brew
brew install unixodbc
brew edit freetds # ajouter --enable-msdblib dans les flags
brew install freetds --with-unixodbc
@hubertperron
hubertperron / gist:4480399
Last active December 10, 2015 19:18
OS X Symfony2 developer tools install script
#!/bin/bash
# Ask for the administrator password upfront
sudo -v
### System preferences ###
# source:
# ~/.osx — http://mths.be/osx
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
@hubertperron
hubertperron / gist:3824153
Created October 3, 2012 00:14
Symfony 2.0 multiple firewalls sample configuration file
security:
encoders: ~
providers:
doctrine:
entity: { class: FQCN, property: username }
firewalls:
dev:
@hubertperron
hubertperron / gist:1673976
Created January 25, 2012 01:19
git cheatsheet
# untrack a file that has already been added/initialized to your repository but not delete it
git rm --cached file
# show information on origin
git remote show origin
# unstage a file
git reset HEAD file
# merge a branch from a remote repository
@hubertperron
hubertperron / gist:1670930
Created January 24, 2012 16:20
Add qTip to JQueryUI datepicker date instances
<div class="calendrier"></div>
<script type="text/javascript">
$(function(){
$(".calendrier").datepicker({
beforeShowDay: function(selectedDate){
var evenements = <?php echo $activites_json ?>;
var active = false;